
XC161 Derivatives
Peripheral Units (Vol. 2 of 2)
Real Time Clock
User’s Manual
15-11
V2.2, 2004-01
RTC_X8, V2.1
Each timer in the chain divides the clock by (2
<timer_width>
- <reload_value>) : 1, as the
shows the reload values which must be chosen for a specific
scenario (i.e. operating mode of the RTC).
15.3.3
Cyclic Interrupt Generation
The RTC module can generate an interrupt request whenever one of the timers
overflows and is reloaded. This interrupt request may be used, for example, to provide
a system time tick independent of the CPU frequency without loading the general
purpose timers, or to wake up regularly from sleep mode. The interrupt cycle time can
be adjusted by choosing appropriate reload values and by enabling the appropriate
interrupt request.
In this mode, the other operating modes can be combined. For example, a reload value
of T14REL = F9C0
H
(2
16
- 1600) generates a T14 interrupt request every 50 ms to wake-
up the system regularly. Still the subsequent timers can be configured to represent the
time or build a binary counter, however with a different time base.
Table 15-3
Reload Value Scenarios
REL3
REL2
REL1
REL0
T14REL
Ti
m
e
o
f
D
a
y
(
)
Formula
2
10
- 24
2
6
- 60
2
6
- 60
2
10
- 1000
2
16
- 33
Rel. Value
3E8
H
04
H
04
H
018
H
FFDF
H
Function
h
m
s
1/1000 s
Prescaler
Intr. Period
day
hour
minute
second
millisec.
1)
1) T14 errors in the first example (ms) can be compensated either by choosing an adapted value for REL0, or by
using software correction.
D
ay of the
Week
Formula
2
10
- 7
2
6
- 24
2
6
- 60
2
10
- 60
2
16
- 32768
Rel. Value
3F9
H
28
H
04
H
3C4
H
8000
H
Function
day
h
m
s
Prescaler
Intr. Period
week
day
hour
minute
second