cancel
Showing results for 
Search instead for 
Did you mean: 

Waiting time for reading LIS2DH12 axis after configuring due to low temperatures

P M
Associate III

Hi,

I am developing an application using the accelerometer LIS2DH12 and a STM32L451. It works perfect but I get some kind of issues when temperature is low. I used a thermal chamber to perform this test and it seems very repetible.

If the accelerometer is set in low power mode and disabled at the beginning, what I do is:

1) Initialize I2C HAL interface.
1) Configure the accelerometer. (ODR 10, PW normal, FS 2G)
2) Enable X, Y, Z axis
3) Wait for 100 ms
4) Read XYZ flag (Register 0x27) until it says values are updated. 100ms between retries.
5) Set BDU to 1 in register CTRL 4.
6) Read 6 registers XL, XH, YL, YH, ZL, ZH. I haven't been able to read 6 at once. It always fails or returns 0 for all the axis.
7) Set BDU to 0 in register CTRL 4.
8) Wait for 1 second, and go to number 1.

In case the temperature is over 7ºC, I always get good results. Once the temperature drops 7ºC, I always get value for X axis and 0 for Y and Z axis. The pcb is not moving at all.

After the temperature stops decreasing at -20ºC, starts increasing again after 1 hour. I start getting right values when the temperature reaches 7ºC.

What I have seen using a signal analyzer is that the XYZ flag in register 0x27 says the values are updated but in fact the only updated value is X. MCU usually gets this value at first read.


According to datasheet (https://www.st.com/resource/en/datasheet/lis2dh12.pdf), table 11 in page 17 I see the turn-on time is 1/ODR.

After repeating the thermal chamber test with the same procedure but increasing step 3 from 100 ms to 200 ms, all values are good. There are not any error in values.

Do you have any idea why this happens? Is 100ms delay too short for working on low temperatures? What should be the value?

Thank you in advance

0 REPLIES 0