r5s77631ay266bgv Renesas Electronics Corporation., r5s77631ay266bgv Datasheet - Page 844

no-image

r5s77631ay266bgv

Manufacturer Part Number
r5s77631ay266bgv
Description
Renesas 32-bit Risc Microcomputer Superhtm Risc Engine Family Sh-4a Series
Manufacturer
Renesas Electronics Corporation.
Datasheet
Section 22 Realtime Clock (RTC)
22.5
Examples of the use of the RTC are shown below.
22.5.1
Figure 22.2 shows examples of the time setting procedures.
The procedure for setting the time after stopping the clock is shown in figure 22.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 22.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.
Rev. 1.00 Oct. 01, 2007 Page 778 of 1956
REJ09B0256-0100
Operation
Time Setting Procedures
Yes
(b) Setting time while clock is running
Figure 22.2 Examples of Time Setting Procedures
(a) Setting time after stopping clock
Set second/minute/hour/day/
day-of-week/month/year
Write to counter register
Reset frequency divider
Start clock operation
Clear carry flag
Carry flag = 1?
Stop clock
No
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.

Related parts for r5s77631ay266bgv