Switching The System Clock - Epson S1C17704 Technical Manual

Cmos 16-bit single chip microcomputer
Table of Contents

Advertisement

7.4 Switching the System Clock

The OSC module allows software to switch the system clock between the OSC3 and OSC1 clocks. Current
consumption can be reduced by disabling the OSC3 oscillation after the system clock is switched to OSC1.
The following shows the control procedure:
OSC3 to OSC1
1. Set OSC1EN (D1/OSC_CTL register) to 1 to start the OSC1 oscillation if it is disabled.
∗ OSC1EN: OSC1 Enable Bit in the Oscillation Control (OSC_CTL) Register (D1/0x5061)
2. Set CLKSRC (D0/OSC_SRC register) to 1 to switch the system clock from OSC3 to OSC1.
∗ CLKSRC: System Clock Source Select Bit in the Clock Source Select (OSC_SRC) Register (D0/0x5060)
3. If the application does not need the peripheral modules clocked with OSC3 to operate, set OSC3EN (D0/
OSC_CTL register) to 0 to stop the OSC3 oscillation.
∗ OSC3EN: OSC3 Enable Bit in the Oscillation Control (OSC_CTL) Register (D0/0x5061)
Notes: • When the system clock is switched from OSC3 to OSC1 immediately after the OSC1 oscillator
starts oscillating, the system clock is halted until the OSC1 clock is activated (256 OSC1
clock-cycle period).
• The OSC3 oscillation cannot be stopped before switching the system clock to OSC1.
OSC1 to OSC3
1. Set a stable oscillation wait time (see Table 7.2.2) longer than the OSC3 oscillation start time using
OSC3WT[1:0] (D[5:4]/OSC_CTL register). (This control is not necessary if it has been set already.)
∗ OSC3WT[1:0]: OSC3 Wait Cycle Select Bits in the Oscillation Control (OSC_CTL) Register (D[5:4]/0x5061)
2. Set OSC3EN (D0/OSC_CTL register) to 1 to start the OSC3 oscillation if it is disabled. The OSC3 clock is
not supplied to the system until the wait time set in OSC3WT[1:0] (D[5:4]/OSC_CTL register) has elapsed
after the OSC3 oscillator starts oscillating.
3. Set CLKSRC (D0/OSC_SRC register) to 0 to switch the system clock from OSC1 to OSC3.
4. If the application does not need the peripheral modules clocked with OSC1 to operate, set OSC1EN (D1/
OSC_CTL register) to 0 to stop the OSC1 oscillation.
Notes: • Skip Steps 1 and 2 when the OSC2 oscillator circuit is operating.
• The OSC3 oscillation start time varies depending on the resonator and externally attached
parts. Set the stable oscillation wait time with a safety margin. Refer to the oscillation start time
example described in Chapter 26, "Electrical Characteristics."
• The OSC1 oscillation cannot be stopped before switching the system clock to OSC3.
S1C17704 TECHNICAL MANUAL
EPSON
7 OSCILLATOR (OSC)
7-5

Advertisement

Table of Contents
loading

Table of Contents