2023-07-17 01:13 AM
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.
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:
But none of them have worked.
Thank you in advance.
2023-07-18 07:29 AM
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.
2023-07-21 01:10 AM
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
2023-07-25 03:11 AM
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.
2023-07-25 04:16 AM
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?