cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DW12 latched mode

farshad
Associate II

Hi Experts,

I am using lis2dw12 accelerometer connected to esp32s3 and recently have got a situation which is blocking for esp32s3 to read status registers of accelerometer when LIR =1 (latched mode). I put accelerometer on stationary  mode and routing the intruppt to INT1 which resets my esp32. Interrupt is working fine but when I want to read tap_source or wakeup_source or in general ALL_INT_SRC ( not pulling them. only one time) to detect the reset reason on my esp32 side, It will be hanged sometimes until esp32 watchdog happens and from that point the status register are readable since i2c is reinitiated I guess. Whould you mind please help me to underestand why acccelerometer get frozen?

Here is my configurations:

write2i2c(acc_addr, LIS2DW12_CTRL1, 0x10, 1)
write2i2c(acc_addr, LIS2DW12_WAKE_UP_DUR, 0x30, 1)
write2i2c(acc_addr, LIS2DW12_WAKE_UP_THS, 0x42, 1)
write2i2c(acc_addr, LIS2DW12_CTRL4_INT1_PAD_CTRL, 0x20, 1)
write2i2c(acc_addr, LIS2DW12_CTRL_REG7, 0x20, 1)
write2i2c(acc_addr, LIS2DW12_CTRL3, 0x10, 1)

 

and after reboot which takes only 10ms I try to read:

readfromi2c(LIS2DW12_I2C_ADDRESS, 0x27)
readfromi2c(LIS2DW12_I2C_ADDRESS, 0x39)
readfromi2c(LIS2DW12_I2C_ADDRESS, 0x3b)

then If it does not crash I will put accelerometer again in stationary mode again. but sometimes it get stucked in reading process above. it is worth mentioning that it only happend when Iam in latched mode.




 

10 REPLIES 10

++++++ I clean forgot to mention that if two consecutive interrupt happens ( two movements) after each configuration while accelerometer is in stationary + latched, then accelerometer gets hanged again for next read or write.