Reading Time - Renesas RZ/A Series User Manual

Hide thumbs Also See for RZ/A Series:
Table of Contents

Advertisement

RZ/A1L Group, RZ/A1LU Group, RZ/A1LC Group
13.4.3

Reading Time

Figure 13.3 shows how to read the time.
Figure 13.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
13.3 shows the method of reading the time without using interrupts; part (b) in Figure 13.3 shows the method using
carry interrupts. To keep programming simple, method (a) should normally be used.
R01UH0437EJ0600 Rev.6.00
Jan 29, 2021
Disable the carry interrupt
Clear the carry flag
Read all the counter registers
to be read
Yes
Carry flag = 1?
No
(a) To read the time without using interrupts
Clear the carry flag
Enable the carry interrupt
Clear the carry flag
Read all the counter registers
to be read
Yes
interrupt
No
Disable the carry interrupt
(b) To read the time using interrupts
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.)
Write 0 to CIE in RCR1
13. Realtime Clock
13-17

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rz/a1 seriesRz/a1lu seriesRz/a1lc series

Table of Contents