2017-12-20 08:00 AM
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_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 2CTRL_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.25mgINT1_DURATION
= 0x00 // Duration = 0LSBs (1/1Hz) = 0s.//0x78 --> 120sINT2_CFG = 0x95
//
AND logic. Enable XLIE, YLIE and ZLIE interrupt generation.
INT2_THS
= 0x08 // Threshold (THS) = 8LSBs 15.625mg/LSB = 125mgINT2_DURATION
= 0x0A // Duration = 10LSBs (1/1Hz) = 10sDoes anybody know how to configure INT2 correctly to make it work?
Thanks!#int2 #interrupt #lis3dh2017-12-21 12:26 AM
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 22)
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.