RL78/F13, F14 CHAPTER 9 REAL-TIME CLOCK
R01UH0368EJ0210 Rev.2.10 684
Dec 10, 2015
(2) Correction example
Example of correcting from 32767.4 Hz to 32768 Hz (32767.4 Hz + 18.3 ppm)
[Measuring the oscillation frequency]
The oscillation frequency
Note 1
of each product is measured by outputting about 1 Hz from the RTC1HZ pin when the
watch error correction register (SUBCUD, SUBCUDW) is set to its initial value (0000H). The frequency can also be
measured by selecting
Note 2
RTC1HZ for the input of timer array unit.
Notes 1. See 9.4.5 1 Hz output of real-time clock for the setting procedure of outputting about 1 Hz from the RTC1HZ
pin. For input selection of timer array unit, see 6.3.9 Timer input select register 1 (TIS1) and 6.3.10 Timer
input select register 2 (TIS2).
2. The RTC1HZ signal is not output from the RTC1HZ pin when the RTC1HZ output signal is selected for the
input to timer array unit by the setting of the timer input select register 1 or 2 (TIS1 or TIS2).
[Calculating the correction value]
(When the output frequency from the RTCCL pin is 0.9999817 Hz)
Oscillation frequency = 32768 0.9999817 32767.4 Hz
Assume the target frequency to be 32768 Hz (32767.4 Hz + 18.3 ppm) and DEV to be 1.
The expression for calculating the correction value when DEV is 1 is applied.
Correction value = Number of correction counts in 1 minute
= (Oscillation frequency Target frequency 1) 32768 60
= (32767.4 32768 1) 32768 60
= 36
[Calculating the values to be set to (F12 to F0)]
(When the correction value is 36)
If the correction value is 0 or less (when quickening), assume F12 to be 1.
Calculate (F11, F10, F9, F8, F7, F6, F5, F4, F3, F2, F1, F0) from the correction value.
{(/F11, /F10, /F9, /F8, /F7, /F6, /F5, /F4, /F3, /F2, /F1, /F0) 1} 2 = 36
(/F11, /F10, /F9, /F8, /F7, /F6, /F5, /F4, /F3, /F2, /F1, /F0) = 17
(/F11, /F10, /F9, /F8, /F7, /F6, /F5, /F4, /F3, /F2, /F1, /F0) = (0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1)
(F11, F10, F9, F8, F7, F6, F5, F4, F3, F2, F1, F0) = (1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0)
Consequently, when correcting from 32767.4 Hz to 32768 Hz (32767.4 Hz + 18.3 ppm), setting the correction register
such that DEV is 1 and the correction value is 36 (bits 12 to 0 of the SUBCUDW register: 1111111101110) results in
32768 Hz (0 ppm).
Figure 9-25 shows the operation when (DEV, F12, F11, F10, F9, F8, F7, F6, F5, F4, F3, F2, F1, F0) is (1, 1, 1, 1, 1,
1, 1, 1, 1, 0, 1, 1, 1, 0).