RL78/G10 CHAPTER 5 CLOCK GENERATOR
R01UH0384EJ0311 Rev. 3.11 93
Dec 22, 2016
5.6 Controlling Clock
5.6.1 Example of setting high-speed on-chip oscillator
After a reset release, the CPU/peripheral hardware clock (f
CLK) always starts operating with the high-speed on-chip
oscillator clock. The frequency of the high-speed on-chip oscillator can be selected by using FRQSEL0 to FRQSEL2 of
the option byte (000C2H). This frequency can be changed with the high-speed on-chip oscillator frequency select register
(HOCODIV).
[Option byte setting]
Address: 000C2H
Option
byte
(000C2H)
7 6 5 4 3 2 1 0
1 1 1 1 1 FRQSEL2 FRQSEL1 FRQSEL0
FRQSEL2 FRQSEL1 FRQSEL0 Frequency of the high-speed on-chip oscillator
0 0 1
20 MHz
0 1 0
10 MHz
0 1 1
5 MHz
1 0 0
2.5 MHz
1 0 1
1.25 MHz
Other than above Setting prohibited
[High-speed on-chip oscillator frequency selection register (HOCODIV) setting]
Address: F00A8H
7 6 5 4 3
2 1 0
HOCODIV 0 0 0 0 0
HOCODIV 2 HOCODIV 1 HOCODIV 0
HOCODIV 2 HOCODIV 1 HOCODIV 0
Selected frequency
0 0 1 20 MHz
0 1 0 10 MHz
0 1 1 5 MHz
1 0 0 2.5 MHz
1 0 1 1.25 MHz
Other than above Setting prohibited
Cautions 1. Set the HOCODIV register within the operable voltage range before and after the
frequency change.
2. Set the HOCODIV register with the high-speed on-chip oscillator clock (fIH)
selected as the CPU/peripheral hardware clock (f
CLK).
3. After the frequency is changed with the HOCODIV register, the frequency is
switched after the following transition time has elapsed.
• Operation for up to three clocks at the pre-change frequency
• CPU/peripheral hardware clock wait at the post-change frequency for up to
three clocks