
)%
User
’
s Manual
14-4
1999-08
Defining the RTC Time Base
The reload timer T14 determines the input frequency of the RTC timer, i.e. the RTC time
base, as well as the T14 interrupt cycle time. The table below lists the interrupt period
range and the T14 reload values (for a time base of 1 s and 1 ms) for several oscillator
frequencies:
Increased RTC Accuracy through Software Correction
The accuracy of the C161PI
’
s RTC is determined by the oscillator frequency and by the
respective prescaling factor (excluding or including T14). The accuracy limit generated
by the prescaler is due to the quantization of a binary counter (where the average is
zero), while the accuracy limit generated by the oscillator frequency is due to the
difference between ideal and real frequency (and therefore accumulates over time). The
total accuracy of the RTC can be further increased via software for specific applications
that demand a high time accuracy.
The key to the improved accuracy is the knowledge of the exact oscillator frequency. The
relation of this frequency to the expected ideal frequency is a measure for the RTC
’
s
deviation. The number N of cycles after which this deviation causes an error of ±1 cycle
can be easily computed. So the only action is to correct the count by ±1 after each series
of N cycles.
This correction may be applied to the RTC register as well as to T14.
Also the correction may be done cyclic, e.g. within T14
’
s interrupt service routine, or by
evaluating a formula when the RTC registers are read (for this the respective
last
“
RTC
value must be available somewhere).
Note: For the majority of applications, however, the standard accuracy provided by the
RTC
’
s structure will be more than sufficient.
Table 14-2
Oscillator
Frequency
RTC Interrupt Periods and Reload Values
RTC Interrupt Period
Minimum
Maximum T14REL
Aux. 244.14 μs
16.0 s
Aux. 250 μs
16.38 s
Main 8000 μs
524.29 s
Main 64.0 μs
4.19 s
Main 51.2 μs
3.35 s
Main 32.0 μs
2.10 s
Main 25.6 μs
1.68 s
Main 21.3 μs
1.40 s
Main 16.0 μs
1.05 s
Reload Value A
Reload Value B
T14REL
FFFC
H
FFFC
H
----
FFF0
H
FFEC
H
FFE1
H
FFD9
H
FFD2
H
FFC2
H
Base
1.000 s
1.000 s
1.000 s
1.000 s
0.999 s
1.000 s
0.999 s
1.000 s
1.000 s
Base
0.977 ms
1.000 ms
----
1.024 ms
1.024 ms
0.992 ms
0.998 ms
1.003 ms
0.992 ms
32.768KHz
32 KHz
32 KHz
4 MHz
5 MHz
8 MHz
10 MHz
12 MHz
16 MHz
F000
H
F060
H
FF83
H
C2F7
H
B3B5
H
85EE
H
676A
H
48E5
H
0BDC
H