RTC Wakeup from sleep

Home Forums mDot/xDot RTC Wakeup from sleep

Tagged: ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #15616
    Andrew Lindsay
    Participant

    Hi,

    I’ve been using the following code to detect when the mDot was woken up from the RTC rather than the INTERRUPT when using deep sleep RTC_ALARM_OR_INTERRUPT:

    if( RTC->ISR & RTC_ISR_ALRAF ) {
    timedWakeup = true;
    pc.printf(“Woken by Timer\n\r”);
    }

    However when using the sleep mode on the mDot, the RTC_ISR_ALRAF bit does not appear to be getting set, or if it is then it is cleared before my code can detect it. I cant see any change in the RTC_ISR_WUTF bit either when using the wakeup pin.

    As a result I’m currently not able to identify the source of my interrupt.

    Any ideas?

    thanks

    Andrew

    #15619
    Mike Fiore
    Blocked

    Andrew,

    We are disabling RTC Alarm A, our time based wakeup source, and clearing its interrupt flags as part of the wakeup process. I don’t think you’d see the RTC_ISR_WUTF bit getting set because we’re not using it in the sleep/wakeup process. I believe we did in very old versions of the library, but recently we’ve been using RTC Alarm A.

    This is a feature I’d like to officially add support for in the library. I’ll see if I can get something into the dev library versions in the near future.

    Cheers,

    Mike

    #15620
    Andrew Lindsay
    Participant

    Thanks,

    Are you saying there is currently, when using sleep, no way to determine if it was the RTC or wakeup pin that caused the mDot to come out of sleep mode.

    Andrew

    #15625
    Mike Fiore
    Blocked

    Andrew,

    Correct. We don’t currently support this feature in the library, but like I said, I’d like to get it added. I’m hoping that will be sooner than later.

    Cheers,

    Mike

    #16117
    Robert Halpenny
    Participant

    Hi Mike,

    I would also like to say that this would be a very useful feature.

    Thanks,
    Morgan

    #16129
    Sudhir Kshirsagar
    Participant

    My vote for it also. We went to mBed 5 to get that support but then found out that the I2C in that doesn’t work too well. So we are now looking to do mBed 2 with the wake support for RTC detection.

    #16131
    Amin Gholamzadeh
    Participant

    Although it would be really handy to have this feature, you can set majority of devices to hold the interrupt pin high until it’s cleared. By doing so, upon waking up, check if the interrupt pin is high and if it is then you’d know the source of your wake up!

    My question is though, getStandbyFlag() doesn’t detect wake ups from stop mode so it’d be nice to have this feature added to the library too since mDot deepsleep mode is disabled anyway; But until you do, is there a quick way of detecting this?

    Thanks!

    #16137
    Sudhir Kshirsagar
    Participant

    The mDot is the only powered component in our device and there is no external resource to hold the interrupt pin high. If the mDot has gone to sleep, then the pin is obviously not held high. So your comment doesn’t apply to our situation.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.