RL78/F13, F14 CHAPTER 9 REAL-TIME CLOCK
R01UH0368EJ0210 Rev.2.10 677
Dec 10, 2015
9.4 Real-time Clock Operation
9.4.1 Starting operation of real-time clock
Figure 9-21. Procedure for Starting Operation of Real-time Clock
Notes 1. First set the RTCEN bit to 1, while oscillation of the input clock (f
RTC) is stable.
2. Set up the SUBCUD register only if the watch error must be corrected. Set up the SUBCUDW register if
the watch must be corrected with high accuracy. For details about how to calculate the correction value,
see 9.4.6 Example of watch error correction of real-time clock.
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.
Start
INTRTC = 1?
RTCEN = 1
Note 1
Supplies input clock.
Setting SEC
Sets second count register.
Setting MIN Sets minute count register.
No
Yes
Setting HOUR 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.
Setting SUBCUD or
SUBCUDW
Note 2
Sets watch error correction register.
Selects 12-/24-hour system and interrupt (INTRTC).
Clearing IF flags of interrupt Clears interrupt request flags (RTCIF).
Clearing MK flags of interrupt Clears interrupt mask flags (RTCMK).
RTCE = 1
Note 3
Starts counter operation.
End
Setting RTCCL
Sets fRTC.
Setting AMPM, CT2 to CT0
Stops counter operation.
RTCE = 0