Section 20 Realtime Clock (RTC)
Rev.1.00 Dec. 13, 2005 Page 727 of 1286
REJ09B0158-0100
20.4 Operation
Examples of the use of the RTC are shown below.
20.4.1 Time
Setting
Procedures
Figure 20.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
(a) Setting time after stopping clock
(b) Setting time while clock is running
Set RCR2.RESET to 1.
Clear RCR2.START to 0.
In any order.
Set RCR2.START to 1.
Clear RCR1.CF to 0
(Write 1 to RCR1.AF so that alarm flag
is not cleared).
Set RYRCNT first and RSECCNT last.
Read RCR1 register and check CF bit.
Clear carry flag
Write to counter register
Carry flag = 1?
No
Yes
Figure 20.2 Examples of Time Setting Procedures
The procedure for setting the time after stopping the clock is shown in figure 20.2 (a). The
programming for this method is simple, and it is useful for setting all the counters, from second to
year.
The procedure for setting the time while the clock is running is shown in figure 20.2 (b). This
method is useful for modifying only certain counter values (for example, only the second data or
hour data). If a carry occurs during the write operation, the write data is automatically updated and
there will be an error in the set data. The carry flag should therefore be used to check the write
status. If the carry flag (RCR1.CF) is set to 1, the write must be repeated.
The interrupt function can also be used to determine the carry flag status.
Summary of Contents for SH7780 Series
Page 2: ...Rev 1 00 Dec 13 2005 Page ii of l ...
Page 28: ...Rev 1 00 Dec 13 2005 Page xxviii of l ...
Page 50: ...Rev 1 00 Dec 13 2005 Page l of l ...
Page 82: ...Section 1 Overview Rev 1 00 Dec 13 2005 Page 32 of 1286 REJ09B0158 0100 ...
Page 122: ...Section 3 Instruction Set Rev 1 00 Dec 13 2005 Page 72 of 1286 REJ09B0158 0100 ...
Page 146: ...Section 4 Pipelining Rev 1 00 Dec 13 2005 Page 96 of 1286 REJ09B0158 0100 ...
Page 196: ...Section 6 Floating Point Unit FPU Rev 1 00 Dec 13 2005 Page 146 of 1286 REJ09B0158 0100 ...
Page 292: ...Section 9 L Memory Rev 1 00 Dec 13 2005 Page 242 of 1286 REJ09B0158 0100 ...
Page 492: ...Section 12 DDR SDRAM Interface DDRIF Rev 1 00 Dec 13 2005 Page 442 of 1286 REJ09B0158 0100 ...
Page 674: ...Section 15 Clock Pulse Generator CPG Rev 1 00 Dec 13 2005 Page 624 of 1286 REJ09B0158 0100 ...
Page 692: ...Section 16 Watchdog Timer and Reset Rev 1 00 Dec 13 2005 Page 642 of 1286 REJ09B0158 0100 ...
Page 726: ...Section 18 Timer Unit TMU Rev 1 00 Dec 13 2005 Page 676 of 1286 REJ09B0158 0100 ...
Page 1032: ...Section 25 Audio Codec Interface HAC Rev 1 00 Dec 13 2005 Page 982 of 1286 REJ09B0158 0100 ...
Page 1150: ...Section 28 General Purpose I O GPIO Rev 1 00 Dec 13 2005 Page 1100 of 1286 REJ09B0158 0100 ...
Page 1184: ...Section 29 User Break Controller UBC Rev 1 00 Dec 13 2005 Page 1134 of 1286 REJ09B0158 0100 ...
Page 1266: ...Section 31 Electrical Characteristics Rev 1 00 Dec 13 2005 Page 1216 of 1286 REJ09B0158 0100 ...
Page 1328: ...Appendix Rev 1 00 Dec 13 2005 Page 1278 of 1286 REJ09B0158 0100 ...
Page 1336: ...Rev 1 00 Dec 13 2005 Page 1286 of 1286 REJ09B0158 0100 ...
Page 1339: ......
Page 1340: ...SH7780 Hardware Manual ...