BAT32G1x9 user manual | Chapter 4 Clock generation circuit
105 / 1149
Rev.1.02
4.6.2
Example of setting up the X1 oscillation circuit
After the reset is released, the CPU/Peripheral Hardware Clock (f
CLK
) must be running at a high-speed
internal oscillator clock. Thereafter, if the oscillation clock is changed to X1, the oscillation circuit is set and the
oscillation start is controlled by the oscillation settling time selection register (OSTS), the clock operation mode
control register (CMC), and the clock operating state control register (CSC). And wait for the oscillation to
stabilize through the state register (OSTC) of the oscillation settling time counter. Set the X1 oscillation clock
to f CLK via the system clock control register (CKC) after waiting for the oscillation to stabilize.
【
Register Setting
】
Registers must be set in the order of (1) to (5).
(1) The OSCSEL position of the CMC register is "1", and when f
X
is greater than or equal to 10MHz, AMPH
Bit set to "1" to make the X1 oscillation circuit run.
7
6
5
4
3
2
1
0
CMC
(2) The oscillation stabilization time of the X1 oscillation circuit when the deep sleep mode is deactivated
through the OSTS register.
Example) To wait at least 102 us through a 10MHz resonator, it must be set to the following values.
7
6
5
4
3
2
1
0
OSTS
(3) Clear the MSTOP bit of the CSC register to "0" so that the X1 oscillation circuit begins to oscillate.
7
6
5
4
3
2
1
0
CSC
(4) Wait for the oscillation stabilization of the X1 oscillation circuit through the OSTC register.
Example) To wait at least 102 us through a 10MHz resonator, you must wait until you change to the
following values.
7
6
5
4
3
2
1
0
OSTC
(5) Set the X1 oscillation clock to the CPU/peripheral hardware clock through the MCM0 bit of the CKC
register.
7
6
5
4
3
2
1
0
CKC
EXCLK
0
OSCSEL
1
EXCLKS
0
OSCSELS
0
0
AMPHS1
0
AMPHS0
0
AMPH
0/1
0
0
0
0
0
OSTS2
0
OSTS1
1
OsTS00
MSTOP
0
XTSTOP
1
0
0
0
0
0
HIOSTOP
0
MOST8
1
MOST9
1
MOST10
1
MOST11
0
MOST13
0
MOST15
0
MOST17
0
MOST18
0
0
0
0
0
0
OSTS2
0
OSTS1
1
OsTS00
CLS
0
CSS
0
MCS
0
MCM0
1
0
0
0
0
MSTOP
0
XTSTOP
1
0
0
0
0
0
HIOSTOP
0