
Real-Time Clock
25-10
Freescale Semiconductor
25.4
Functional Description
The prescaler converts the incoming crystal reference clock to a 1 Hz signal which increments the seconds,
minutes, hours, and days counters. The alarm functions, when enabled, generate RTC interrupts when the
time-of-day (TOD) settings reach programmed values. The sampling timer generates fixed-frequency
interrupts, and the minute stopwatch allows for efficient interrupts on minute boundaries.
25.4.1
Prescaler and Counter
The prescaler divides the reference clock down to 1 Hz. The reference frequencies of 32.768 kHz,
38.4 kHz and 32 kHz are supported, selected via the RTC_CR[XTL] bit field. The prescaler stages are
tapped to support the sampling timer.
The counter portion of the RTC module consists of four groups of counters that are physically located in
three registers:
•
The 6-bit seconds counter is located in RTC_SECONDS
•
The 6-bit minutes counter and the 5-bit hours counter are located in RTC_HOURMIN
•
The 16-bit day counter is located in RTC_DAYS
These counters cover a 24-hour clock over 65,536 days. All three registers can be read or written at any
time.
Interrupts signal when each of the four counters increments and can indicate when a counter rolls over. For
example, each tick of the seconds counter causes the 1HZ interrupt flag to set. When the seconds counter
rolls from 59 to 00, the minute counter increments and the MIN interrupt flag is set. The same is true for
the minute counter with the HR signal and the hour counter with the DAY signal.
25.4.2
Alarm
There are three alarm registers that mirror the three counter registers. An alarm is set by accessing the
real-time clock alarm registers (RTC_ALRM_HM, RTC_ALRM_SEC, and RTC_ALRM_DAY) and
loading the exact timethat the alarm must generate an interrupt. If the RTC_IER[ALM] bit is set when the
TOD clock value and the alarm value coincide an interrupt occurs. If the alarm is not disabled and
programmed, an alarm reoccurs every 65,536 days. If a single alarm is desired, the alarm function must be
disabled through the RTC_IER register during the alarm interrupt service routine.
Section 25.5, “Initialization/Application Information,”
for the correct procedure to follow when
changing the alarm or time-of-day (day, hour, minute, or second) registers.
Table 25-12. RTC_ALM_DAYS Field Descriptions
Field
Description
31–16
Reserved, must be cleared.
15–0
DAYS
Current day setting of the alarm. Set to any value between 0 and 65,535 (0xFFFF).
MCF5329 Reference Manual, Rev 3
Summary of Contents for MCF5329
Page 106: ...ColdFire Core 3 32 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 148: ...Cache 5 22 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 154: ...Static RAM SRAM 6 6 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 184: ...Power Management 8 18 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 204: ...Reset Controller Module 10 8 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 220: ...System Control Module SCM 11 16 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 228: ...Crossbar Switch XBS 12 8 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 268: ...General Purpose I O Module 13 40 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 392: ...SDRAM Controller SDRAMC 18 30 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 436: ...Fast Ethernet Controller FEC 19 44 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 594: ...FlexCAN 23 30 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 678: ...Pulse Width Modulation PWM Module 26 22 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 684: ...Watchdog Timer Module 27 6 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 704: ...DMA Timers DTIM0 DTIM3 29 12 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 754: ...UART Modules 31 34 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 770: ...I2 C Interface 32 16 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 866: ...Debug Module 36 50 Freescale Semiconductor MCF5329 Reference Manual Rev 3...