
XC161 Derivatives
Peripheral Units (Vol. 2 of 2)
Real Time Clock
User’s Manual
15-7
V2.2, 2004-01
RTC_X8, V2.1
15.3
RTC Operating Modes
The RTC can be configured for several operating modes according to the purpose it is
meant to serve. These operating modes are configured by selecting appropriate reload
values and interrupt signals.
Figure 15-3
RTC Block Diagram
RTC Register Access
The actual value of the RTC is indicated by the three registers T14, RTCL, and RTCH.
As these registers are concatenated to build the RTC counter chain, internal overflows
occur while the RTC is running. When reading or writing the RTC value, such internal
overflows must be taken into account to avoid reading/writing corrupted values.
Care must be taken, when reading the timer(s), as this requires up to three read
accesses to the different registers with an inherent time delay between the accesses. An
overflow from T14 to RTCL and/or from RTCL to RTCH might occur between the
accesses, which needs to be taken into account appropriately.
For example, reading/writing 0000
H
to RTCH and then accessing RTCL could produce
a corrupted value as RTCL may overflow before it can be accessed. In this case, RTCH
would be 0001
H
. The same precautions must be taken for T14 and T14REL.
m c b0 48 05 _x c .v s d
T 1 4 R E L
T 1 4
T14-R egister
C N T-R egister
R E L-R egister
1 0 B its
6 B its
6 B its
1 0 B its
1 0 B its
6 B its
6 B its
1 0 B its
In te rrup t S ub N o d e
C N T
IN T 0
C N T
IN T 1
C N T
IN T 2
C N T
IN T 3
R T C IN T
1
0
8
R U N
P R E
f
R T C
M U X
f
C N T