RL78/G10 CHAPTER 5 CLOCK GENERATOR
R01UH0384EJ0311 Rev. 3.11 99
Dec 22, 2016
5.6.5 Time required for switchover of CPU clock and main system clock
The main system clock can be switched between the high-speed on-chip oscillator clock and the high-speed system
clock by specifying bit 4 (MCM0) of the system clock control register (CKC).
The actual switchover operation is not performed immediately after rewriting to the CKC register; operation continues
on the pre-switchover clock for several clocks (see Table 5-5).
Whether the main system clock is operating on the high-speed system clock or high-speed on-chip oscillator clock can
be ascertained using bit 5 (MCS) of the CKC register.
When the CPU clock is switched, the peripheral hardware is also switched.
Table 5-5. Maximum Number of Clocks Required for f
IH ↔ fMX
Set Value Before Switchover Set Value After Switchover
MCM0 MCM0
0
(f
MAIN = fIH)
1
(fMAIN = fMX)
0
(f
MAIN = fIH)
f
MX≥fIH 1 + fIH/fMX
fMX<fIH 2fIH/fMX clock
1
(f
MAIN = fMX)
f
MX≥fIH 2fMX/fIH clock
fMX<fIH 1 + fMX/fIH
Remarks 1. Number of CPU clocks before switchover.
2. Calculate the number of clocks by rounding to the nearest whole number.
Example When switching the main system clock from the high-speed system clock to the high-speed on-
chip oscillator clock (@ oscillation with f
IH = 5 MHz selected, fMX = 10 MHz)
2 f
IH/fMX = 2(10/5) = 4 → 4 clocks
5.6.6 Conditions before clock oscillation is stopped
The following lists the register flag settings for stopping the clock oscillation (disabling external clock input) and
conditions before the clock oscillation is stopped. Before stopping the clock oscillation, check the conditions before the
clock oscillation is stopped.
Table 5-6. Conditions Before the Clock Oscillation Is Stopped and Flag Settings
Clock Conditions Before Clock Oscillation Is Stopped
Flag Settings of SFR
Register
High-speed on-chip
oscillator clock
MCS = 1
(The CPU is operating on the high-speed system clock.)
HIOSTOP = 1
X1 clock
MCS = 0
(The CPU is operating on the high-speed on-chip oscillator clock.)
MSTOP = 1
External main system clock