170
CHAPTER 7 CLOCK GENERATION CIRCUIT
7.6 Changing Setting of System Clock and CPU Clock
7.6.1 Time required for switching between system clock and CPU clock
The system clock or CPU clock can be selected by using bits 0 through 2 (PCC0-PCC2) and bit 4 (CSS) of the
processor clock control register (PCC).
Actually, the specified clock is not selected immediately after the setting of PCC has been changed, and the old
clock is used for the duration of several instructions after that (refer to
Table 7-3
).
Whether the system operates on the main system clock or subsystem clock can be checked by using bit 5 (CLS)
of PCC.
Table 7-3. Maximum Time Required for Switching CPU Clock
Caution Do not select the division ratio of the CPU clock (PCC0-PCC2) and switch the main system clock
to the subsystem clock (CSS 0
→
1) at the same time.
However, the division ratio of the CPU clock (PCC0-PCC2) can be selected and the subsystem
clock can be switched to the main system clock at the same time (CSS 1
→
0).
Remarks
1.
One instruction is the minimum instruction execution time of the CPU clock before switching.
2.
( ): f
X
= 10.0 MHz, f
XT
= 32.768 kHz
Set Value before
Switching
Set Value after Switching
PCC1
CSS
PCC2
PCC0
CSS
PCC2
0
0
0
PCC0
0
PCC1
PCC0
PCC1
PCC2
0
0
0
1
PCC1
PCC2
CSS
0
0
1
CSS
PCC0
0
PCC1
PCC2
CSS
0
0
1
PCC0
1
PCC1
PCC2
CSS
0
1
0
PCC0
0
PCC1
PCC2
CSS
1
×
×
PCC0
×
0
16 instructions
16 instructions
16 instructions
16 instructions
8 instructions
8 instructions
8 instructions
8 instructions
4 instructions
4 instructions
4 instructions
4 instructions
2 instructions
2 instructions
2 instructions
2 instructions
1 instruction
1 instruction
1 instruction
1 instruction
1 instruction
1 instruction
1 instruction
1 instruction
0
0
0
0
1
0
0
0
1
1
1
0
0
0
1
×
×
×
1
f
X
/4f
XT
instructions
(77 instructions)
f
X
/8f
XT
instructions
(39 instructions)
f
X
/16f
XT
instructions
(20 instructions)
f
X
/32f
XT
instructions
(10 instructions)
f
X
/64f
XT
instructions
(5 instructions)
1 instruction