CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
112 User’s Manual U10676EJ3V0UM
6.2.3 Setting CPU clock
(1) Time required to switch CPU clock
The CPU clock can be switched by using the lower 2 bits of PCC. The processor does not operate with the
selected clock, however, immediately after data has been written to the registers; it operates with the pre-
change clock for the duration of a certain number of machine cycles. To stop oscillation of the system clock,
therefore, execute the STOP instruction after a specific time has elapsed.
Table 6-5. Maximum Time Required for CPU Clock Switching
Set Value Before Switching Set Value After Switching
PCC1 PCC0 PCC1 PCC0 PCC1 PCC0 PCC1 PCC0 PCC1 PCC0
00011011
0 0 1 machine cycle 1 machine cycle 1 machine cycle
0 1 4 machine cycles 4 machine cycles 4 machine cycles
1 0 8 machine cycles 8 machine cycles 8 machine cycles
1 1 16 machine cycles 16 machine cycles 16 machine cycles
Caution The value of fX changes depending on conditions such as the ambient temperature of the
resonators, and variations in load capacitance performance.
Particularly when fX is higher than the nominal value, the machine cycle in the table becomes
bigger than the machine cycle obtained by the nominal value. Therefore, when setting the wait
time required for switching the CPU clock, set it longer than the machine cycle obtained by the
fX nominal value.
(2) CPU clock switching procedure
The switching procedure of the CPU clock is explained according to Figure 6-19.