Real-Time Clock
Élan™SC520 Microcontroller User’s Manual 20-9
20.5.1.4 Using the Alarm Function
The three alarm bytes can be used in two different ways.
■ If the Alarm Interrupt Enable (ALM_INT_ENB) bit is set in the RTC Control B (RTCCTLB)
register, the alarm interrupt occurs at the time specified in the alarm registers.
■ If a “don’t care” state (any hexadecimal byte from C0
±
FFh) is written to one or more of
the three alarm registers, the alarm interrupt occurs from once per second to once per
hour.
– Setting the hour, minute, and second alarm registers with a value from C0–FFh causes
an RTC alarm event to be generated once per second.
– Setting the hours, and minutes alarm registers with a value from C0–FFh causes an
RTC alarm event to be generated once per minute.
– Setting the hours alarm registers with a value from C0–FFh causes an RTC alarm
event to be generated once per hour.
20.5.1.5 Handling Year 2000 Issues
With appropriate software support, the ÉlanSC520 microcontroller is Y2K-compliant. The
Y2K problem is handled by storing the century part of the year in the byte at 32h in the
CMOS memory. The operating system software must handle rollover of the RTC Current
Year (RTCCURYR) register (RTC index 09h).
To be Y2K-compliant, the software that sets the year must accept four-digit years. The
routine that sets the RTC stores the lower portion of the year value in the RTC Current Year
(RTCCURYR) register and the upper portion in the century CMOS memory location.
This operation is handled properly by PC-style BIOS software that supports the ÉlanSC520
microcontroller. For information on what BIOS products are supported, see the AMD web
site.
For embedded systems, a simple set of software functions supports four-digit years with
the RTC.
20.5.2 Clocking Considerations
The 32KXTAL2 and 32KXTAL1 pins are used to connect the external 32.768-kHz crystal
or oscillator to the ÉlanSC520 microcontroller. This clock source is then used to clock the
internal RTC.
For other details, see Chapter 5, “Clock Generation and Control”.
20.5.3 Interrupts
The RTC provides three different interrupt sources. All three interrupts are connected
internally to the programmable interrupt controller and can be mapped to any interrupt
channel. The three interrupt sources are:
■ Periodic Interrupt—Can be set at rates from 122 µs to 500 ms.
■ Alarm Interrupt—Can be set at rates from once-per-second to once-per-day.
■ Update-Ended Interrupt—Provides update cycle status.
These three interrupts are enabled in RTC Control B (RTCCTLB) register. The RTC interrupt
request is only active from low to high.
Before these interrupts can be used, they must be mapped to the programmable interrupt
controller. For more information, see Table 15-4 on page 15-12.