AnsweredAssumed Answered

LSM303D // Compass X,Y & Z's MSB locked

Question asked by pujolle.thomas on Mar 26, 2015
Latest reply on Feb 2, 2017 by Sprudzs.Edmunds
Hey there,

I recently installed a new LSM303D (accelerometer + compass) on my board and I am having some issues with it. I can read the data from the accelerometer fine, but the ones from the compass seem "locked", I read a total of 3 pairs of MSB-LSB, of which only the LSB change over time. Here is an exemple of reading (LSB on the left):
Mag X:-125 -1  Y:-93 -1    Z:-22 -1 
Mag X:-115 -1  Y:-101 -1  Z:-26 -1
Mag X:-119 -1  Y:-78 -1    Z:-34 -1

The LSBs change erratically regardless of the orientation of the sensor.

Here is the config I'm using:
ST_CTRL_REG1, 0x67
ST_CTRL_REG5, 0x60
ST_CTRL_REG6, 0x00
ST_CTRL_REG7, 0x80

I am using SPI. I don't really get how I am not getting the values right.

Any help or lead would help me a lot :)

Thanks !