RL78/G13
Clock Generator (Clock Switching) CC-RL
R01AN2831EJ0100 Rev. 1.00
Page 32 of 51
May 28, 2015
5.8.8 Main
Processing
Figure 5.9 shows the flowchart for the main processing.
Figure 5.9 Main Processing
NO
main
YES
NO
The switch status is set on
an INTP0 external interrupt
(P_INTC0_Interrupt).
R_INTC0_Start()
Start INTP0 operation
R_TAU0_Channel0_Start()
Start operation of channel 0 of TAU0
YES
Switch pressed status?
R_CGC_ChangeClock()
Change operation clock
_
R_CGC_GetClockStatus()
Get clock status
Operating on new clock?
Switch status
Not pressed
Transition to HALT mode
Returned from HALT mode on
an interval timer interrupt of
channel 0 of TAU0 channel 0
(R_TAU0_Channel0_Interrupt)
or INTP0 external interrupt input
(R_INTC0_Interrupt).
Enable interrupts
1
IE
R_TAU0_Channel0_Restart()
Restart channel 0 of TAU0
R_TAU0_Channel0_GetParameter()
Get parameters of channel 0 of TAU0
R_CGC_StopClock()
Stop old clock