cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DE12 Interrupt on INT2 pad

Fahad Mirza
Associate II
Posted on November 17, 2017 at 22:11

I am unable to generate an interrupt on INT2 pin. But I can generate an interrupt with the same configuration on INT1 pin. Seems like I am missing something obvious or the datasheet is missing something crucial!!

I am trying to detect a 180-degree flip from Z-axis. On a flat surface, Z-axis pointing upwards gives me approx +1g (decimal 65 with FS = 2). 180 flip will give me a negative value. Here is the configuration that worked on INT1 pin.

  • CTRL_REG1 = 0x5F  // ODR = 100Hz, LPen = 1, All axis enabled
  • CTRL_REG2 = 0x42  // Reference filtering, Filter data for AOI function on interrupt 2

  • REFERENCE = 50     // Taking the z-axis value close to 15

  • CTRL_REG3 = 0x20  // IA2 interrupt on INT1

  • CTRL_REG5 = 0x08 // Latch for INT1

  • CTRL_REG6 = 0

  • INT2_THS = 100 // A 180-degree flip gives me around -112 with REFERENCE 50

  • INT2_DURATION = 50 // 500ms with ODR=100Hz

  • INT2_CFG = 0x20 // Interrupt enable for High on Z-axis

With above configuration, I can detect the interrupt on INT1 pin. For INT2 pin I changed,

  • CTRL_REG3 = 0

  • CTRL_REG5 = 0x02 // Latch for INT2

  • CTRL_REG6 = 0x20 // IA2 interrupt on INT2 pin

...and I don't receive any interrupt. I just redirected the pin. This should work. Unless I am missing something obvious. Any help will be much appreciated.

#accelerometer #mems #interrupt
2 REPLIES 2
Miroslav BATEK
ST Employee
Posted on November 20, 2017 at 11:02

You configuration is correct and it is working, but I see one small issue which probably makes the troubles.

In the first case when the interrupt is directed to INT1 pin, you set 

CTRL_REG5 = 0x08, this configuration set the Latch mode for the interrupt generator 1 not for the pin INT1. And because you are using interrupt generator 2 this settings is not used and the interrupt is not latched (returns back to 0 wen the boards is flipped back).

When you direct the interrupt to INT2 you set CTRL_REG5 = 0x02, this configuration set the Latch mode for interrupt generator 2. As you are using this interrupt generator, the INT2 pit remains high until you read INT2_SRC register.

I tried both case and the interrupt is triggered as you would expect but in second case I have to read the INT2_SRC register to clear the interrupt.

Posted on November 21, 2017 at 18:37

I see. That makes sense. Let me try your suggestion.