HD6417320 RENESAS [Renesas Technology Corp], HD6417320 Datasheet - Page 643

no-image

HD6417320

Manufacturer Part Number
HD6417320
Description
Renesas 32-Bit RISC Microcomputer SuperHTM RISC engine Family / SH7700 Series
Manufacturer
RENESAS [Renesas Technology Corp]
Datasheet
17.4.3
Figure 17.3 shows how to read the 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 17.3 shows the method of reading the time without using interrupts; part
(b) in figure 17.3 shows the method using carry interrupts. To keep programming simple, method
(a) should normally be used.
Reading Time
Yes
Yes
(a)
Disable the carry interrupt
Disable the carry interrupt
Enable the carry interrupt
(b) To use interrupts
To read the time
without using interrupts
Read counter register
Read counter register
Clear the carry flag
Clear the carry flag
Clear the carry flag
Carry flag = 1?
interrupt
Figure 17.3 Reading Time
No
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
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.)
Read RCR1 and check CF bit
Write 0 to CIE in RCR1
Rev. 3.00 Jan. 18, 2008 Page 581 of 1458
Section 17 Realtime Clock (RTC)
REJ09B0033-0300

Related parts for HD6417320