Datasheet
14.5 Functional description
The RTC is composed of a main 16-bit up-counter with a 16-bit modulo register, a clock
source selector, and a prescaler block with binary-based and decimal-based selectable
values. The module also contains software selectable interrupt logic and toggle logic for
pinout.
After any MCU reset, the counter is stopped and reset to 0x0000, the modulus register is
set to 0x0000, and the prescaler is off. The external oscillator clock is selected as the
default clock source. To start the prescaler, write any value other than zero to the
prescaler select bits (RTC_SC2[RTCPS]).
Three clock sources are software selectable: the external low-power oscillator (XOSC),
on-chip low power oscillator (LPO), and bus clock. The RTC clock select bits
(RTC_SC2[RTCLKS]) are used to select the desired clock source to the prescaler
dividers. If a different value is written to RTC_SC2[RTCLKS], the prescaler and
RTC_CNTH and RTC_CNTL counters are reset to 0x00.
RTC_SC2[RTCPS] and the RTC_SC2[RTCLKS] bit select the desired divide-by value.
If a different value is written to RTC_SC2[RTCPS], the prescaler and RTCCNT counters
are reset to 0x00. The following table shows different prescaler period values.
Table 14-8. Prescaler period
RTCPS 32768Hz XOSC clock
source prescaler
period (RTCLKS = 00)
LPO clock (1-kHz)
source prescaler
period (RTCLKS = 01)
Bus clock (8-MHz)
source prescaler
period (RTCLKS = 10)
Bus clock (8-MHz)
source prescaler
period (RTCLKS = 11)
0000 Off Off Off Off
0001 30.5176 µs 128 ms 125 ns 16 µs
0010 61.0351 µs 256 ms 250 ns 32 µs
0011 122.0703 µs 512 ms 500 ns 64 µs
0100 244.1406 µs 1024 ms 1 µs 128 µs
0101 488.28125 µs 2048 ms 2 µs 256 µs
0110 976.5625 µs 100 ms 4 µs 12.5 µs
0111 1.9531 ms 1 s 8 µs 125 µs
The RTC modulo register (RTC_MODH and RTC_MODL) allows the compare value to
be set to any value from 0x0000 to 0xFFFF. When the counter is active, the counter
increments at the selected rate until the count matches the modulo value. When these
values match, the counter resets to 0x0000 and continues counting. The real-time
interrupt flag (RTC_SC1[RTIF]) is set whenever a match occurs. The flag sets on the
Functional description
MC9S08PA60 Reference Manual, Rev. 1, 9/2012
400 Freescale Semiconductor, Inc.
