SN8P2318 Series
C-type LCD, RFC 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 49
Version 1.5
4.5 OSCM REGISTER
The OSCM register is an oscillator control register. It controls oscillator status, system mode.
0CAH
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
OSCM
0
0
0
CPUM1
CPUM0
CLKMD
STPHX
0
Read/Write
-
-
-
R/W
R/W
R/W
R/W
-
After reset
-
-
-
0
0
0
0
-
Bit 1
STPHX:
System high-speed oscillator (external high-speed oscillator and internal PLL) control bit.
0 = System high-speed oscillator free run.
1 = Disable system high-speed oscillator. System low-speed oscillator keeps running.
Bit 2
CLKMD:
System high/Low clock mode control bit.
0 = Normal (dual) mode. System clock is high-speed mode.
1 = Slow mode. System clock is low-speed mode.
Bit[4:3]
CPUM[1:0]:
CPU operating mode control bits.
00 = normal.
01 = sleep (power down) mode.
10 = green mode.
11 = reserved.
“STPHX” bit controls internal high speed PLL oscillator and external oscillator operations. When “STPHX=0”, the
external oscillator or internal high speed PLL oscillator active. When
“STPHX=1”, the external oscillator or internal high
speed PLL oscillator are disabled. The STPHX function is depend on different high clock options to do different
controls.
PLL_16M:
“STPHX=1” disables internal high speed PLL oscillator.
RC, 4M, 12M:
“STPHX=1” disables external oscillator.
4.6 SYSTEM CLOCK MEASUREMENT
The frequency of RC type oscillator can be measured from clock output pin for adjusting R and C parameters.
In high-speed RC mode (High_Clk code option = RC), the system clock signal outputs from
“FCPUO” pin. The
clock rate is instruction cycle through system pre-scaler.
In low-speed RC mode (Low_Clk code option = RC), the low-speed oscillator
’s frequency (Flosc) signal outputs
from
“FLO” pin.
The system clock also can be measured by software.
Example: Fcpu instruction cycle of external oscillator.
B0BSET
P0M.0
; Set P0.0 to be output mode for outputting Fcpu toggle signal.
@@:
B0BSET
P0.0
; Output Fcpu toggle signal in low-speed clock mode.
B0BCLR
P0.0
; Measure the Fcpu frequency by oscilloscope.
JMP
@B
Note: Do not measure the RC frequency directly from XIN pin of external high-speed RC mode and LXIN
pin of external low-speed RC mode; the probe impendence will affect the RC frequency.