Allowed values for interrupt threshold of LIS2DH12
Hi,
I am using a LIS2DH12 chip to detect the orientation(in 3D space) of a device.
For this purpose I'm using the INT pins in 6D position mode to generate interrupt signal/s, that will alert me if the device has exited/entered a known positional area.
My problem is the following: when setting the threshold for each used axis, I'm unable to utilize any value below 45 degrees. The application behaves in the
exact way I'm expecting it while the threshold value is set for a reference angle above or equal to 45 degrees but as soon as i enter a value below 45 degrees,
the interrupt flag starts to occur at output values much higher than expected.
This is my register configuration:
(using INT2 and only Y axis HIGH interrupt enabled, Normal mode, 10 bit resolution, +/- 2g full-scale):
CTRL_REG1 - 0x37
CTRL_REG2 - 0x0
CTRL_REG3 - 0x0
CTRL_REG4 - 0x0
CTRL_REG5 - 0x0
CTRL_REG6 - 0x20
INT2_CFG - 0xC8
INT2_SRC - 0x48
INT2_THS - 0x2D
When using this configuration I'm observing the interrupt signal going LOW when the Y axis acceleration value drops below ~0xB5.
0xB5 = 181, which is equal to 181*4mg = 724 mg
1g * sin(45) ~= 724 mg, which means everything is working as expected
Next I only modify the INT2_THS register to 0x20 and I am expecting the interrupt for the Y axis to go LOW when the acceleration reaches values below ~ 0x80.
0x80 = 128, 128*4mg = 512
1g * sin(30) = 500 mg
However, when testing, the output interrupt threshold appears to be around ~0xE0, which is higher than when I was using 45 degrees as a reference angle (but the angle is lower, so it doesn't make any sense?).
My question is - is this the intended behavior? Can you set an interrupt reference angle below 45 degrees in 6D position detection mode? If yes, then what am I doing wrong?
For reference this is how I calculate the threshold value:
for 45 degrees threshold angle -> 724 mg, 1LSB in THS is 16 mg so 724 / 16 = 45 (0x2D), expected output threshold @ 724/ 4 mg (1 LSB = 4mg in output registers) = 181 (0xB5)
for 30 degrees threshold angle -> ~512 mg, 1LSB in THS is 16 mg so 512 / 16 = 32 (0x20), expected output threshold @ 500/ 4 mg (1 LSB = 4mg in output registers) ~= 128 (0x80)
Any help would be appreciated.



