Datasheet

V850ES/JG3-H, V850ES/JH3-H CHAPTER 12 REAL-TIME COUNTER
R01UH0042EJ0500 Rev.5.00 Page 663 of 1513
Aug 12, 2011
12.4.9 Watch error correction example of real-time counter
The watch error correction function corrects deviation in the oscillation frequency of a resonator connected to the
V850ES/Jx3-H.
Deviation, here, refers to steady-state deviation, which is deviation in the frequency when the resonator is designed.
Next, the timing chart when an error has occurred in the input clock intended to be 32.768 kHz but a 32.7681 kHz
resonator has been connected when designing the system, and the RC1SUBC and RC1SEC count operations to correct
the error are shown below.
Figure 12-10. Watch Error Correction Example
RTCCLK
(32.768 kHz)
RC1SUBC
Watch count(32.768 kHz)
Watch count
(32.7681 kHz/no error correction)
Watch count
(32.7681 kHz/error correction(DEV bit = 0, F6 bit = 0, F5 to F0 bit = 000010))
RC1SEC
01
01
00
00
7FFFH0000H 7FFFH
0000H
7FFFH
0000H
7FFFH7FFFH
0000H0000H
20
20
19
19
RTCCLK
(32.7681 kHz)
RC1SUBC
RC1SEC
7FFFH
7FFFH
0000H 0000H0000H 7FFFH 7FFFH
0000H
7FFFH 8000H 8001H 8000H
8001H
0000H 0000H
RTCCLK
(32.7681 kHz)
RC1SUBC
RC1SEC
20
seconds
Note 3
00
20
2 count numbers are added.2 count numbers are added.
20
seconds
Note 1
19.99994 seconds
Note 2
01
19
7FFFH
0000H0000H 7FFFH 7FFFH 7FFFH
0000H
Notes 1. The RC1SEC counter counts 20 seconds every 32,768 cycles (0000H to 7FFFH) of the 32.768 kHz
clock.
2. When 32,768 cycles (0000H to 7FFFH) of the 32.7681 kHz clock are input, the time counted by the
RC1SEC counter is calculated as follows: 32,768/3,268.1 0.999997 seconds
If this counting continues 20 times, the time is calculated as follows: (32,768/32,768.1) x 20 19.99994
seconds, which causes an error of 0.00006 seconds.
3. To precisely count 20 seconds by using a 32.7681 kHz clock, clear the DEV and F6 bits to 0 and set the
F5 to F0 bits to 2H (000010B) in the RC1SUBU register. As a result, two additional cycles are counted
every 20 seconds (when the RC1SEC counter count is 00, 20, and 40 seconds), so that the number of
cycles counted at these points is not 32,768, but 32,770 (0000H to 8001H), which is exactly 20 seconds.