RL78/G15 CHAPTER 5 CLOCK GENERATOR
R01UH0959EJ0110 Rev.1.10 Page 158 of 765
Mar 7, 2023
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 Main System Clock Switchover (f
IH
↔ f
MX
)
Set Value Before Switchover Set Value After Switchover
MCM0 MCM0
0
(f
MAIN
= f
IH
)
1
(f
MAIN
= f
MX
)
0
(f
MAIN
= f
IH
)
f
MX
≥ f
IH
— 1 + f
IH
/f
MX
f
MX
< f
IH
— 2f
IH
/f
MX
clock
1
(f
MAIN
= f
MX
)
f
MX
≥ f
IH
2f
MX
/f
IH
clock —
f
MX
< f
IH
1 + f
MX
/f
IH
—
Remark 1. Number of CPU clocks before switchover.
Remark 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
= 8 MHz selected, f
MX
= 10 MHz)
2f
MX
/f
IH
= 2 (10/8) = 2.5 → 3 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