cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3DH INT2

Laura Homet
Associate
Posted on December 20, 2017 at 17:00

Hello!

I am trying to detect a collision and generate an interrupt on INT1, and also to detect motion and generate an interrupt on INT2. INT1 is working normally, but INT2 does not work. It seems I am missing something...

These are the values I put at registers:

  • CTRL_REG0 = 0x90  // Pull-up disconnected to SDO/SA0 pin
  • CTRL_REG1 = 0x27 // HR / Normal / Low-power mode (10 Hz), Z-axis enabled, Y-axis enabled, X-axis enabled

  • CTRL_REG2

     = 0x01 // High-pass filter enabled for AOI function on interrupt 2
  • CTRL_REG3 = 0x40  // IA1 interrupt on INT1 enabled

  • CTRL_REG4 = 0x88 // Output registers not updated until MSB and LSB reading, high-resolution enabled

  • CTRL_REG5 = 0x00 // Normal mode, FIFO disabled, interrupt request not latched

  • CTRL_REG6 = 0x28 // Interrupt 2 function on INT2 pin enabled, activity interrupt enabled

  • INT1_CFG = 0x95 //

    AND logic. Enable XLIE, YLIE and ZLIE interrupt generation.
  • INT1_THS

    = 0x32 // Threshold (THS) = 50LSBs  15.625mg/LSB = 781.25mg
  • INT1_DURATION

    = 0x00 // Duration = 0LSBs  (1/1Hz) = 0s.//0x78 --> 120s
  • INT2_CFG = 0x95

    //

    AND logic. E

    nable XLIE, YLIE and ZLIE interrupt generation.

  • INT2_THS

    = 0x08 // Threshold (THS) = 8LSBs  15.625mg/LSB = 125mg
  • INT2_DURATION

    = 0x0A // Duration = 10LSBs  (1/1Hz) = 10s

Does anybody know how to configure INT2 correctly to make it work?

Thanks!

#int2 #interrupt #lis3dh
1 REPLY 1
Miroslav BATEK
ST Employee
Posted on December 21, 2017 at 09:26

Can you please define the conditions for collision detection and motion detection?

Your interrupt generation configuration seems to me little bit strange.

1) Following settings

CTRL_REG2

 = 0x01 enables high pass filter for interrupt generator 1 not 2 

2) 

INT1_CFG = 0x95, you want to generate interrupt if the value in all axis is bellow threshold, as the high pass filter is enabled on this interrupt generator, the condition is true in still state and the interrupt is triggered

3) INT2_CFG = 0x95, 

you want to generate interrupt if the value in all axis is bellow threshold 0.125mg for 10s which will be very difficult to generate, it would be quite long free fall :-), the high pass filter for interrupt generator 2 is not enabled 

I guess, you will get expected behavior if you change 

CTRL_REG2

 settings to 0x02.