EasyManua.ls Logo

AMD Elan SC520 - Programming the Date and Time

AMD Elan SC520
444 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Real-Time Clock
20-8 Élan™SC520 Microcontroller User’s Manual
register (RTC index 05h). When the 12-hour format is selected, the AM_PM bit and
ALM_AM_PM bit in these two respective registers represent PM when they are a 1.
20.5.1.2 Programming the Date and Time
A program can initialize the time, calendar, and alarm by writing to appropriate RAM location.
Before initializing the internal registers, set the SET bit in the RTC Control B (RTCCTLB)
register (RTC index 0Bh) to prevent time and calendar updates from occurring.
Initialize the ten locations in the selected format (binary or BCD).
Specify the format using the data mode (DATE_MODE) bit in the RTC Control B
(RTCCTLB) register. All time, calendar, and alarm registers must use the same data
mode, either binary or BCD.
Clear the SET bit to allow updates.
20.5.1.3 Generating Periodic Interrupts
Different periodic interrupt rates can be specified by programming the RATE_SEL bit field
in the RTC Control A (RTCCTLA) register, as shown in Table 20-4.
The periodic interrupt is enabled by the PER_INT_ENB bit field in the RTC Control B
(RTCCTLB) register. The PER_INT_FLG bit in the RTC Status C (RTCSTAC) register (RTC
index 0Ch) provides latched status for the RTC periodic interrupt event.
Note: The first interrupt may not occur at the programmed rate due to synchronization.
Table 20-4 Using RATE_SEL to Specify a Periodic Interrupt Rate
Periodic Interrupt Interval Frequency RATE_SEL3–0
None None 0000
3.90625 ms 256 Hz 0001
7.8125 ms 128 Hz 0010
122.070 µs 8 kHz 0011
244.14 µs 4 kHz 0100
488.28 µs 2 kHz 0101
976.562 µs 1 kHz 0110
1.953125 ms 512 Hz 0111
3.90625 ms 256 Hz 1000
7.8125 ms 128 Hz 1001
15.625 ms 64 Hz 1010
31.25 ms 32 Hz 1011
62.5 ms 16 Hz 1100
125 ms 8 Hz 1101
250 ms 4 Hz 1110
500 ms 2 Hz 1111

Table of Contents