It is my understanding that the 8-bit LIS3DH REFERENCE register is used to store the DC component of gravity vector.
However, I also understand that the gravity vector consists of 3 components (x, y, and z) each of which is at least 8 bits.
Clearly it is not possible to store 24 bits in an 8 bit REFERENCE register.
Clearly, I am confused. Can anybody explain this for me?
In normal mode, you read the REFERENCE register. The value returned doesn’t really mean anything, it triggers the high pass filter to use the current X, Y, Z acceleration values as the current force of gravity. As such, it works even when tilted, but you should only read the reference value when the LIS3DH is not moving, otherwise you’ll capture an invalid reference value.
Thanks rickkas7 for the quick reply.
So it seems to me that what you are saying is that the contents of the register are not useful; it is merely the act of reading it that performs a useful function?
It also suggests to me that - immediately after reading the REFERENCE register - the output registers (assuming that the LIS3DH has not moved) should all contain the value 00h, and that is indeed what I observe.
The REFERENCE register itself contains the value 0 whenever I test it, but I guess that doesn’t matter.