![](http://datasheet.mmic.net.cn/30000/M37512F8H-XXXHP_datasheet_2359813/M37512F8H-XXXHP_55.png)
Feb 18, 2005
page 53 of 85
REJ03B0122-0101
7512 Group
CLOCK GENERATING CIRCUIT
The 7512Group has four built-in oscillation circuits. Built-in oscil-
lation circuit about 4MHz oscillation, or an oscillation circuit can be
formed by connecting a resonator between XIN and XOUT for high
speed oscillation, and an oscillation circuit can be formed by con-
necting capacitor and resistor, or resonator between XCIN and
XCOUT for low speed oscillation. The oscillation source (built-in os-
cillation or XIN-XOUT oscillation) can be controlled by setting clock
source switch bit (CPU mode register) and high-speed RC oscilla-
tion stop bit (MISRG2) and XIN switching inhibit bit(MISREG2).
Immediately after power on, only the built-in oscillation circuit
starts oscillation. In case of using XIN-XOUT oscillation circuit,
change the clock source bit after start the XIN-XOUT oscillation set-
ting the main clock (XIN -XOUT) stop bit (CPU mode register).
In case of not using XIN -XOUT oscillation circuit, XIN pin and XOUT
pin must be open.
Setting the XIN switching inhibit bit "1" (disable switch to XIN),
clock source switch bit become invalid, and XIN-XOUT oscillation
circuit becomes disabled since. When this bit is set to "1", it can-
not be rewritten to "0" by program.
Setting the port Xc switch bit (CPU mode register) "1", 32kHz RC
oscillation circuit or XCIN-XCOUT oscillation circuit starts oscilla-
tion. The selection of 32kHz RC oscillation circuit or XcIN-XCOUT
oscillation circuit is selected by 32kHz RC oscillation enable bit
(MISRG2).
In case of using external resonator, connect resonator to XIN pin
and XOUT pin (XCIN pin and XCOUT pin). Use the circuit constants
in accordance with the resonator manufacturer’s recommended
values. No external resistor is needed between XIN and XOUT
since a feed-back resistor exists on-chip.(An external feed-back
resistor may be needed depending on conditions.) However, an
external feed-back resistor is needed between XCIN and XCOUT.
After reset, XCIN and XCOUT pins function as I/O ports.
Frequency Control
(1) Middle-speed mode
The internal clock
φ is the frequency of high-speed RC oscillation
clock or XIN divided by 8. After reset, this mode is selected.
(2) High-speed mode
The internal clock
φ is half the frequency of XIN.
(3) Low-speed mode
The internal clock
φ is half the frequency of high-speed RC oscil-
lation clock or XCIN.
sNote
If you switch the mode between middle/high-speed and low-
speed, stabilize both XIN and XCIN oscillations. The sufficient time
is required for the sub-clock to stabilize, especially immediately af-
ter power on and at returning from the stop mode. When switching
the mode between middle/high-speed and low-speed, set the fre-
quency on condition that f(XIN) > 3f(XCIN).
(4) Low power dissipation mode
The low power consumption operation can be realized by stopping
the main clock XIN in low-speed mode. To stop the main clock, set
bit 5 of the CPU mode register to “1”. When the main clock XIN is
restarted (by setting the main clock stop bit to “0”), set sufficient
time for oscillation to stabilize.
The sub-clock XCIN-XCOUT oscillating circuit can not directly input
clocks that are generated externally. Accordingly, make sure to
cause an external resonator to oscillate.
32kHz RC oscillation circuit
Setting the port Xc switch bit "1" after setting the 32kHz RC oscil-
lation enable bit "1", the built-in 32kHz RC oscillation circuit starts
oscillation. In case of using 32kHz RC oscillation circuit, connect
91k
resistor between XCIN-XCOUT, and connect 100pF capaci-
tor between XCIN and GND.
Setting appropriate value to the 32kHz oscillation circuit control
register0,1 it is possible to adjust the frequency error cause by
evenness of resistor and capacitor value .
The resistor ladder divided by 512 adjusts the frequency, and it
makes possible about 50Hz step adjustment.
The theoretical frequency is calculated as follow.
1
f32KRC =
2RCln(1+2R1/R2)
Calibration for High-speed RC oscillation
circuit
Setting the high-speed RC oscillation circuit calibration enable bit
"1", built-in counter starts count the clock which is divided the fre-
quency of the high-speed RC oscillation output by 1/2 for four
cycles period of 32kHz RC oscillation clock, and high-speed RC
oscillation frequency can be measured.
The built-in counter is 9bit counter and lower 8bit count value is
stored in the high-speed RC oscillation circuit frequency counter
(0FF316) and higher 1bit is stored in bit 0 of high-speed RC oscil-
lation circuit control register (0FF416).
Renewing the high-speed RC oscillation frequency set up register
(0FF216), oscillation frequency is altered. High-speed RC oscilla-
tion circuit frequency may change cause of change of VCC or
operating, temperature, but adjusting the high-speed oscillation
frequency set up register by software, oscillating frequency can be
kept fixed.
After power on, built-in high-speed RC oscillation starts the oscil-
lation at about 4MHZ.