Freescale Semiconductor DEMO9S08DZ60 Demo Board DEMO9S08DZ60 DEMO9S08DZ60 Hoja De Datos

Los códigos de productos
DEMO9S08DZ60
Descargar
Página de 416
Chapter 15 Real-Time Counter (S08RTCV1)
MC9S08DZ60 Series Data Sheet, Rev. 4
Freescale Semiconductor
315
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.
shows different prescaler period values.
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.
15.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.
Table 15-6. Prescaler Period
RTCPS
1-kHz Internal Clock
(RTCLKS = 00)
1-MHz External Clock
(RTCLKS = 01)
32-kHz Internal Clock
(RTCLKS = 10)
32-kHz Internal Clock
(RTCLKS = 11)
0000
Off
Off
Off
Off
0001
8 ms
1.024 ms
250
μ
s
32 ms
0010
32 ms
2.048 ms
1 ms
64 ms
0011
64 ms
4.096 ms
2 ms
128 ms
0100
128 ms
8.192 ms
4 ms
256 ms
0101
256 ms
16.4 ms
8 ms
512 ms
0110
512 ms
32.8 ms
16 ms
1.024 s
0111
1.024 s
65.5 ms
32 ms
2.048 s
1000
1 ms
1 ms
31.25
μ
s
31.25 ms
1001
2 ms
2 ms
62.5
μ
s
62.5 ms
1010
4 ms
5 ms
125
μ
s
156.25 ms
1011
10 ms
10 ms
312.5
μ
s
312.5 ms
1100
16 ms
20 ms
0.5 ms
0.625 s
1101
0.1 s
50 ms
3.125 ms
1.5625 s
1110
0.5 s
0.1 s
15.625 ms
3.125 s
1111
1 s
0.2 s
31.25 ms
6.25 s