AnsweredAssumed Answered

LIS2DH12 accelerometer values suddenly close to zero (-4, 0, 4)

Question asked by vel on Nov 14, 2017
Latest reply on Mar 29, 2018 by Miroslav B

Dear all

 

We are using LIS2DH12 accelerometer in our product. We are juat about to launch the production and sales when we faces a weird problem.


Suddenly the accelerometer starts reporting values like 0, 4 and -4, instead of normal values somewhere around 1000 and 0 when not moving the device.

In error situation the values don't change even when rotating or shaking the device.

Register writes and reads are successful and WHO_AM_I (0x0f) register value matches to 0x33 so there's no address conflict.

 

I tried to fix the problem by resetting the registers to initial values. This didn't fix the problem. Also I tried to assert the BOOT bit of CTRL_REG5, which didn't help either. (I'm not quite sure what that is supposed to do)

 

Powering down the accelerometer is the only thing that helps. Too bad we don't have that possibility in our device. Removing the battery is the only possibility, which can be done only with opening the device using screwdriver.

 

The error is quite rare and we don't know the root cause.

 

Could anyone help? This is getting quite urgent.

 

My init sequence is:

// Try the BOOT bit with no help.
Write LIS2DH_CTRL_REG5, _CTRL_REG5_BOOT
delay 5 ms to wait the boot to complete.

//Restore default values:
Write LIS2DH_CTRL_REG0, 0x10
Write LIS2DH_TEMP_CFG_REG, 0x00
Write LIS2DH_CTRL_REG1, 0x07
Write LIS2DH_CTRL_REG2, 0x00
Write LIS2DH_CTRL_REG3, 0x00
Write LIS2DH_CTRL_REG4, 0x00
Write LIS2DH_CTRL_REG5, 0x00
Write LIS2DH_CTRL_REG6, 0x00
Write LIS2DH_REFERENCE, 0x00
Write LIS2DH_FIFO_CTRL_REG, 0x00
Write LIS2DH_INT1_CFG, 0x00
Write LIS2DH_INT1_THS, 0x00
Write LIS2DH_INT1_DURATION, 0x00
Write LIS2DH_INT2_CFG, 0x00
Write LIS2DH_INT2_THS, 0x00
Write LIS2DH_INT2_DURATION, 0x00
Write LIS2DH_CLICK_CFG, 0x00
Write LIS2DH_CLICK_THS, 0x00
Write LIS2DH_TIME_LIMIT, 0x00
Write LIS2DH_TIME_LATENCY, 0x00
Write LIS2DH_TIME_WINDOW, 0x00
Write LIS2DH_Act_THS, 0x00
Write LIS2DH_Act_DUR, 0x00

//Set 100Hz normal mode
Write 0x20, 0x57
Write 0x23, 0x80

//Enable FIFO (Streaming)
Write LIS2DH_CTRL_REG5, _CTRL_REG5_FIFO_EN
Write LIS2DH_FIFO_CTRL_REG, 0x80

//Init Interrupts:
Write LIS2DH_CTRL_REG3, _CTRL_REG3_I1_CLICK | _CTRL_REG3_I1_AOI1
Write LIS2DH_CTRL_REG6, _CTRL_REG6_H_LACTIVE
Write LIS2DH_INT1_CFG, _INT1_CFG_AOI | _INT1_CFG_XHIE_XUPE | _INT1_CFG_YHIE_YUPE | _INT1_CFG_ZHIE_ZUPE
Write LIS2DH_INT1_THS, 1
Write LIS2DH_INT1_DURATION, 1
Write LIS2DH_CLICK_CFG, _CLICK_CFG_ZS | _CLICK_CFG_YS | _CLICK_CFG_XS
Write LIS2DH_CLICK_SRC, _CLICK_SRC_SClick
Write LIS2DH_CLICK_THS, 3

 

In the following there is a sample of erroneous FIFO stream.
<xyz: 4,-4,0>
<xyz: 4,0,4>
<xyz: 0,0,0>
<xyz: 0,0,0>
<xyz: 0,0,0>
<xyz: 0,0,0>
<xyz: 0,4,4>
<xyz: 0,0,0>
<xyz: 0,0,0>
<xyz: 0,4,4>
<xyz: 4,0,0>

 

Reading values directly from out registers starting from 0x28 return similar values (-4, 0, 4, sometimes 8)

Outcomes