Datasheet

Section 5 Clock Pulse Generators
Rev. 1.50 Sep. 18, 2007 Page 78 of 584
REJ09B0240-0150
5.3.2 Clock Control Operation
Figure 5.3 shows the flowchart to switch clock sources from the on-chip oscillator to the external
clock. Figure 5.4 shows the flowchart to switch clock sources from the external clock to the on-
chip oscillator.
Yes
No
[1]
[2]
LSI operates on on-chip oscillator clock
Start (reset)
Write 1 to PMRC0 in CKCSR
Write 1 to PMRC1 in CKCSR
Clear CKSWIF in CKCSR to 0
Write 1 to OSCSEL in CKCSR
Switched to
external clock? (CKSTA in
CKCSR is 1)
LSI operates on external clock
[3]
External oscillation starts to be enabled when pins
PJ0/OSC1 and PJ1/OSC2 are specified as external
clock pins. Write 0 to bit PMRJ1 to input the external
clock.
After writing 1 to the OSCSEL bit, this LSI waits until the
oscillation of the external oscillator settles. The
correspondence between Nwait, which is the number of
wait cycles for oscillation settling, and Nstby, which is
the number of wait cycles for oscillation settling when
returning from standby mode, is as follows:
Nstby Nwait 2 × Nstby
Nstby is set by bits STS2 to STS0 in SYSCR1 and bit
STS3 in SYSCR3. For details, see section 6.1.1, System
Control Register 1 (SYSCR1), and section 6.1.3,
System Control Register 3 (SYSCR3).
While waiting for external oscillation settling, this LSI is
not halted but continues to operate on the on-chip
oscillator clock. Read the CKSTA bit in CKCSR to
ensure whether or not clocks are switched.
[1]
[2]
[3]
Figure 5.3 Flowchart of Clock Switching
(From On-Chip Oscillator Clock to External Clock)