Example Of Setting X1 Oscillation Clock - Renesas RL78/G13 User Manual

16-bit single-chip microcontrollers
Hide thumbs Also See for RL78/G13:
Table of Contents

Advertisement

RL78/G13

5.6.2 Example of setting X1 oscillation clock

After a reset release, the CPU/peripheral hardware clock (f
oscillator clock. To subsequently change the clock to the X1 oscillation clock, set the oscillator and start oscillation by
using the oscillation stabilization time select register (OSTS) and clock operation mode control register (CMC) and clock
operation status control register (CSC) and wait for oscillation to stabilize by using the oscillation stabilization time counter
status register (OSTC). After the oscillation stabilizes, set the X1 oscillation clock to f
register (CKC).
[Register settings] Set the register in the order of <1> to <5> below.
<1> Set (1) the OSCSEL bit of the CMC register, except for the cases where the frequency is equal or more than
<R>
10MHz, in such cases set (1) the AMPH bit, to operate the X1 oscillator.
CMC
AMPH bit: Set this bit to 0 if the X1 oscillation clock is 10 MHz or less.
<2> Using the OSTS register, select the oscillation stabilization time of the X1 oscillator at releasing of the STOP mode.
Example: Setting values when a wait of at least 102.4
OSTS
<3> Clear (0) the MSTOP bit of the CSC register to start oscillating the X1 oscillator.
CSC
<4> Use the OSTC register to wait for oscillation of the X1 oscillator to stabilize.
Example: Wait until the bits reach the following values when a wait of at least 102.4
resonator.
OSTC
<5> Use the MCM0 bit of the CKC register to specify the X1 oscillation clock as the CPU/peripheral hardware clock.
CKC
R01UH0146EJ0100 Rev.1.00
Sep 22, 2011
7
6
EXCLK
OSCSEL
EXCLKS
0
1
7
6
0
0
7
6
MSTOP
XTSTOP
0
1
7
6
MOST8
MOST9
MOST10
1
1
7
6
CLS
CSS
0
0
) always starts operating with the high-speed on-chip
CLK
5
4
OSCSELS
0
0
μ
s is set based on a 10 MHz resonator.
5
4
0
0
5
4
0
0
5
4
MOST11
MOST13
1
0
5
4
MCS
MCM0
0
1
CHAPTER 5 CLOCK GENERATOR
by using the system clock control
CLK
3
2
1
AMPHS1
AMPHS0
0
0
0
3
2
1
OSTS2
OSTS1
0
0
1
3
2
1
0
0
0
μ
s is set based on a 10 MHz
3
2
1
MOST15
MOST17
0
0
0
3
2
1
0
0
0
0
AMPH
1
0
OSTS0
0
0
HIOSTOP
0
0
MOST18
0
0
0
310

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rl78

Table of Contents