2024-07-11, 05:23 AM
(2024-07-10, 06:54 PM)Mentula Wrote: Alright I'm pretty sure I have the problem nailed down.I think 100khz is probably best.. 10khz is going to be an issue because the driver samples the device 100 times per second. This is more than 10khz clock can support.
Turns out the cable i used was too long.
If I understood correctly the rpi3 uses a baudrate of 100kHz while the rpi5 uses 400kHz on the i2c bus by default which could explain this behavior.
Curiously, setting the baudrate of the pi5 to 100kHz did not allow it to function, but at 10kHz it did altough at a very low refresh rate.
Adding * to config.txt
Code:i2c_arm_baudrate=100000
Quote:I dismissed the length entirely when it worked on the pi3 and here we are..That is quite strange but not completely surprising.
I cut down my cable from a total of 800mm in steps of 100 and it started working at about 400mm at 400kHz. That is from the rpi5 pins to the imu pins.
The rpi3 handled the 800mm without problem.
Quote:I'm not smart enough to tell you why the accelerometer data made it through even a 4m cable but the compass only managed 400mm but atleast I have it working now.Inside this chip the compass is a separate sensor which communicates via i2c (internal i2c of the sensor) to the main imu, and the main imu buffers the readings internally and uses a separate i2c bus. I find this a bit strange as well.
Quote:Imu 1 and 2 (1v8) and 4 (adafruit 3v3) all work on the rpi5.
I dont know how to rename a thread but anyone who does is welcome to name it something more appropriate.
A huge thanks to everyone for the support.