
CHAPTER 9 REAL-TIME COUNTER
User’s Manual U19780EJ2V0UD
306
9.4.7 Example of watch error correction of real-time counter
The watch can be corrected with high accuracy when it is slow or fast, by setting a value to the watch error
correction register.
Example of calculating the correction value
The correction value used when correcting the count value of the sub-count register (RSUBC) is calculated by
using the following expression.
Set DEV to 0 when the correction range is
−
63.1 ppm or less, or 63.1 ppm or more.
(When DEV = 0)
Correction value
Note
= Number of correction counts in 1 minute
÷
3 = (Oscillation frequency
÷
Target frequency
−
1)
¯
32768
¯
60
÷
3
(When DEV = 1)
Correction value
Note
= Number of correction counts in 1 minute = (Oscillation frequency
÷
Target frequency
−
1)
¯
32768
¯
60
Note
The correction value is the watch error correction value calculated by using bits 6 to 0 of the watch error
correction register (SUBCUD).
(When F6 = 0) Correction value = {(F5, F4, F3, F2, F1, F0)
−
1}
¯
2
(When F6 = 1) Correction value =
−
{(/F5, /F4, /F3, /F2, /F1, /F0) + 1}
¯
2
When (F6, F5, F4, F3, F2, F1, F0) is (*, 0, 0, 0, 0, 0, *), watch error correction is not performed. “*” is 0
or 1.
/F5 to /F0 are bit-inverted values (000011 when 111100).
Remarks 1.
The correction value is 2, 4, 6, 8, … 120, 122, 124 or
−
2,
−
4,
−
6,
−
8, …
−
120,
−
122,
−
124.
2.
The oscillation frequency is the subsystem clock (f
SUB
) value.
It can be calculated from the 32 kHz output frequency of the RTCCL pin or the output frequency of
the RTC1HZ pin
¯
32768 when the watch error correction register is set to its initial value (00H).
3.
The target frequency is the frequency resulting after correction performed by using the watch error
correction register.