cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DH12: High and Low Interrupt for all axis

Philipp D
Associate II
Posted on April 02, 2018 at 21:52

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 working

data = 0b00101010; // only high interrupts for x,y,z -> works

data = 0b00010101; // only low interrupts for x,y,z -> not working

data = 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 #lis2dh
5 REPLIES 5
Philipp D
Associate II
Posted on April 03, 2018 at 16:56

Batek.Miroslav

‌: It seems that you're an expert on this field. Maybe you could help me?

Miroslav BATEK
ST Employee
Posted on April 03, 2018 at 19:47

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.

0690X0000060AOMQA2.png

In your case onlu high interrupt needs to be enabled.

Posted on April 03, 2018 at 20:02

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?

Posted on April 04, 2018 at 14:38

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.

Posted on April 05, 2018 at 00:51

Thank you very much!