English
Language : 

C161 Datasheet, PDF (272/400 Pages) Infineon Technologies AG – 16-Bit Single-Chip Microcontroller
&3,
7KH 5HDO 7LPH &ORFN
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:
Table 14-2 RTC Interrupt Periods and Reload Values
Oscillator
Frequency
RTC Interrupt Period Reload Value A
Minimum Maximum T14REL Base
Reload Value B
T14REL Base
32.768KHz
32 KHz
32 KHz
4 MHz
5 MHz
8 MHz
10 MHz
12 MHz
16 MHz
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
F000H
F060H
FF83H
C2F7H
B3B5H
85EEH
676AH
48E5H
0BDCH
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
FFFCH
FFFCH
----
FFF0H
FFECH
FFE1H
FFD9H
FFD2H
FFC2H
0.977 ms
1.000 ms
----
1.024 ms
1.024 ms
0.992 ms
0.998 ms
1.003 ms
0.992 ms
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.
User’s Manual
14-4
1999-08