English
Language : 

SH7708 Datasheet, PDF (344/625 Pages) Renesas Technology Corp – SuperH™ RISC engine
Part (a) in figure 12.2 shows how to set the time when the clock is stopped. This works when the
entire calendar or clock is to be set.
Part (b) in figure 12.2 describes how to set the clock when the clock is running. This works when
only part of the calendar or clock needs to be reset (e.g., changing only the seconds or only the
hour). The write status is checked using the carry flags. When there is a carry during the writing of
new data, the new data is automatically updated. Since this causes errors in the data, the data must
be rewritten if the carry flag is set to 1.
The interrupt function can be used to determine the status of the carry flag.
a. To reset the divider circuit and set the counter
Stop clock,
Write 1 to RESET and 0 to
reset divider circuit START in the RCR2 register
Set seconds, minutes,
hour, day, day of the Order is irrelevant
week, month and year
Start clock
Write 1 to START in the
RCR2 register
b. To set the seconds-year counter
Clear the carry flag
Write 0 to CF in RCR1
Note: Set AF to 1 so that alarm
flag is not cleared
Write the counter
register
Yes
Carry flag = 1?
Read RCR1 and check CF
No
Figure 12.2 Setting the Time
330