M16C/62P Group (M16C/62P, M16C/62PT)
10. Clock Generation Circuit
Rev.2.41
Jan 10, 2006
Page 86 of 390
REJ09B0185-0241
Figure 10.4
CM2 Register
Oscillation Stop Detection Register
(1)
Symbol
Address
After Reset
CM2
000Ch
0X000000b
(11)
Bit Symbol
Bit Name
Function
RW
NOTES :
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
CM21
RW
CM20
RW
Oscillation Stop,
Re-Oscillation Detection
Enable Bit
(7, 9, 10,11)
0: Oscillation stop, re-oscillation detection
function disabled
1: Oscillation stop, re-oscillation detection
function enabled
0: Main clock or PLL clock
1: On-chip oscillator clock
(On-chip oscillator oscillates)
Where the CM20 bit is set to “1” (oscillation stop, re-oscillation detection function enabled), the CM27 bit is “1”
(oscillation stop, re-oscillation detection interrupt), and the CM11 bit is set to “1” (PLL clock is selected as the CPU
clock source), the CM21 bit remains unchanged even if a main clock stop is detected. When the CM22 bit is set to
“0” under these conditions, an oscillation stop, a re-oscillation detection interrupt request is generated at main clock
stop detection. Set the CM21 bit to “1” (on-chip oscillator clock) in the interrupt routine.
System Clock Select Bit 2
(2, 3, 6, 8, 11, 12)
Nothing is assigned. When w rite, set to “0”.
When read, its content is “0”.
When the CM21 bit is set to “0” (on-chip oscillator stops) and the CM05 bit is set to “1” (main clock stops), the CM06
bit is fixed to “1” (divide-by-8 mode) and the CM15 bit is fixed to “1” (drive capacity High).
Set the CM20 bit in the CM2 register to “0” (disabled) before setting the CM05 bit in the CM0 register to “1” (main clock
stops).
The CM20, CM21 and CM27 bits remain unchanged at the oscillation stop detection reset.
When the CM20 bit is set to “1” (oscillation stop, re-oscillation detection function enabled), the CM27 bit is set to “1”
(oscillation stop, re-oscillation detection interrupt), and the CPU clock source is the main clock, the CM21 bit is set to
“1” (on-chip oscillator clock) if the main clock stop is detected.
If the CM20 bit is set to “1” and the CM23 bit is set to “1” (main clock stops), do not set the CM21 bit to “0”.
Set the CM20 bit to “0” (disabled) before entering stop mode. Exit stop mode before setting the CM20 bit back to “1”
(enabled).
This bit is set to “1” w hen the main clock stop is detected and the main clock re-oscillation is detected. When this
flag changes state from “0” to “1”, an oscillation stop or a re-oscillation detection interrupt is generated. Use this bit in
an interrupt routine to determine the factors of interrupts betw een the oscillation stop and re-oscillation detection
interrupt and the w atchdog timer interrupt. This bit is set to “0” by w riting “0” in a program. (This bit remains
unchanged even if w riting “1”. Nor is it set to “0” w hen an oscillation stop or a re-oscillation detection interrupt
request is acknow ledged.)
When the CM22 bit is set to “1” and an oscillation stop or a re-oscillation is detected, an oscillation stop or a re-
oscillation detection interrupt is not generated.
Determine the main clock status by reading the CM23 bit several times in an oscillation stop or a re-oscillation
detection interrupt routine
This bit is valid w hen the CM07 bit in the CM0 register is set to “0”.
When the PM21 bit in the PM2 register is set to “1” (disable clock modification), this bit remains unchanged even if
w riting to the CM20 bit.
—
CM27
Operation Select Bit
(w hen an oscillation stop,
re-oscillation is detected)
(11)
0: Oscillation stop detection reset
1: Oscillation stop, re-oscillation detection
interrupt
RW
—
(b6)
Rew rite this register after setting the PRC0 bit in the PRCR register to “1” (w rite enable).
Set to “0”
RW
CM23
XIN Monitor Flag
(5)
0: Main clock oscillates
1: Main clock stops
RO
—
(b5-b4)
Reserved Bit
CM22
Oscillation Stop,
Re-Oscillation Detection
Flag
(4)
0: Main clock stops, re-oscillation not
detected
1: Main clock stops, re-oscillation detected
RW
0 0
b3 b2 b1 b0
b7 b6 b5 b4
http://www.xinpian.net
提供单片机解密、IC解密、芯片解密业务
010-62245566 13810019655