CMS32L051 User Manual |Chapter 7 Real-Time Clock
www.mcu.com.cn 244 / 703
Example of correcting from 32767.4Hz to 32768Hz (32767.4Hz+18.3ppm).
[Measurement of oscillation frequency]
When the clock error correction register (SUBCUD) is the initial value (0000H), the oscillation
frequency of each product is measured by outputting a signal of approximately 1Hz from the RTC1HZ
pin.
Note For the setting steps for the RTC1Hz output, refer to 1Hz Output of the 10.4.5 Real-Time Clock.
[Calculation of correction value]
(The output frequency of the RTC1HZ pin is 0.9999817Hz).
Oscillation frequency = 327680.9999817×
Suppose the frequency of interest is 32768Hz (32767.4Hz + 18.3ppm) and DEV=1.
The formula for calculating the correction value when the DEV bit is 1 applies.
Correction value =1 minute correction count value = (oscillation frequency÷target frequency 1) ×32768×60
= (32767.4÷327681) ×32768×60
=-36
[Calculation of the config value of (F12~F0)].
(In the case of correction value = 36).
Because the correction value is less than 0 (in case of speeding up), F12=1. Calculated from the correction
value (F11~F0).
-{(/F11~/F0)1}2=-36 ×
(/F11~/F0)=17
(/F11~/F0)=(0,0,0,0,0,0,0,1,0,0,0,1)
(F11~F0)=(1,1,1,1,1,1,1,0,1,1,1,0)
Therefore, the correction from 32767.4Hz to 32768Hz (32767.4Hz+18.3ppm) is as follows:
If you pass DEV=1 and correct values =-36 (bit12~0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0) to
set the correction register, which can be corrected to 32768Hz (0ppm).