Renesas M16C/60 Series Hardware Manual page 79

Hide thumbs Also See for M16C/60 Series:
Table of Contents

Advertisement

Under development
This document is under development and its contents are subject to change.
M16C/6N5 Group
How to Use Oscillation Stop and Re-oscillation Detection Function
• The oscillation stop, re-oscillation detection interrupt shares the vector with the watchdog timer interrupt. If
the oscillation stop, re-oscillation detection and watchdog timer interrupts both are used, read the CM22
bit in an interrupt routine to determine which interrupt source is requesting the interrupt.
• Where the main clock re-oscillated after oscillation stop, the clock source for CPU clock and peripheral
function must be switched to the main clock in the program. Figure 1.8.14 shows the procedure to
switch the clock source from the ring oscillator to the main clock.
• Simultaneously with oscillation stop, re-oscillation detection interrupt request occurrence, the
CM22 bit becomes "1". When the CM22 bit is set at "1", oscillation stop, re-oscillation detection inter-
rupt are disabled. By setting the CM22 bit to "0" in the program, oscillation stop, re-oscillation detection
interrupt are enabled.
• If the main clock stops during low speed mode where the CM20 bit is "1", an oscillation stop, re-oscillation
detection interrupt request is generated. At the same time, the ring oscillator starts oscillating. In this
case, although the CPU clock is derived from the sub clock as it was before the interrupt occurred, the
peripheral function clocks now are derived from the ring oscillator clock.
• To enter wait mode while using the oscillation stop and re-oscillation detection function, set the CM02
bit to "0" (peripheral function clocks not turned off during wait mode).
• Since the oscillation stop and re-oscillation detection function is provided in preparation for main clock
stop due to external factors, set the CM20 bit to "0" (Oscillation stop, re-oscillation detection function
disabled) where the main clock is stopped or oscillated in the program, that is where the stop mode is
selected or the CM05 bit is altered.
• This function cannot be used if the main clock frequency is 2 MHz or less. In that case, set the CM20 bit
to "0".
Figure 1.8.14 Procedure to Switch Clock Source from Ring Oscillator to Main Clock
Rev.1.00
2003.05.30
page 65
Main clock switch
Inspect the CM23 bit
0 (Main clock oscillation)
Do this check a number of times
The main clock is confirmed to be active a number of times.
Set the CM22 bit to "0" (main clock stop,
re-oscillation not detected).
Set the CM21 bit to "0"
(main clock for the CPU clock source) (Note)
End
CM21, CM22, CM 23 bits are the CM2 register bits
Note: If the clock source for CPU clock is to be changed to PLL clock, set to
PLL operation mode after set to high-speed mode.
1 (Main clock stop)
Clock Generation Circuit

Advertisement

Table of Contents
loading

This manual is also suitable for:

M16c/6n5

Table of Contents