Datasheet
Section 5 Clock Pulse Generator
Rev. 3.00 Sep. 10, 2007 Page 80 of 528
REJ09B0216-0300
External oscillation starts to be enabled when pins
PC1 and PC0 are specified as external clock pins.
Write 0 to bit PMRC1 to input the external clock.
The external oscillator halt detecting circuit is
enabled when the external oscillation backup
function is enabled. Since this detecting circuit
operates on the on-chip oscillator clock, do not set
the on-chip oscillator to standby mode by using the
RCSTP bit in RCCR.
An interrupt to switch from the on-chip oscillator
clock to the external oscillator is enabled.
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 STS[2:0] in SYSCR1. For
details, see section 6.1.1, System Control Register
1 (SYSCR1).
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. When
the oscillation settles, this LSI switches the system
clocks to the external clock. If the external oscillator
is halted, then set the clock switching interrupt
request flag.
If this LSI detects the external oscillator halt, it
switches the system clocks to the on-chip oscillator
clock, and sets the clock switching interrupt request
flag.
[1]
[2]
[3]
[4]
[5]
[6]
Yes
No
[1]
[2]
[3]
Exception handling
for clock switching
LSI operates on on-chip oscillator clock
Start (reset)
Write 1 to PMRC0 in CKCSR
Write 1 to PMRC1 in CKCSR
Write 1 to OSCBAKE in CKCSR
Clear CKSWIF in CKCSR to 0
Write 1 to CKSWIE in CKCSR
Write 1 to OSCSEL in CKCSR
Switched to
external clock? (CKSTA in
CKCSR is 1)
LSI operates on external clock
External oscillator
halt is detected*
[4]
[5]
[6]
Note: * To prevent the LSI from malfunctioning at the external oscillation halt, switching the clock source along
with the watchdog timer is highly recommended.
External
oscillator halt
is detected*
LSI operates on
on-chip oscillator clock
Figure 5.3 Flowchart of Clock Switching with Backup Function Enabled










