cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2HH12 Interrupt generation

GiorgioR
Associate

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?

2 REPLIES 2
Federica Bossi
ST Employee

Hi @GiorgioR ,

Have you already looked at Section 6.3 of AN4662?

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
GiorgioR
Associate

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.