RTC Overflow during Stop Mode
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2009-04-15 10:31 PM
Posted on April 16, 2009 at 07:31
RTC Overflow during Stop Mode
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:09 AM
Posted on May 17, 2011 at 13:09
I seem to be having a problem with the following sequence:
Setup RTC Enter Stop Mode (RTC Overflows) Leave Stop Mode Call RTC_WaitForSynchro Read RTC_FLAG_OWF When I read the overflow flag (RTC_FLAG_OWF) it is cleared, rather than set. The manual does say (RTC: 8.4.2 note 3) that ''The OWF, ALRF, SECF and RSF bits are not updated when the APB1 clock is not running.'' However, shouldn't they be updated with the overflow flag set when RTC_WaitForSynchro is called? The flag is setting if the RTC rolls over whilst not in stop mode.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:09 AM
Posted on May 17, 2011 at 13:09
I think may be either a problem with my understanding of the manual, or the silicon.
Meanwhile I'm working-around with:Code:
void CheckRtcOverflow(void) { if ( (RTC->CRL & RTC_FLAG_OW) || (GetRtcCounter() < Rtc.LastCheckTime) ) { Rtc.OverflowCounter++; RTC->CRL &= ~RTC_FLAG_OW; } Rtc.LastCheckTime = GetRtcCounter(); }