cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DH12 reads 0 values and stops generating interruptions

LJimé.1
Associate II

Hello all,

We are facing some issue with the LIS2DH12 accelerometer. When the board is powered-up, the accelerometer is booted with the configuration shown below, and in some of the boards, the accelerometer suddenly starts to read 0 in the OUT registers (all axes) and stops sending the interruption when the accelerometer is shaken, it can pass few hours or few days until it occurs. In this situation the device answers without problems to I2C commands, and the config registers remain in the same value. When we say it is not generating interruptions it means that the INT1 nor the INT1_SRC are changing when the accelerometer is shaken.

  • CTRL_REG1 = 0x5F (ODR 100Hz; X,Y,Z enabled and LP enabled)
  • CTRL_REG2 = 0x00 (HPM Mode Normal)
  • CTRL_REG3 = 0x40 (IA1 interrupt on INT1 pin)
  • CTRL_REG4 = 0x90 (BDU enabled and 4g scale)
  • CTRL_REG5 = 0x08 (Latch interrupt request on INT1_SRC)
  • INT1_THS = 0x3E (2000mg)
  • INT1_DURATION = 0x01 (1/100Hz=0,01s)
  • INT1_CFG = 0x2A (Interrupt enabled in X,Y and Z axes)

After an interruption occurs, the INT1_SRC register is always read, two times.

The only way to end this behavior is to power-down the board. However, we don't have this posibility in our device. Is there a way to reset the LIS2DH12 by software? We have tried with:

  • BOOT bit of the CTRL_REG5
  • Power-down mode setting the ODR bits of the CTRL_REG1 to 0000
  • Reading the REFERENCE register

But none of them have worked.

Thank you in advance.

4 REPLIES 4
Federica Bossi
ST Employee

Hi @LJimé.1 ,

After power on and setting all the registers, I suggest you to discard the first 10 samples and read the source interrupt, in this way you are sure to clean the block chain of the device.

Let me know if this helps.

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.
LJimé.1
Associate II

Hi Federica,

Thank you for your answer. After power on, the LIS2DH12 works correctly and we can get right values from it for days. However in a moment (I have not found out the reason yet), it starts to give always 0x0000 in the OUT_X, OUT_Y, and OUT-Z (sometimes 0x0080) independently of the orientation or movement of the device.

We want to know how to leave from this situation without a cold reset (power off followed by a power on) because we have no control of the power source of the LIS2DH12 from our microcontroller. Is there a way to do a SW/warm reset? Or we can write into an I2C register to reset the accelerometer?

Thank you again

Federica Bossi
ST Employee

Hi @LJimé.1 ,

This behaviour is unexpected, it could be something related to the firmware but not a sensor's issue.

You can try to enable the BDU bit in CTRL_REG4 (23h).

If this helps you, please mark my answer as "Best Answer" by clicking on the "Accept as Solution" button, this can be helpful for Community users to find this solution faster.

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.
LJimé.1
Associate II

Hi @Federica Bossi,

Thank you for the answer.

When you say firmware issue, do you mean, the firmware embedded in the sensor chip, right?

I've tried to enable and disable BDU bit in CTRL_REG4 (23h) but the issue hasn't been fixed.

Is there any way to do a SW reset of the LIS2DH12?