![NXP Semiconductors MC9S08PA4 Скачать руководство пользователя страница 265](http://html1.mh-extra.com/html/nxp-semiconductors/mc9s08pa4/mc9s08pa4_reference-manual_1721838265.webp)
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 0 to the Prescaler
Select field (RTC_SC2[RTCPS]).
The clock sources are software selectable: the external oscillator (XOSC), on-chip low
power oscillator (LPO), and bus clock. The RTC Clock Select field
(RTC_SC2[RTCLKS]) is used to select the desired clock source to the prescaler dividers.
If a different value is written to RTC_SC2[RTCLKS], the prescaler and CNTH and
RTC_CNTL counters are reset to 0x00.
RTC_SC2[RTCPS] and RTC_SC2[RTCLKS] 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 13-1. 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)
000
Off
Off
Off
Off
001
30.5176 µs
128 ms
125 ns
16 µs
010
61.0351 µs
256 ms
250 ns
32 µs
011
122.0703 µs
512 ms
500 ns
64 µs
100
244.1406 µs
1024 ms
1 µs
128 µs
101
488.28125 µs
2048 ms
2 µs
256 µs
110
976.5625 µs
100 ms
4 µs
12.5 µs
111
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
transition from the modulo value to 0x0000. The modulo value written to RTC_MODH
and RTC_MODL is latched until the RTC counter overflows or RTC_SC2[RTCPS] is
selected nonzero.
The RTC allows for an interrupt to be generated whenever RTC_SC1[RTIF] is set. To
enable the real-time interrupt, set the Real-Time Interrupt Enable field
(RTC_SC1[RTIE]). RTC_SC1[RTIF] is cleared by writing a 1 to RTC_SC1[RTIF].
Chapter 13 Real-time counter (RTC)
MC9S08PA4 Reference Manual, Rev. 5, 08/2017
NXP Semiconductors
265
Содержание MC9S08PA4
Страница 1: ...MC9S08PA4 Reference Manual Supports MC9S08PA4 Document Number MC9S08PA4RM Rev 5 08 2017 ...
Страница 2: ...MC9S08PA4 Reference Manual Rev 5 08 2017 2 NXP Semiconductors ...
Страница 22: ...MC9S08PA4 Reference Manual Rev 5 08 2017 22 NXP Semiconductors ...
Страница 28: ...System clock distribution MC9S08PA4 Reference Manual Rev 5 08 2017 28 NXP Semiconductors ...
Страница 150: ...Port data registers MC9S08PA4 Reference Manual Rev 5 08 2017 150 NXP Semiconductors ...
Страница 196: ...Human machine interfaces HMI MC9S08PA4 Reference Manual Rev 5 08 2017 196 NXP Semiconductors ...
Страница 224: ...Instruction Set Summary MC9S08PA4 Reference Manual Rev 5 08 2017 224 NXP Semiconductors ...
Страница 232: ...Functional Description MC9S08PA4 Reference Manual Rev 5 08 2017 232 NXP Semiconductors ...
Страница 258: ...FTM Interrupts MC9S08PA4 Reference Manual Rev 5 08 2017 258 NXP Semiconductors ...
Страница 268: ...Initialization application information MC9S08PA4 Reference Manual Rev 5 08 2017 268 NXP Semiconductors ...
Страница 294: ...Functional description MC9S08PA4 Reference Manual Rev 5 08 2017 294 NXP Semiconductors ...
Страница 370: ...Memory map and register description MC9S08PA4 Reference Manual Rev 5 08 2017 370 NXP Semiconductors ...
Страница 398: ...Resets MC9S08PA4 Reference Manual Rev 5 08 2017 398 NXP Semiconductors ...
Страница 400: ...MC9S08PA4 Reference Manual Rev 5 08 2017 400 NXP Semiconductors ...