2017-05-24 01:07 PM
With the configuration below I'm attempting to receive and interrupt from INT1 when there is acceleration along the Z axis. However INT1 alwyas stays high...Not sure whats going on
//ctrl_reg1 LIS3DH_WriteReg(LIS3DH_CTRL_REG1, 0x24); //ctrl 2 LIS3DH_WriteReg(LIS3DH_CTRL_REG2, 0x01); //ctrl_reg3 LIS3DH_WriteReg(LIS3DH_CTRL_REG3, 0x40);//set Full scale
//ctrl_reg4 LIS3DH_WriteReg(LIS3DH_CTRL_REG4, 0x88); //ctrl_reg5 LIS3DH_WriteReg(LIS3DH_CTRL_REG5, 0x00); //int_tsh LIS3DH_WriteReg(LIS3DH_INT1_THS, 0x7F); //dur LIS3DH_WriteReg(LIS3DH_INT1_DURATION, 0x32);//Zhi interrupt
LIS3DH_WriteReg(LIS3DH_INT1_CFG, 0xA0);#lis3dh-interrupt #lis3dh2017-05-25 03:08 AM
I think the problem is in the interrupt threshold, duration and ODR settings combination.
LIS3DH_WriteReg(LIS3DH_CTRL_REG1, 0x24); ... ODR = 10 Hz
LIS3DH_WriteReg(LIS3DH_INT1_THS, 0x7F); ... Threshold = 2032mg
LIS3DH_WriteReg(LIS3DH_INT1_DURATION, 0x32); ... Duration = 50 * 0.1s = 5s
To trigger the interrupt you would have to expose the sensor to 2g (above 1g of gravity) for 5 seconds, which I think is very difficult.
I don't know what exactly you want to detect, but I would suggest to modify the settings, I mean decrease threshold and duration and/or increase ODR.
2018-03-04 11:44 PM
I am running into a similar problem. I have read through some of your posts and configured the registers exactly the same way, but it seems to always be triggering. This is what I do with the configuration :writeRegister8(ACC_INT1_CFG,0x2A);, I am polling the INT1_SRC register waiting for the movement/Interrupt Active interrupt, but the first time I poll it, the Interrupt Active bit is set and it shows that a low event for X Y and Z havs occured (so the register reads 0x55). I am also looking at the INT1 pin and it is always staying high. Should those 'low event' bits be set in the INT1_SRC register if they are NOT enabled in the INT1_CFG register?
2018-03-06 01:06 AM
The bits in INT1_SRC are set even if they are not enable in INT1_CFG, but only enabled condition have impact on the interrupt.
If you provide me your complete configuration I can check it.
2018-03-06 01:14 AM
Thanks for your reply. I think I understand how it works. Those bits will be set if those conditions happen, but the actual interrupt will only fire if the enabled conditions are met. Thanks!!