English
Language : 

DS80C320-MCG Datasheet, PDF (158/175 Pages) Dallas Semiconductor – High-Speed Microcontroller User Guide
High-Speed Microcontroller User’s Guide
SECTION 14: REAL-TIME CLOCK
The DS87C530 incorporates a real-time clock (RTC) onto the High-Speed Microcontroller family core.
This allows the device to perform real-time related functions such as data logging and time-stamping
without an external timer. In addition, the RTC includes an alarm function which can execute a software
interrupt or resume operation from Stop mode at a specified time. The RTC features are controlled by 12
new SFRs. These registers, as well as two new interrupt control bits are shown in Table 14-1.
REAL-TIME CLOCK CONTROL AND STATUS BIT SUMMARY Table 14-1
BIT NAME LOCATION
FUNCTION
RANGE RESET
READ/WRITE ACCESS
ERTCI
EIE.5
RTC Interrupt Enable
0
Unrestricted
PRTCI
EIP.5
RTC Interrupt Priority
0
Unrestricted
RTASS.7–0 RTASS
RTC Alarm Subsecond 0–FFh Unchanged Unrestricted
RTAS.5–0 RTAS
RTC Alarm Second
0–3Bh Unchanged Unrestricted
RTAM.5–0 RTAM
RTC Alarm Minute
0–3Bh Unchanged Unrestricted
RTAH.4–0 RTAH
RTC Alarm Hour
0–17H Unchanged Unrestricted
RTCSS.7–0 RTCSS
RTC Subsecond
0–FFh
Unchanged
Read: only if RTCRE=1.
Cannot be written. Cleared
when RTCWE 1–>0
RTCS.5–0
RTCM.5–0
RTCH.4–0
DOW.2–0
RTCS
RTCM
RTCH.4–0
RTCH.7–5
RTC Second
RTC Minute
RTC Hour
RTC Day of Week
0–3Bh
0–3Bh
0–17h
0–7h
Unchanged
Unchanged
Unchanged
Unchanged
Read: only if RTCRE=1.
Write: only if RTCWE=1.
1.95 ms Read/Write window
RTCD1.7–0 RTCD1, (MSB) RTC Day
0–FFFFh Unchanged
RTCD0.7–0 RTCD0, (LSB)
SRCE
RTCC.7
RTC Subsecond
Compare Enable
Unchanged Unrestricted
SCE
RTCC.6
RTC Second Compare
Enable
Unchanged Unrestricted
MCE
RTCC.5
RTC Minute Compare
Enable
Unchanged Unrestricted
HCE
RTCC.4
RTC Hour Compare
Unchanged Unrestricted
Enable
RTCRE
RTCC.3
RTC Read Enable
0
Unrestricted
RTCWE
RTCC.2
RTC Write Enable
0
Read: Unrestricted
Write: Timed Access
RTCIF
RTCC.1
RTC Interrupt Flag
Unchanged Unrestricted
RTCE
E4K
RTCC.0
TRIM.7
RTC Enable
External 4096 Hz RTC
Signal Enable
Unchanged
0
Read: Unrestricted
Write: Timed Access
X12/6
TRIM.6
RTC Crystal Capaci-
tance Select
Unchanged
TRM2–0
TRIM.5
TRIM.3
RTC Trim Bit 2–0
Unchanged Read: Unrestricted
Write: Timed Access
TRIM.1
The RTC control and status registers can be subdivided into 4 groups: RTC time registers (RTCSS;FAh,
RTCS;FBh, RTCM;FCh, RTCH;FDh, RTCD0;FEh, RTCD1;FFh), RTC alarm registers (RTASS;F2h,
RTAS;F3h, RTAM;F4h, RTAH;F5h), RTC calibration (TRIM;96h), and RTC control (RTCC;F9h).
STARTING AND STOPPING THE RTC
Operation of the RTC is enabled by setting the RTC Enable bit, RTCE (RTCC.0) to 1. This will start the
RTC crystal amplifier, and begin clocking the RTC. Like all crystal oscillators, the RTC crystal oscillator
has a crystal warm-up period. Software should allow a minimum of 1 second between setting the RTCE
bit to 1 and initializing the time. This allows the clock to be guaranteed stable when timekeeping begins.
158 of 175