CHAPTER 9 REAL-TIME CLOCK
Page 253 of 920
9.4
Real-time Clock Operation
9.4.1
Starting operation of real-time clock
Figure 9 - 18 Procedure for Starting Operation of Real-time Clock
Note 1.
First set the RTCEN bit to 1, while oscillation of the count clock (f
RTC
) is stable.
Note 2.
Set up the SUBCUD register only if the watch error must be corrected. For details about how to
calculate the correction value, see
9.4.5 Example of watch error correction of real-time clock
Note 3.
Confirm the procedure described in 9.4.2 Shifting to HALT/STOP mode after starting operation when
shifting to HALT/STOP mode without waiting for INTRTC = 1 after RTCE = 1.
End
Setting MIN
RTCE = 0
Setting WUTMMCK0
Start
Setting HOUR
Setting SEC
INTRTC = 1?
Stops counter operation.
Sets f
RTC
.
Sets second count register.
Sets minute count register.
No
Yes
Sets hour count register.
Setting WEEK
Sets week count register.
Setting DAY
Sets day count register.
Setting MONTH
Sets month count register.
Setting YEAR
Sets year count register.
Sets watch error correction register.
Clearing IF flags of interrupt
Clearing MK flags of interrupt
Starts counter operation.
Supplies input clock.
Setting SEC
Setting AMPM, CT2 to CT0
Selects 12-/24-hour system and interrupt (INTRTC).
Clears interrupt request flags (RTCIF).
Clears interrupt mask flags (RTCMK).
RTCEN = 1
Note 1
Setting SUBCUD
Note 2
RTCE = 1
Note 3
Summary of Contents for RL78/G1H
Page 941: ...R01UH0575EJ0120 RL78 G1H...