RTC Wakeup from sleep
Tagged: mDot, RTC wakeup
- This topic has 7 replies, 5 voices, and was last updated 7 years, 11 months ago by Sudhir Kshirsagar.
-
AuthorPosts
-
November 23, 2016 at 7:22 am #15616Andrew LindsayParticipant
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
November 23, 2016 at 8:15 am #15619Mike FioreBlockedAndrew,
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
November 23, 2016 at 8:38 am #15620Andrew LindsayParticipantThanks,
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
November 23, 2016 at 9:10 am #15625Mike FioreBlockedAndrew,
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
December 19, 2016 at 2:12 pm #16117Robert HalpennyParticipantHi Mike,
I would also like to say that this would be a very useful feature.
Thanks,
MorganDecember 21, 2016 at 7:34 pm #16129Sudhir KshirsagarParticipantMy 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.
December 22, 2016 at 5:23 am #16131Amin GholamzadehParticipantAlthough 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!
December 24, 2016 at 11:48 am #16137Sudhir KshirsagarParticipantThe 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.
-
AuthorPosts
- You must be logged in to reply to this topic.