
III PERIPHERAL BLOCK: LOW-SPEED (OSC1) OSCILLATION CIRCUIT
S1C33T01 FUNCTION PART
EPSON
B-III-6-3
Controlling Oscillation
The low-speed (OSC1) oscillation circuit can be turned on or off using SOSC1 (D0) / Power control register
(0x40180).
The oscillation circuit is turned off by writing "0" to SOSC1 and turned back on again by writing "1". SOSC1 is set
to "1" at initial reset, so the oscillation circuit is turned on.
Notes: When the low-speed (OSC1) oscillation circuit is used as the clock source for the CPU operating
clock, it cannot be turned off. In this case, writing "0" to SOSC1 is ignored. Note also that writing
to SOSC1 is allowed only when the power-control register protection flag is set to "0b10010110".
Immediately after the oscillation circuit is turned on, a certain period of time is required for
oscillation to stabilize (3 sec max.). To prevent the device from operating erratically, do not use
the clock until its oscillation has stabilized.
The low-speed (OSC1) oscillation circuit does not stop when the CPU is set in SLEEP mode.
Switching Over the CPU Operating Clock
After an initial reset, the CPU starts operating using the OSC3 clock.
In cases in which some peripheral circuits (e.g., programmable timer, serial interface, and A/D converter) that are
clocked by the OSC3 clock do not need to be operate and the CPU can process its jobs at a low clock speed, the CPU
operating clock can be switched to the OSC1 clock, thereby reducing current consumption. Use CLKCHG (D2) /
Power control register (0x40180) to switch over the operating clock.
Procedure for switching over from the OSC3 clock to the OSC1 clock
1. Turn on the low-speed (OSC1) oscillation circuit (by writing "1" to SOSC1).
2. Wait until the OSC1 oscillation stabilizes (three seconds or more).
3. Change the CPU operating clock (by writing "0" to CLKCHG).
4. Turn off the high-speed (OSC3) oscillation circuit (by writing "0" to SOSC3).
Steps 1 and 2 are required only when the low-speed (OSC1) oscillation circuit is inactive.
Notes: Use separate instructions to switch from OSC3 to OSC1 and turn the OSC3 oscillation off. If
these operations are processed simultaneously using one instruction, the CPU may operate
erratically.
Make sure the operation of the peripheral circuits, such as the programmable timer, A/D
converter, and serial interface, which are clocked by the OSC3 oscillation circuit, is terminated
before the OSC3 oscillation is turned off in order to prevent them from operating erratically.
Procedure for switching over from the OSC1 clock to the OSC3 clock
1. Turn on the high-speed (OSC3) oscillation circuit (by writing "1" to SOSC3).
2. Wait until the OSC3 oscillation stabilizes (10 ms or more for a 3.3-V crystal resonator).
3. Switch over the CPU operating clock (by writing "1" to CLKCHG).
Note: The operating clock switchover by CLKCHG is effective only when both oscillation circuits are on
and the power-control register protection flag is set to "0b10010110".
Power-Control Register Protection Flag
The power-control register (SOSC1, SOSC3, CLKCHG, CLKDT[1:0]) at address 0x40180, which is used to control
the oscillation circuits and the CPU operating clock, is normally disabled against writing in order to prevent it from
malfunctioning due to unnecessary writing.
To enable this register for writing, the power-control register protection flag CLGP[7:0] (D[7:0]) / Power-control
protection register (0x4019E) must be set to "0b10010110". Note that this setting allows for the power-control
register (0x40180) to be written to only once, so all bits of CLGP[7:0] are cleared to "0" when this address is written
to. Therefore, CLGP[7:0] must be set to "0b10010110" each time the power-control register (0x40180) is written to.
The flag CLGP[7:0] does not affect the readout from the power-control register (0x40180).