LIS2DH 6D mode not working properly
Hello,
I am trying to implement 6D mode. I am following 1:1 the code documented in the design tip DT0097.
I have been trying for a while: I2C interface is working and other modes of LIS2DH work properly.
As a safety measure, during the init I reset all registers back to their default value.
I read IRQ_SRC as soon as the INT1 line is raised.
However, the behavior is not as expected:
I do get interrupts when I move the board, but:
- If I move the board, I usually have 2 consecutive very near interrupts. The second is always with all the flags "low" set.
- The value in the flags is wrong: even with horizontal position I never get neutral X an Y, or even Z if I put the board in vertical
- The threshold, duration and registers seems to have no effect whatsoever
- If I rotate very slowly the board, I can succeed to flip it without triggering any interrupt
In the interrupt, I simply read INT1_SRC, that should be enough, right?
This is an example of events I get while flipping the Z axis of the board. Val is the (hex) value of INT1_SRC, while the rest is the string is my decoding of it.
Do you have any hint or fully-fledged example?
val:66 XU YD ZU
val:15 XD YD ZD
val:65 XD YD ZU
val:15 XD YD ZD
val:66 XU YD ZU
val:15 XD YD ZD
val:56 XU YD ZD
val:15 XD YD ZD
val:69 XD YU ZU
val:15 XD YD ZD
val:59 XD YU ZD
val:15 XD YD ZD
