RL78/G1H CHAPTER 9 REAL-TIME CLOCK
R01UH0575EJ0120 Rev. 1.20 Page 259 of 920
Dec 22, 2016
Example of correcting from 32772.3 Hz to 32768 Hz (32772.3 Hz - 131.2 ppm)
[Measuring the oscillation frequency]
The oscillation frequency
Note
of each product is measured by outputting about 32.768 kHz from the PCLBUZ0
pin.
Note See 11.4 Operations of Clock Output/Buzzer Output Controller for the setting procedure of
outputting about 32 kHz from the PCLBUZ0 pin.
[Calculating the correction value]
(When the output frequency from the PCLBUZ0 pin is 32772.3 Hz)
Assume the target frequency to be 32768 Hz (32772.3 Hz - 131.2 ppm) and DEV to be 0, because the
correctable range of -131.2 ppm is -63.1 ppm or lower.
The expression for calculating the correction value when DEV is 0 is applied.
Correction value = Number of correction counts in 1 minute ÷ 3
= (Oscillation frequency ÷ target frequency - 1) × 32768 × 60 ÷ 3
= (32772.3 ÷ 32768 - 1) × 32768 × 60 ÷ 3
= 86
[Calculating the values to be set to (F6 to F0)]
(When the correction value is 86)
If the correction value is 0 or larger (when slowing), assume F6 to be 0.
Calculate (F5, F4, F3, F2, F1, F0) from the correction value.
{(F5, F4, F3, F2, F1, F0) - 1} × 2 = 86
(F5, F4, F3, F2, F1, F0) = 44
(F5, F4, F3, F2, F1, F0) = (1, 0, 1, 1, 0, 0)
Consequently, when correcting from 32772.3 Hz to 32768 Hz (32772.3 Hz - 131.2 ppm), setting the correction
register such that DEV is 0 and the correction value is 86 (bits 6 to 0 of the SUBCUD register: 0101100) results in
32768 Hz (0 ppm).
Figure 9 - 23 shows the operation when (DEV, F6, F5, F4, F3, F2, F1, F0) is (0, 0, 1, 0, 1, 1, 0, 0).
Correction example