2025-05-06 5:23 AM
Hi,
I'm working with the LIS2DW12 accelerometer in a low-power IoT application. The sensor is configured to wake the MCU via an interrupt on INT1, connected through a monostable multivibrator (Schmit trigger IC). The setup is designed so that a rising edge on INT1 triggers a reset of the MCU.
Here’s the issue:
When the MCU wakes from a previous interrupt (caused by actual motion), it starts reinitializing the LIS2DW12 — performing a soft reset and reconfiguring the registers into polling (standard) mode. Then, after some time in polling mode, if no motion is detected, the program switches the LIS2DW12 back into interrupt mode.
At this point, the INT1 pin briefly goes high, creating a glitch pulse even though the system is stationary. This unexpected edge triggers the monostable multivibrator, which in turn resets the MCU — essentially creating a loop. This behavior is not acceptable for my use case.
Delaying the CTRL4 write until after all other registers are configured (CTRL1, CTRL3, WAKE_UP_THS, WAKE_UP_DUR, CTRL7).
Reading ALL_INT_SRC before and/or after the configuration.
Adding delays between configuration steps.
Prevent the INT1 pin from going high at all when reinitializing the sensor into interrupt mode — unless actual motion is detected.
I attached my example script to the message.
Thanks in advance!
Solved! Go to Solution.
2025-05-06 6:10 AM
I solved the issue by avoiding full sensor re-initialization. Instead of rewriting all registers, I now simply use CTRL7 to enable or disable interrupts when needed. This prevents any unwanted glitches on the INT1 pin, and everything works reliably now.
2025-05-06 6:10 AM
I solved the issue by avoiding full sensor re-initialization. Instead of rewriting all registers, I now simply use CTRL7 to enable or disable interrupts when needed. This prevents any unwanted glitches on the INT1 pin, and everything works reliably now.