English
Language : 

SH7263 Datasheet, PDF (742/1862 Pages) Renesas Technology Corp – Renesas 32-Bit RISC Microcomputer SuperHTM RISC engine Family / SH7260 Series
Section 14 Realtime Clock (RTC)
14.4.3 Reading Time
Figure 14.3 shows how to read the time.
Disable the carry interrupt
Clear the carry flag
Read counter register
Yes
Carry flag = 1?
No
Write 0 to CIE in RCR1
Write 0 to CF in RCR1
(Set AF in RCR1 to 1 so that alarm
flag is not cleared.)
Read RCR1 and check CF bit
(a) To read the time without using interrupts
Clear the carry flag
Enable the carry interrupt
Clear the carry flag
Read counter register
Write 1 to CIE in RCR1
Write 0 to CF in RCR1
(Set AF in RCR1 to 1 so that alarm
flag is not cleared.)
Yes
interrupt
No
Disable the carry interrupt
Read RCR1 and check CF bit
Write 0 to CIE in RCR1
(b) To read the time using interrupts
Figure 14.3 Reading Time
If a carry occurs while reading the time, the correct time will not be obtained, so it must be read
again. Part (a) in figure 14.3 shows the method of reading the time without using interrupts; part
(b) in figure 14.3 shows the method using carry interrupts. To keep programming simple, method
(a) should normally be used.
Rev. 2.00 Mar. 14, 2008 Page 708 of 1824
REJ09B0290-0200