Renesas rl78 User Manual

Page of 1004
 
RL78/G1A 
 
CHAPTER  7   REAL-TIME  CLOCK 
7.4  Real-time Clock Operation 
 
7.4.1  Starting operation of real-time clock 
 
Figure 7-19.  Procedure for Starting Operation of Real-time Clock  
 
Start
INTRTC = 1?
RTCE = 0
Stops counter operation.
Setting AMPM, CT2 to CT0
Selects 12-/24-hour system and interrupt (INTRTC).
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
Note 2
Sets watch error correction register.
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
RTCEN = 1
Note 1
Supplies input clock.
Setting WUTMMCK0
Sets f
RTC
 
 
Notes 1.  First set the RTCEN bit to 1, while oscillation of the count clock (f
RTC
) is stable. 
 2. 
Set up the SUBCUD register only if the watch error must be corrected.  For details about how to 
calculate the correction value, see 7.4.6  Example of watch error correction of real-time clock. 
 3.  Confirm the procedure described in 7.4.2  Shifting to HALT/STOP mode after starting operation 
when shifting to HALT/STOP mode without waiting for INTRTC = 1 after RTCE = 1. 
R01UH0305EJ0200  Rev.2.00 
 
 
310  
Jul 04, 2013