
iiiPeriPheraLModuLes1(systeM):CLoCkManageMentunit(CMu)
iii-1-24
ePson
s1C33L17teChniCaLManuaL
notes: InSLEEPmode,thereisatimelagbetweeninputofaninterruptsignalforwakeupandthe
startoftheclocksupplytotheITC,soadelaywilloccuruntiltheinterruptcontroller(ITC)sets
thecause-of-interruptflag.Therefore,nointerruptwilloccuriftheinterruptsignalisdeasserted
beforetheclockissuppliedtotheITC,asthecause-of-interruptflagintheITCisnotset.
Furthermore,additionaltimeisneededfortheCPUtoaccepttheinterruptrequestfromthe
ITC,theCPUmayexecuteafewinstructionsthatfollowtheslpinstructionbeforeitstartsthe
interrupt processing.The same problem may occur when the CPU wakes up from SLEEP
mode by NMI. No interrupt will occur if the #NMI signal is deasserted before the clock is
supplied,astheNMIflagisnotset.
Before setting the IC to SLEEP mode, the clock supply for the USB and LCDC must be
disabled.
stoppingosC3oscillationandwaitingforoscillationstabilizationatwakeup
By default, neither the low-speed (OSC1) oscillator circuit nor the high-speed (OSC3) oscillator circuit
stops operating when in SLEEP mode. OSC3 oscillation can be made to stop during SLEEP mode by setting
OSC3OFF (D3/0x301B14).
osC3oFF:OSC3DisableDuringSLEEPintheClockOptionRegister(D3/0x301B14)
Setting OSC3OFF (D3/0x301B14) to 1 causes OSC3 oscillation to stop during SLEEP mode. In this case, the
OSC3 oscillator circuit starts oscillating when the CPU is reawaken from SLEEP mode. However, since the
CPU may operate erratically if it starts operating with the OSC3 or PLL clock before the oscillation stabilizes,
an OSC oscillation start wait timer is provided to keep the CPU waiting a while before it starts operating. The
wait time can be set by using OSCTM[7:0] (D[15:8]/0x301B14) and TMHSP (D2/0x301B14).
osCtM[7:0]:OSCOscillationStabilization-WaitTimerintheClockOptionRegister(D[15:8]/0x301B14)
tMhsP:Stabilization-WaitTimerHigh-SpeedModeSelectBitintheClockOptionRegister(D2/0x301B14)
TableIII.1.11.2.1OscillationStabilizationWaitTimeatWakeup
tMhsP
1
0
osCtM[7:0]
0x0
0x1
0x2
:
0xFF
0x0
0x1
0x2
:
0xFF
time
0
800ns
1.6
s
:
0.204ms
0
0.409ms
0.819ms
:
104.5ms
numberofclocks
0
16
32
:
4080
0
8192
16384
:
2M
(Thetimeshownhereisanexamplewhenoperatingwitha20MHzOSC3.)
sLeePcontrolwhenclocksourcesareswitchedover
When the CPU reawakes from SLEEP mode, the clock sources (OSC3, OSC1, or PLL) also are switched over
depending on how OSCSEL[1:0] (D[3:2]/0x301B08) is set. Before the clock sources can be switched over, the
CPU must be placed once in SLEEP mode, then released. Therefore, a function is provided that automatically
reawakes the CPU from SLEEP mode without using an interrupt, etc. To use this function, set WAKEUPWT
(D0/0x301B14) to 0. (By default, it is set to 1.)
osCseL[1:0]:OSCClockSelectBitsintheSystemClockControlRegister(D[3:2]/0x301B08)
WakeuPWt:Wakeup-WaitFunctionEnableBitintheClockOptionRegister(D0/0x301B14)
When the slp instruction is executed with WAKEUPWT (D0/0x301B14) set to 0, the CPU automatically
reawakes from SLEEP mode several 10 clock cycles after that time, then restarts with the source clock selected
by OSCSEL[1:0] (D[3:2]/0x301B08) after the oscillation stabilization time described above has elapsed.
The OSC oscillation start wait timer configured using OSCTM[7:0] (D[15:8]/0x301B14) and TMHSP
(D2/0x301B14) is effective even if WAKEUPWT (D0/0x301B14) is 0. To restart the CPU in the shortest time
possible, set OSCTM[7:0] (D[15:8]/0x301B14) to 0x0 and TMHSP (D2/0x301B14) to 1.
When WAKEUPWT (D0/0x301B14) is set to 1, the CPU is reawaken from SLEEP mode by initial reset, RTC
interrupt, NMI, or other interrupt from an external device.
For details about clock switchover and SLEEP control procedures, see Section III.1.12, “Clock Setup
Procedure.”