2023-04-24 03:47 AM
when I'm NOT enabling routing the Sleep state/change (setting CTRL5_INT2_PAD_CTRL to 0x00) I'm getting I regular good behavior of the SLEEP_STATE_IA bit (1 and 0 according to the wu cfg) HOWEVER, when I set CTRL5_INT2_PAD_CTRL to 0xC0 or 0x40, the bit: SLEEP_STATE_IA stay constantly on 1,
Can you please help me?
thanks!
2023-04-24 07:59 AM
Hi @SHala.2 ,
The following routine describes how to route the sleep change event on the INT2 pin:
1. Write 50h in CTRL1 // Turn on the accelerometer // ODR = 200 Hz, FS = ±2 g
2. Write 02h in WAKE_UP_DUR // Set duration for inactivity detection
3. Write 42h in WAKE_UP_THS // Set activity/inactivity threshold // Enable activity/inactivity detection
4. Write 40h in CTRL5_INT2_PAD_CTRL // Sleep change interrupt driven to INT2 pin
5. Write 20h in CTRL7 // Enable interrupts
In case you want to route INT2 pin on INT1 you need to follow the same steps but writing 60h in CTRL7.
Note that the bit SLEEP_STATE_IA is 1 when a sleep event is detected:
If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster!
2023-05-08 02:35 AM
Hey Fredrica,
thank you for your answer,
When I set the configuration you suggested,
It ONLY work when I set this configuration, then, turn the device on(by connection to power cable) and then changing the configuration where the value of CTRL5_INT2_PAD_CTRL is 0x00 and then turn on again.
do you have Idea why is this happening?
Thanks!