Real-Time Clock
MCF52235 ColdFire® Integrated Microcontroller Reference Manual, Rev. 6
8-11
Freescale Semiconductor
8.3
Functional Description
The RTC uses a supplied 1 Hz signal to increment the seconds, minutes, hours, and days TOD counters.
The alarm functions, when enabled, generate RTC interrupts when the TOD settings reach programmed
values. The minute stopwatch allows for efficient interrupts on minute boundaries.
8.3.1
Prescaler and Counter
A 1 Hz clock is supplied to the RTC. This 1 Hz clock drives the RTC’s counters. 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 the SECONDS register
•
The 6-bit minutes counter and the 5-bit hours counter are located in the HOURMIN register
•
The 16-bit day counter is located in the DAYR register
These counters cover a 24-hour clock over 65536 days. All three registers can be read or written at any
time.
Interrupts signal when each of the four counters increments, and can be used to indicate when a counter
rolls over. For example, each tick of the seconds counter causes the 1HZ interrupt flag to be 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.
8.3.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 (ALRM_HM, ALRM_SEC, and DAYALARM) and loading the exact time
that the alarm should generate an interrupt. If RTCIENR[ALM] is set, when the TOD clock value and the
alarm value coincide, an interrupt occurs one half second later. If the alarm is not disabled, it reoccurs
every 65536 days. If a single alarm is desired, the alarm function must be disabled through RTCIENR.
8.3.3
Minute Stopwatch
The minute stopwatch performs a countdown with a one minute resolution. It can be used to generate an
interrupt on a minute boundary. At each minute, the value in the stopwatch is decremented. When the
stopwatch value reaches -1, the interrupt occurs. The value of the register does not change until it is
reprogrammed. The actual delay includes the seconds from setting the stopwatch to the next minute tick.
Table 8-11. ALRM_DAY Field Descriptions
Field
Description
31–16
Reserved, should be cleared.
15–0
DAYSAL
Day Setting of the Alarm. This field can be set to any value between 0 and 65535.
Because
of
an
order
from
the
United
States
International
Trade
Commission,
BGA-packaged
product
lines
and
part
numbers
indicated
here
currently
are
not
available
from
Freescale
for
import
or
sale
in
the
United
States
prior
to
September
2010:MCF52234CVM60,
MCF52235CVM60