Skip to main content
Visitor II
August 3, 2021
Solved

LIS2DH12: Calculating return-to-sleep time using register ACT_DUR (3Fh)?

  • August 3, 2021
  • 1 reply
  • 1422 views

Hello,

I’m probably missing something obvious but I don't understand how the return-to-sleep duration can be calculated using the equation in Section 8.34 of the datasheet.

0693W00000D1OrmQAF.jpgI’m also confused regarding how the ACT_DUR time is used for sleep-to-wake. AN5005 Section 10 shows no delay, except waiting for the next ODR period, for wake up to occur.

What effect does the ACT_DUR register setting have on sleep-to-wake? Does Section 10 show a duration of zero and if a duration is set in ACT_DUR then the activity must exceed the threshold for the entire duration that is set?

Thank you!

Regards,

John M.

    This topic has been closed for replies.
    Best answer by TBomb.1

    Hi John, my interpretation is that the LSb in the right hand side is the standard time LSB, i.e. 1/ODR, while the LSb in the left hand side of the equation is the actual ACT_DUR LSB. For example, if the ODR is 10Hz, the LSB would be = (8*1/10+1)/10 = 180 ms (instead of 100ms if it was 1/ODR). Can you check this in your setup?

    The effect is described in the application note: The Activity/Inactivity recognition function is enabled by writing a wake-up threshold value different from zero in register ACT_THS. The return-to-sleep time is also customizable, acting on register ACT_DUR.

    https://www.st.com/resource/en/application_note/dm00365457-lis2dh12-mems-digital-output-motion-sensor-ultralowpower-highperformance-3axis-nano-accelerometer-stmicroelectronics.pdf

    0693W00000D1XSgQAN.png 

    Tom

    1 reply

    TBomb.1Answer
    Visitor II
    August 4, 2021

    Hi John, my interpretation is that the LSb in the right hand side is the standard time LSB, i.e. 1/ODR, while the LSb in the left hand side of the equation is the actual ACT_DUR LSB. For example, if the ODR is 10Hz, the LSB would be = (8*1/10+1)/10 = 180 ms (instead of 100ms if it was 1/ODR). Can you check this in your setup?

    The effect is described in the application note: The Activity/Inactivity recognition function is enabled by writing a wake-up threshold value different from zero in register ACT_THS. The return-to-sleep time is also customizable, acting on register ACT_DUR.

    https://www.st.com/resource/en/application_note/dm00365457-lis2dh12-mems-digital-output-motion-sensor-ultralowpower-highperformance-3axis-nano-accelerometer-stmicroelectronics.pdf

    0693W00000D1XSgQAN.png 

    Tom

    JohnMAuthor
    Visitor II
    August 4, 2021

    Thank you Tom! We’re in the process of coding for the prototypes so it will be a week or so before testing that can begin. But we’ll go with your interpretation as it makes sense.

    Thanks for the link. My question regarding ACT_DUR came about after reading AN5005. :)

    It was clear to me how the timing worked when returning to sleep but I wasn’t sure if the same duration of activity (above the threshold) was needed for sleep-to-wake. Figure 33 in AN5005 shows instant wake-up (waiting only for next ODR). If ACT_DUR was used for both return-to-sleep and sleep-to-wake, then we’ll have to do a bit of extra coding as we would like instant sleep-to-wake but delayed return-to-sleep. We’ll have to adjust ACT_DUR as needed.

    Thank you again!