English
Language : 

MC9S08JM16 Datasheet, PDF (215/386 Pages) Freescale Semiconductor, Inc – Microcontrollers
Real-Time Counter (S08RTCV1)
RTCPS and the RTCLKS[0] bit select the desired divide-by value. If a different value is written to RTCPS,
the prescaler and RTCCNT counters are reset to 0x00. Table 13-6 shows different prescaler period values.
Table 13-6. Prescaler Period
RTCPS
1 kHz Internal Clock 1 MHz External Clock 32 kHz Internal Clock 32 kHz Internal Clock
(RTCLKS = 00)
(RTCLKS = 01)
(RTCLKS = 10)
(RTCLKS = 11)
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
Off
8 ms
32 ms
64 ms
128 ms
256 ms
512 ms
1.024 s
1 ms
2 ms
4 ms
10 ms
16 ms
0.1 s
0.5 s
1s
Off
1.024 ms
2.048 ms
4.096 ms
8.192 ms
16.4 ms
32.8 ms
65.5 ms
1 ms
2 ms
5 ms
10 ms
20 ms
50 ms
0.1 s
0.2 s
Off
250 μs
1 ms
2 ms
4 ms
8 ms
16 ms
32 ms
31.25 μs
62.5 μs
125 μs
312.5 μs
0.5 ms
3.125 ms
15.625 ms
31.25 ms
Off
32 ms
64 ms
128 ms
256 ms
512 ms
1.024 s
2.048 s
31.25 ms
62.5 ms
156.25 ms
312.5 ms
0.625 s
1.5625 s
3.125 s
6.25 s
The RTC modulo register (RTCMOD) allows the compare value to be set to any value from 0x00 to 0xFF.
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 0x00 and continues counting. The real-time interrupt
flag (RTIF) is set when a match occurs. The flag sets on the transition from the modulo value to 0x00.
Writing to RTCMOD resets the prescaler and the RTCCNT counters to 0x00.
The RTC allows for an interrupt to be generated when RTIF is set. To enable the real-time interrupt, set
the real-time interrupt enable bit (RTIE) in RTCSC. RTIF is cleared by writing a 1 to RTIF.
13.4.1 RTC Operation Example
This section shows an example of the RTC operation as the counter reaches a matching value from the
modulo register.
MC9S08JM16 Series Data Sheet, Rev. 2
Freescale Semiconductor
215