
C165H
Real Time Clock (RTC)
Data Sheet
283
2001-04-19
PRELMNARY
with prescaler
-EXCERPT-
Interrupt Sub Node RTCISNC
12.2.8
Increased RTC Accuracy through Software Correction
The accuracy of the C165H’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
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.
12.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.
.
12.2.10
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
(RTC_INT) is arbitrated, the interrupt service routine has to check the request flags of all
enabled sources and run the respective software routine. The request flags have to be
deleted by software before leaving the interrupt service routine.
Table 62
Impact on counting accuracy
Operating mode
Inaccuracy in T14 counting ticks
without prescaler
+0 / -0.5
+0 / -0