
III PERIPHERAL MODULES 1 (SYSTEM): CLOCK MANAGEMENT UNIT (CMU)
III-1-24
EPSON
S1C33E07 TECHNICAL MANUAL
Notes: In SLEEP mode, there is a time lag between input of an interrupt signal for wakeup and the
start of the clock supply to the ITC, so a delay will occur until the interrupt controller (ITC) sets
the cause-of-interrupt flag. Therefore, no interrupt will occur if the interrupt signal is deasserted
before the clock is supplied to the ITC, as the cause-of-interrupt flag in the ITC is not set.
Furthermore, additional time is needed for the CPU to accept the interrupt request from the
ITC, the CPU may execute a few instructions that follow the slp instruction before it starts the
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, as the NMI flag is not set.
Before setting the IC to SLEEP mode, the clock supply for the USB and LCDC must be
disabled.
Stopping OSC3 oscillation and waiting for oscillation stabilization at wakeup
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: OSC3 Disable During SLEEP in the Clock Option Register (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]: OSC Oscillation Stabilization-Wait Timer in the Clock Option Register (D[15:8]/0x301B14)
TMHSP: Stabilization-Wait Timer High-Speed Mode Select Bit in the Clock Option Register (D2/0x301B14)
Table III.1.11.2.1 Oscillation Stabilization Wait Time at Wakeup
TMHSP
1
0
OSCTM[7:0]
0x0
0x1
0x2
:
0xFF
0x0
0x1
0x2
:
0xFF
Time
0
800 ns
1.6
s
:
0.204 ms
0
0.409 ms
0.819 ms
:
104.5 ms
Number of clocks
0
16
32
:
4080
0
8192
16384
:
2M
(The time shown here is an example when operating with a 20 MHz OSC3.)
SLEEP control when clock sources are switched over
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]: OSC Clock Select Bits in the System Clock Control Register (D[3:2]/0x301B08)
WAKEUPWT: Wakeup-Wait Function Enable Bit in the Clock Option Register (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.”