MS51
Nov. 28, 2019
Page
208
of 491
Rev 1.00
MS51
32K
SE
RIES
TE
CHNICAL RE
F
EREN
CE MA
N
UAL
CKEN
– Clock Enable
Register
SFR Address
Reset Value
CKSWT
97H, PAGE 0, TA protected
0011_0000 b
7
6
5
4
3
2
1
0
EXTEN[1:0]
HIRCEN
LIRCEN
-
-
-
CKSWTF
R/W
R/W
R/W
-
-
-
R
Bit
Name
Description
7:6
EXTEN[1:0]
External clock source enable
11 = External clock input via OSCIN (P30) Enabled
10 = External clock input via HXTIN (P00) Enabled
01 = External crystal 4~24 MHz Enabled
00 = external clock input is disable. P30/P00/P01 work as general purpose I/O or other
functions.
5
HIRCEN
High-speed internal oscillator 16 MHz enable
0 = The high-speed internal oscillator Disabled.
1 = The high-speed internal oscillator Enabled.
Note that once IAP is enabled by setting IAPEN (CHPCON.0), the high-speed internal 16 MHz
oscillator will be enabled automatically. The hardware will also set HIRCEN and HIRCST bits.
After IAPEN is cleared, HIRCEN and EHRCST resume the original values.
4
LIRCEN
Low speed internal oscillator 10 kHz enable
0 = The low speed internal oscillator Disabled.
1 = The low speed internal oscillator Enabled.
Note that when (1) WDT is enabled, (2) WKT is running by the clock source of the internal 10
kHz oscillator ,(3) BOD is enabled, or (4) LVR filter is enabled, a write 0 to LIRCEN will be
ignored. LIRCEN is always 1 and the internal 10 kHz oscillator is always enabled.
3:1
-
Reserved
0
CKSWTF
Clock switch fault flag
0 = The previous system clock source switch was successful.
1 = User tried to switch to an instable or disabled clock source at the previous system clock
source switch. If switching to an instable clock source, this bit remains 1 until the clock
source is stable and switching is successful.
System Clock Divider
6.2.1.6
The oscillator frequency (F
OSC
) can be divided down, by an integer, up to 1/510 by configuring a
dividing register, CKDIV, to provide the system clock (F
SYS
). This feature makes it possible to
temporarily run the MCU at a lower rate, reducing power consumption. By dividing the clock, the MCU
can retain the ability to respond to events other than those that can cause interrupts (i.e. events that
allow exiting the Idle mode) by executing its normal program at a lower rate. This can often result in
lower power consumption than in Idle mode. This can allow bypassing the oscillator start-up time in
cases where Power-down mode would otherwise be used. The value of CKDIV may be changed by
the program at any time without interrupting code execution.