cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from accelerometer of LSM303AGR

AKise
Associate III

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):

AKise_1-1733084035380.png

And this is what reading the WHO_AM_I_M register looks like (everything seems to be Ok):

AKise_0-1733083936821.png

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.

1 ACCEPTED SOLUTION

Accepted Solutions
AKise
Associate III

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.

View solution in original post

2 REPLIES 2
AKise
Associate III

Could you please move this topic to "MEMS and sensors"?

I can't find a way to remove it here and start it there.

AKise
Associate III

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.