
R01UH0218EJ0110 Rev.1.10
Page 129 of 664
Sep 12, 2011
R32C/142 Group and R32C/145 Group
7. Clock Generator
7.7.2
Wait Mode
The base clock stops in wait mode so that clocks generated by the base clock, the CPU clock and
peripheral bus clock, stop running as well. Thus the CPU and watchdog timer, operated by these two
clocks, also stop. However, the watchdog timer continues operating when the PM22 bit in the PM2
register is set to 1 (on-chip oscillator selected as count source for the watchdog timer). Since the main
clock, sub clock, PLL clock, and on-chip oscillator clock continue running, peripheral functions using
these clocks also continue operating.
7.7.2.1
Peripheral Clock Source Stop Function
When the CM02 bit in the CM0 register is set to 1 (peripheral clock source stopped in wait mode),
power consumption is reduced since peripheral clocks f1, f8, f32, f2n (when the clock source is the
peripheral clock source), and fAD stop running in wait mode. fC32 and f2n (when the clock source is
the main clock) do not stop running.
7.7.2.2
Entering Wait Mode
To enter wait mode, the following procedures should be completed before the WAIT instruction is
executed.
Initial setting
Set the wake-up interrupt priority level (bits RLVL2 to RLVL0 in registers RIPL1 and RIPL2) to 7.
Then set each interrupt request level.
Steps before entering wait mode
(1) Set the I flag to 0.
(2) Set the interrupt request level for each interrupt source (interrupt number from 1 to 127) to 0, if its
interrupt request level is not 0.
(3) Perform a dummy read of any of the interrupt control registers.
(4) Set the processor interrupt priority level (IPL) in the flag register to 0.
(5) Enable interrupts temporarily by executing the following instructions:
FSET I
NOP
FCLR I
(6) Set the interrupt request level for the interrupt to exit wait mode.
Do not rewrite the interrupt control register after this step.
(7) Set the IPL in the flag register.
(8) Set the interrupt priority level for resuming to the same level as the IPL.
Interrupt request level for the interrupt to exit wait mode > IPL = Interrupt priority level for
resuming
(9) Set the CM20 bit in the CM2 register to 0 (disable oscillator stop detection) when the oscillator
stop detection is used.
(10)Enter either low speed mode or low power mode.
(11)Set the I flag to 1.
(12)Execute the WAIT instruction.
After exiting wait mode
Set the wake-up interrupt priority level to 7 immediately after exiting wait mode.