Functional Description - Freescale Semiconductor MCF5329 Reference Manual

Devices supported: mcf5327; mcf5328; mcf53281; mcf5329
Table of Contents

Advertisement

Real-Time Clock
Field
31–16
Reserved, must be cleared.
15–0
Current day setting of the alarm. Set to any value between 0 and 65,535 (0xFFFF).
DAYS
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.
See
Section 25.5, "Initialization/Application Information,"
changing the alarm or time-of-day (day, hour, minute, or second) registers.
25-10
Table 25-12. RTC_ALM_DAYS Field Descriptions
Description
MCF5329 Reference Manual, Rev 3
for the correct procedure to follow when
Freescale Semiconductor

Advertisement

Table of Contents
loading

Table of Contents