2018-04-02 12:52 PM
I'm currently trying to configure the LIS2DH12 sensor to enable high and low interrupt on all axis.
My target is to implement a shock detection and therefore I plan to use all axis (x,y,z) and as well high and low thresholds to detect every possible shock.
Therefore I configure the active interrupts at INT1_CFG (I'm only using INT1 as I plan to use INT2 for a tilt detection).
For this reason I wanted to program the INT1_CFG register with 0b00111111.
Unfortunately when I program '
0b00111111' no interrupt will be triggered (ISR not executed).
I tried the following combinations:
// setup INT1_CFG
data = 0b00111111; // all axis -> not workingdata = 0b00101010; // only high interrupts for x,y,z -> works data = 0b00010101; // only low interrupts for x,y,z -> not workingdata = 0b00101000; // only high interrupts for y,z -> works// not working: ISR not triggered
// works: ISR
triggered
Maybe you could help me, I think I got something wrong.
Many thanks in advance for your help!
#int1_cfg #lis2dh2018-04-03 07:56 AM
Batek.Miroslav
: It seems that you're an expert on this field. Maybe you could help me?2018-04-03 10:47 AM
The treshold is absolute value. So the high interrupt means that the absolute value of acceleration is above the threshold, low interrupt means the absolute value of acceleration is bellow the treshold. Following picture might help.
In your case onlu high interrupt needs to be enabled.
2018-04-03 01:02 PM
Many thanks for your fast reply and the great image!
Now I understand what is meant with the low treshold correctly!
Additionally I have another question to the INT1_SRC register. Even though I just configure x-,y- & z-axis for high tresholds only and activate only the high interrupts (so INT1_CFG is 0b00101010) the INT1_SRC register shows me the value '1' at xl, yl or zl (=axis low treshold reached).
I have to admit that everytime at least one of the xh, yh or zh registers is also at the value '1'.
Can I simply ignore these false-positives or is there some logic behind?
2018-04-04 07:38 AM
The bits in INT1_SRC are always set or reset but the interrupt is active only in case the conditions selected in INT1_CFG register are true.
So you can ignore the bits in INT1_SRC which you don't need.
2018-04-04 05:51 PM
Thank you very much!