C165UTAH
Real Time Clock (RTC)
Data Sheet
295
2001-02-23
13.2.8
Increased RTC Accuracy through Software Correction
The accuracy of the C165UTAH’s RTC is determined by the oscillator frequency and by
the respective prescaling factor (excluding or including T14 and the selectable
Prescaler). 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, eg. 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). T14 can be adjusted by a write access or better by using the in/
decrement function provided by the RTCCON register.
Note: For the majority of applications, however, the standard accuracy provided by the
RTC’s structure will be more than sufficient.
13.2.9
Hardware dependend RTC Accuracy
The RTC has different counting accuracies, depending on the operating mode (with or
without prescaler). There is only an impact on the counting accuracy when switching the
RTC from synchronous mode to asynchronous mode and back.
.
13.2.10
Interrupt Sub Node RTCISNC
All RTC interrupts are connected to one interrupt node via an interrupt sub node. For this
interrupt sharing each interrupt source has additionally to the node enable and request
flag its own enable and request flag located in register RTCISNC. After a RTC interrupt
Table 71
Impact on counting accuracy
Operating mode
Inaccuracy in T14
counting ticks
without prescaler
+0 / -0.5
with prescaler
+0 / -0