2024-12-01 12:18 PM
Hello, I try to use a LSM303AGR sensor via I2C bus, the magnetometer part seems to work, I can write registers of the sensor and read them back, but the same approach for the accelerometer doesn't work.
I use 0x19 as I2C address of the accelerometer and 0x1E as I2C address of the magnetometer.
This is what reading the WHO_AM_I_A register looks like in a logic analyzer (No ACK received from the sensor, so reading was interrupted):
And this is what reading the WHO_AM_I_M register looks like (everything seems to be Ok):
It's almost impossible to get ACK from the accelerometer (sometimes it comes, but only for a few operations).
What I am doing wrong? I assume the I2C of the MCU itself is working correctly, otherwise I wouldn't get a response from the magnetometer. From the electronics side everything should be fine, since the same two I2C pins are used.
Solved! Go to Solution.
2024-12-02 10:50 AM
Problem is solved, most likely, there are two completely independent chips inside the chip, so the value of the pull-up resistors at which one of them works is not necessarily suitable for the other one for stable operation. Reducing the value of the pull-up resistors on the I2C bus solved the problem.
2024-12-01 01:50 PM
Could you please move this topic to "MEMS and sensors"?
I can't find a way to remove it here and start it there.
2024-12-02 10:50 AM
Problem is solved, most likely, there are two completely independent chips inside the chip, so the value of the pull-up resistors at which one of them works is not necessarily suitable for the other one for stable operation. Reducing the value of the pull-up resistors on the I2C bus solved the problem.