Skip to main content
Visitor II
December 15, 2023
Question

LIS2DW12 latched mode

  • December 15, 2023
  • 1 reply
  • 3389 views

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.




 

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    December 15, 2023

    Hi @farshad ,

    Welcome to ST Community!

    When you reset your esp32, is the lis2dw12 always powered on?

    farshadAuthor
    Visitor II
    December 15, 2023

    Yes it has seperated 3.3 voltage source which is always on. I may need to send him to stationary or double tap mode after esp32 reboot( if the wake up reason was INT1 trigger from accelerometer)