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
0
0
0
0
3.90625 ms
256 Hz
0
0
0
1
7.8125 ms
128 Hz
0
0
1
0
122.070
µ
s
8 kHz
0
0
1
1
244.14
µ
s
4 kHz
0
1
0
0
488.28
µ
s
2 kHz
0
1
0
1
976.562
µ
s
1 kHz
0
1
1
0
1.953125 ms
512 Hz
0
1
1
1
3.90625 ms
256 Hz
1
0
0
0
7.8125 ms
128 Hz
1
0
0
1
15.625 ms
64 Hz
1
0
1
0
31.25 ms
32 Hz
1
0
1
1
62.5 ms
16 Hz
1
1
0
0
125 ms
8 Hz
1
1
0
1
250 ms
4 Hz
1
1
1
0
500 ms
2 Hz
1
1
1
1
Содержание Elan SC520
Страница 1: ...lan SC520 Microcontroller User s Manual Order 22004A...
Страница 4: ...iv lan SC520 Microcontroller User s Manual...
Страница 28: ...Introduction xxviii lan SC520 Microcontroller User s Manual...
Страница 42: ...Architectural Overview 1 14 lan SC520 Microcontroller User s Manual...
Страница 78: ...System Initialization 3 22 lan SC520 Microcontroller User s Manual...
Страница 108: ...Clock Generation and Control 5 10 lan SC520 Microcontroller User s Manual...
Страница 118: ...Reset Generation 6 10 lan SC520 Microcontroller User s Manual...
Страница 148: ...System Arbitration 8 24 lan SC520 Microcontroller User s Manual...
Страница 214: ...SDRAM Controller 10 36 lan SC520 Microcontroller User s Manual...
Страница 230: ...Write Buffer and Read Buffer 11 16 lan SC520 Microcontroller User s Manual...
Страница 288: ...GP Bus DMA Controller 14 22 lan SC520 Microcontroller User s Manual...
Страница 316: ...Programmable Interval Timer 16 8 lan SC520 Microcontroller User s Manual...
Страница 328: ...Software Timer 18 4 lan SC520 Microcontroller User s Manual...
Страница 346: ...Real Time Clock 20 12 lan SC520 Microcontroller User s Manual...
Страница 360: ...UART Serial Ports 21 14 lan SC520 Microcontroller User s Manual...
Страница 414: ...AMDebug Technology 26 8 lan SC520 Microcontroller User s Manual...