AnsweredAssumed Answered

LIS3DH Acceleration Data Interpretation

Question asked by Aaron Derbyshire on Oct 26, 2017
Latest reply on Oct 26, 2017 by Miroslav B

I have been looking over the datasheet and AN3308 for the LIS3DH Accelerometer in the hope that I can find a clear and concise explanation of how to interpret and scale the data.


So far I have seen (VALUE)*(FS/2^BIT_RESOLUTION) which intuitively makes sense but doesn't correspond to the sensitivity scalers mentioned in the datasheet:

Low Power Mode:      { 2g = 16mg/digit, 4g = 32mg/digit, 8g = 64mg/digit, 16g = 192mg/digit }

Normal Power Mode: { 2g = 4mg/digit,   4g = 8mg/digit,   8g = 16mg/digit, 16g = 148mg/digit }

High Power Mode:     { 2g = 1mg/digit,   4g = 2mg/digit,   8g = 4mg/digit,   16g = 12mg/digit }


Additionally to this I have seen some people state that the FIFO buffer is only capable of 10 bit resolution, which again contradicts the contents of the datasheets.

In an attempt to better understand the process I have been working with AN3308 Table  8 Example of Acceleration Data. I worked on the +350mg and -350mg examples and they worked as expected:

-350mg = 0xEA2h -> invert -> 0x15Dh -> +1 -> 0x15Eh = {256 + 64 + 16 + 8 + 4 + 2} x -1 = -350 x 1mg = -350mg
350mg = 350 x 1mg = 350mg

However this approach falls apart when working with the +1g and -1g examples. Given the data is held left aligned in two's complement I would have thought the values should have been:
-1g = (-1) / 1mg = -1000 =  0xC18h     BUT it is given as 0xC00h which is -1024.
+1g =   1  / 1mg =  1000 = 0x4E8h      BUT it is given as 0x040h  which is 64.


To top it all off I have seen comments which suggest all that is needed is a shift of the register to correlate with the bit resolution and then simply multiply by the scaler, but surely in two's complement format this will result in all values becoming positive because the MSB has now lost its place?

Has anyone got any clear instructions on the process?