Clock, Reset, and Power Control (CRP)
MPC5510 Microcontroller Family Reference Manual, Rev. 1
5-30
Freescale Semiconductor
Preliminary
to run mode, then the RTCF flag will be set. The RTC wakeup signal is captured in the
CRP_PSCR[WKRTCF] flag bit.
A rollover wakeup and/or interrupt can be generated when the RTC transitions from a count of
0xFFFF_FFFF to 0x0000_0000. The rollover flag is enabled by setting the CRP_RTCSC[ROVREN] bit.
An RTC counter rollover with this bit and the CRP_WKSE[RTCOVREN] bit set will cause a wakeup from
both sleep and stop modes. The rollover wakeup flag is captured in the CRP_PSCR[WKRLLOVRF] bit.
An interrupt request is generated for an RTC counter rollover when both the CRP_RTCSC[ROVREN] and
CRP_RTCSC[RTCIE] bits are set.
Setting APIEN enables the autonomous interrupt function. The 10 bit APIVAL selects the time interval for
triggering an interrupt and/or wakeup event. Since the RTC is a free-running counter, the APIVAL is added
to the current count to calculate an offset. When the counter reaches the offset count, a interrupt and/or
wakeup request is generated. Then the offset value is recalculated and again retriggers a new request when
the new value is reached. APIVAL may only be updated when APIEN is disabled. When a compare is
reached, the APIF interrupt flag is set (after proper clock synchronization). If the APIIE interrupt enable
bit is set, then the API interrupt request is generated. The APIF flag can be cleared by writing a 1 to APIF.
If there is a match while in sleep or stop mode, and the CRP_WKSE[APIWKEN] bit is set, then the API
will first generate a wakeup request to force a wakeup to RUN mode, then the APIF flag will be set. The
API wakeup flag is captured in the CRP_PSCR[WKAPIF] bit.
The RTC counter is unaffected during debug mode.