37
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
MITSUBISHI MICROCOMPUTERS
38C8 Group
CLOCK GENERATING CIRCUIT
The 38C8 group has two built-in oscillation circuits: main clock XIN-
XOUT oscillation circuit and sub-clock XCIN-XCOUT oscillation circuit.
An oscillation circuit can be formed by connecting a resonator be-
tween XIN and XOUT (XCIN and XCOUT). RC oscillation is available for
XIN-XOUT.
Immediately after reset is released, the XIN-XOUT oscillation circuit
starts oscillating, and XCIN and XCOUT pins go to high impedance
state.
Main Clock
An oscillation circuit by a resonator can be formed by setting the
OSCSEL pin is set to “L” level and connecting a resonator between
XIN and XOUT. Use the circuit constants in accordance with the reso-
nator manufacturer’s recommended values. No external resistor is
needed between XIN and XOUT since a feed-back resistor exists on-
chip. To supply a clock signal externally, make the XOUT pin open in
the “L” level state of the OSCSEL pin, and supply the clock from the
XIN pin. The RC oscillation circuit can be formed by setting the
OSCSEL pin to “H” level and connecting a resistor between the XIN
pin and the XOUT pin. At this time, the feed-back resistor is cut off.
The frequency of the RC oscillation changes owing to a parasitic
capacitance or the wiring length etc. of the printed circuit board. Do
not use the RC oscillation in the usage which the frequency accuracy
of the main clock is needed.
Sub-clock
Connect a resonator between XCIN and XCOUT. An external feed-
back resistor is needed between XCIN and XCOUT since a feed-back
resistor does not exist on-chip. The sub-clock XCIN-XCOUT oscillation
circuit cannot directly input clocks that are externally generated. Ac-
cordingly, be sure to cause an external resonator to oscillate.
Frequency Control
(1) Middle-speed Mode
The internal clock
φ is the frequency of XIN divided by 8. After reset is
released, this mode is selected.
(2) High-speed Mode
The internal clock
φ is the frequency of XIN divided by 2.
(3) Low-speed Mode
The internal clock
φ is the frequency of XCIN divided by 2.
A low-power consumption operation can be realized by stopping the
main clock XIN in this mode. To stop the main clock, set bit 5 of the
CPU mode register to “1”. When the main clock XIN is restarted, set
enough time for oscillation to stabilize by programming.
sNotes on clock generating circuit
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 after power on
and at returning from stop mode. When switching the mode between
middle/high-speed and low-speed, set the frequency on condition
that f(XIN) > 3f(XCIN).
Oscillation Control
(1) Stop Mode
If the STP instruction is executed, the internal clock
φ stops at an “H”
level, and XIN and XCIN oscillators stop. Timer 1 is set to “FF16” and
timer 2 is set to “0116.”
Either XIN divided by 16 or XCIN divided by 16 is input to timer 1 as
count source, and the output of timer 1 is connected to timer 2. The
bits except bit 4 of the timer 123 mode register are cleared to “0.” Set
the interrupt enable bits of timer 1 and timer 2 to disabled (“0”) before
executing the STP instruction.
Oscillator restarts at reset or when an external interrupt is received,
but the internal clock
φ is not supplied to the CPU until timer 2
underflows. This allows time for the clock circuit oscillation to stabi-
lize.
(2) Wait Mode
If the WIT instruction is executed, the internal clock
φ stops at an “H”
level. The states of XIN and XCIN are the same as the state before
executing the WIT instruction. The internal clock
φ restarts at reset
or when an interrupt is received. Since the oscillator does not stop,
normal operation can be started immediately after the clock is re-
started.
Fig. 36 RC oscillation circuit
Fig. 37 Resonator circuit
CCIN
Rf
Rd
XCIN
XCOUT OSCSEL
XIN
XOUT
Rosc
XCIN XCOUT
OSCSELXIN
XOUT
CIN
COUT
CCIN
CCOUT
Rf
Rd