LIS2HH12 Interrupt generation
Hello all,
I'm currently using the LIS2HH12 to sense the acceleration on the three axes. My aim is not to continuously read the acceleration value, but is to set a threshold for each axis and receive an interrupt when one of the thresholds is exceeded. The problem is that when I enable one of the three axes or all axes at the same time, by writing the appropriate values in the appropriate registers, an interrupt is generated even if no threshold is exceeded. This only happens when the interrupt on a particular axis is enabled for the first time, if I disable the interrupt and then re-enable it, no "false interrupt" is generated.
At initialization, i set the following registers values:
- CTRL1 : 0x37
- CTRL3 : 0x88
- CTRL4 : 0x34
- FIFO_CTRL : 0xE0
- IG_CFG1 : 0x2A
- IG_DUR1 : 0x01
All other writeable registers are set to 0.
If I want to enable the interrupt on one or more axes, I write the LIS2HH12_REG_IG_CFG1, LIS2HH12_REG_IG_THS_X1, LIS2HH12_REG_IG_THS_Y1, LIS2HH12_REG_IG_THS_Z1 accordingly.
For now, I found a code solution to mitigate the "fake interrupt" generation, but it would be better not to use this kind of solution, but to avoid the problem directly. Any suggestions?
