
iiiPeriPheraLModuLes1(systeM):CLoCkManageMentunit(CMu)
iii-1-26
ePson
s1C33L17teChniCaLManuaL
iii.1.12ClocksetupProcedure
This section describes the procedure for setting up clocks or altering clock settings.
When initially reset, the clocks are set to the following states:
OSC3 oscillator circuit: On
PLL:
Off
OSC1 oscillator circuit: On
System clock source:
OSC3
MCLK:
OSC31/1
CMU_CLK:
OSC31/1
iii.1.12.1ChangingtheClocksourcefromosC3toPLL
1. Clock Control Protect Register (0x301B24) = 0x96
Disable write protection of the clock control registers.
2. PLLPOWR (D0/0x301B0C) = 0
Turn off the PLL.
3. Setting PLL Control Register (0x301B0C)
PLLN[3:0] (D[7:4]) = 0b0000–0b1111
Set the frequency multiplication rate of the PLL (x1 to x16).
PLLV[1:0] (D[3:2]) = 0b01–0b11
Set the W value of the PLL (2, 4 or 8).
PLLVC[3:0] (D[15:12]) = 0b0001–0b1000
Set the VCO Kv circuit constant.
PLLRS[3:0] (D[11:8]) = 0b1000 or 0b1010
Set the LPF resistance value.
4. PLLPOWR (D0/0x301B0C) = 1
Turn on the PLL.
5. OSCSEL[1:0] (D[3:2]/0x301B08) = 0b11
Select the PLL for the clock source.
6. Setting the Clock Option Register (0x301B14)
OSCTM[7:0] (D[15:8]) =
Set appropriate values so that the wait timer exceeds the stabilization time
OSC3OFF (D3) = 0
of the PLL output clock (e.g. 200 s in the S1C33L17). Be aware that the
TMHSP (D2) =
wait timer operates with the PLL clock. For details about the PLL output
WAKEUPWT (D0) = 0
stabilization time, see “Electrical Characteristics.”
This setting causes the CPU to automatically exit SLEEP mode and restart after the set time has passed
without waiting for an interrupt.
7. Stop any peripheral circuits that are operating, except the RTC.
8. Execute the slp instruction.
The chip enters SLEEP mode and the CMU temporarily stops clock output. The CPU automatically reawakens
from SLEEP mode after the set time has passed from execution of the slp instruction, and restarts using the
PLL as the clock source.
9. Newly setting the clock control registers again
Newly alter the MCLK or CMU_CLK settings, and set other clock control registers again, as required.
10. Clock Control Protect Register (0x301B24) = other than 0x96
Reenable write protection of the clock control registers.