2025-10-17 3:22 AM
Hi, I am working on the LIS2DH12, I have a problem to the appearance of acceleration data. I'm using full scale of +/- 2g and ODR of 400Hz. When the resolution is either 10-bit or 12-bit, only even number acceleration data is read(all x/y/z axis). The acceleration data is generally correct(but only even number). When resolution of 8-bit is selected, now both even and odd number acceleration data can be read. It shows the same appearance for ODR from 1Hz to 400Hz.
2025-10-20 3:24 AM
Hi @FFKF_Y ,
The behavior you're observing is actually expected and related to how the sensor outputs data and its internal data alignment.
As specified in the datasheet, LIS2DH12 outputs acceleration data in a 16-bit register for each axis. When configured for 12bit resolution (or 10bit), the sensor uses the most significant 12 bits of the 16-bit output, with the least significant 4 bits typically zeroed (6 if 10bit resolution). So the raw data is effectively shifted left, and the lower bits are always zero, causing the output values to be multiples of 2^(number of zeroed bits).
When reading 12-bit or 10-bit data, consider the zeroed bits as part of the resolution and scale your data accordingly. Shift the raw data right by the number of zero bits to get the actual measurement value.
2025-10-20 8:17 PM
The acceleration data is already the shifted data. For example, for 12-bit resolution, the raw data of x-axis is read as 0x0240. So the actual acceleration data should be 0x024(36 decimal). But these actual acceleration data appears to be even number as in resolution of 12-bit. Recently, I find that those data appears to be multiples of 4.
2025-10-21 7:11 PM
As for more information, here included one of data set collected:
full scale: +/-2g, resolution: 12-bit, ODR: 200Hz, watermark level: 28, device lay flat (x/y/z: 0g/0g/1g)
consecutive data collected from FIFO at watermark interrupt,
x y z
40 -4 1008
36 -4 1008
36 -4 1012
40 -4 1012
36 -4 1012
40 -4 1008
40 -4 1008
40 -4 1008
40 0 1004
40 -4 1008
44 -8 1008
44 -4 1012
44 -4 1008
44 -4 1008
36 -4 1008
36 -4 1008
36 -8 1012
40 -8 1016
40 -8 1016
40 -8 1012
40 -8 1008
36 -8 1012
40 -8 1012
44 -8 1012
44 -8 1012
44 -4 1004
40 0 1008
40 -4 1012
40 -4 1008
As shown in the data set, only multiples of 4 is read