2009-04-15 10:31 PM
RTC Overflow during Stop Mode
2011-05-17 04:09 AM
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.2011-05-17 04:09 AM
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(); }