2024-10-09 06:16 AM
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:
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?
2024-10-09 07:26 AM
2024-10-09 08:28 AM
Hi @Federica Bossi ,
Thank you for your reply. I have read the application note but I haven't found a solution to the problem.
In particular, the AN explicitly states that "The interrupt signal is generated whenever the selected interrupt conditions are verified; the IG_SRC1(2) register has to be read to understand which condition happened." .
But in my case the interrupt is generated the first time the interrupt is enabled by writing to the appropriate registers, even if the accelerometer is stationary. After that all works as expected.