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 REPLY 1
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.