BAT32G1x9 user manual | Chapter 11 Real-time clock
461 / 1149
Rev.1.02
11.4.6
An example of clock error correction for a real-time clock
High-precision clock speed correction can be performed by setting the value of the clock error correction
register.
The correction value when correcting the count value of the internal counter (16 bits) can be calculated
using the following formula. When the correction range is outside the range of
–4165.6ppm to 4165.6ppm
, the
DEV position must be "0".
(The case of DEV=0)
Correction Value
Note
= 1 minute correction count value = (oscillation frequency target frequency -1)
÷
32768
×
60
×
÷
3
(The case of DEV=1)
Correction Value
Note
= 1 minute correction count value = (Oscillation Frequency Target Frequency-1)
×
32768
×
60
Note:
The correction value is a clock error correction value calculated based on the value of bit12~0 of the clock error
correction register (SUBCUD).
(Case of F12=0) Correction value = {(F11,F10,F9,F8,F7,F6,F5,F4,F3,F2,F1,F0)-1}
×
2
(Case of F12=1) Correction = -{(/F11,/F10,/F9,/F8,/F7,/F6,/F5,/F4,/F3,/F2,/F1,/F0)+1}
×
2
When (F12~F0)=(*,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,*), no correction of clock error is performed.
* is "0" or "1".
/F12~/F0 is the inverse of each member (when "000000000011", "111111111100).
Note: 1. The correction value is 2,4,6,8,1......,8186, 8188 or -2,-4,-6,-8,......,-8186,-8188.
2. The oscillation frequency is the
value
of the counting clock (fRTC).
Output frequency of the RTC1HZ pin 032768 when clock error correction register is initial value (00H)
3. The target frequency is the frequency corrected using the clock error correction register.
Example of the method of calculating the corrected value