
SH7751 Group, SH7751R Group
Section 11 Realtime Clock (RTC)
R01UH0457EJ0301 Rev. 3.01
Page 309 of 1128
Sep 24, 2013
11.3
Operation
Examples of the use of the RTC are shown below.
11.3.1
Time Setting Procedures
Figure 11.2 shows examples of the time setting procedures.
Stop clock
Reset frequency divider
Set second/minute/hour/day/
day-of-week/month/year
Start clock operation
Set RCR2.RESET to 1
Clear RCR2.START to 0
In any order
Set RCR2.START to 1
(a) Settin
g
time after stoppin
g
clock
Clear carry fla
g
Write to counter re
g
ister
Carry fla
g
= 1?
No
Yes
Clear RCR1.CF to 0
(Write 1 to RCR1.AF so that alarm fla
g
is not cleared)
Set RYRCNT first and RSECCNT last
Read RCR1 re
g
ister and check CF bit
(b) Settin
g
time while clock is runnin
g
Figure 11.2 Examples of Time Setting Procedures
The procedure for setting the time after stopping the clock is shown in figure 11.2 (a). The
programming for this method is simple, and it is useful for setting all the counters, from second to
year.