Rev. 1.3
137
C8051F340/1/2/3/4/5/6/7/8/9/A/B/C/D
SFR Definition 14.4. OSCXCN: External Oscillator Control
Bit7:
XTLVLD: Crystal Oscillator Valid Flag.
(Read only when XOSCMD = 11x.)
0: Crystal Oscillator is unused or not yet stable.
1: Crystal Oscillator is running and stable.
Bits6–4: XOSCMD2–0: External Oscillator Mode Bits.
00x: External Oscillator circuit off.
010: External CMOS Clock Mode.
011: External CMOS Clock Mode with divide by 2 stage.
100: RC Oscillator Mode.
101: Capacitor Oscillator Mode.
110: Crystal Oscillator Mode.
111: Crystal Oscillator Mode with divide by 2 stage.
Bit3:
RESERVED. Read = 0, Write = don't care.
Bits2–0: XFCN2–0: External Oscillator Frequency Control Bits.
000-111: See table below:
CRYSTAL MODE
(Circuit from Figure 14.1, Option 1; XOSCMD = 11x)
Choose XFCN value to match crystal or resonator frequency.
RC MODE
(Circuit from Figure 14.1, Option 2; XOSCMD = 10x)
Choose XFCN value to match frequency range:
f = 1.23(10
3
) / (R x C)
, where
f = frequency of clock in MHz
C = capacitor value in pF
R = Pull-up resistor value in k
C MODE
(Circuit from Figure 14.1, Option 3; XOSCMD = 10x)
Choose K Factor (KF) for the oscillation frequency desired:
f = KF / (C x V
DD
)
, where
f = frequency of clock in MHz
C = capacitor value the XTAL2 pin in pF
V
DD
= Power Supply on MCU in volts
R
R/W
R/W
R/W
R
R/W
R/W
R/W
Reset Value
XTLVLD XOSCMD2 XOSCMD1 XOSCMD0
-
XFCN2
XFCN1
XFCN0
00000000
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
SFR Address:
0xB1
XFCN Crystal (XOSCMD = 11x)
RC (XOSCMD = 10x)
C (XOSCMD = 10x)
000
f
32 kHz
f
25 kHz
K Factor = 0.87
001
32 kHz
f
84kHz
25 kHz
f
50 kHz
K Factor = 2.6
010
84 kHz
f
225 kHz
50 kHz
f
100 kHz
K Factor = 7.7
011
225 kHz
f
590 kHz
100 kHz
f
200 kHz
K Factor = 22
100
590 kHz
f
1.5 MHz
200 kHz
f
400 kHz
K Factor = 65
101
1.5 MHz
f
4 MHz
400 kHz
f
800 kHz
K Factor = 180
110
4 MHz
f
10 MHz
800 kHz
f
1.6 MHz
K Factor = 664
111
10 MHz
f
30 MHz
1.6 MHz
f
3.2 MHz
K Factor = 1590