R01UH0092EJ0110 Rev.1.10
Page 91 of 807
Jul 31, 2012
M16C/64C Group
8. Clock Generator
8.2.4
Oscillation Stop Detection Register (CM2)
Set the PRC0 bit in the PRCR register to 1 (write enabled) before rewriting this register.
Bits CM20, CM21, and CM27 do not change at oscillator stop detect reset.
See Table 9.3 “Clock-Related Bit Setting and Modes” to select a clock and a mode.
CM20 (Oscillator stop/restart detect enable bit) (b0)
Set the CM20 bit to 0 (oscillator stop/restart detect function disabled) to enter stop mode. Set the CM20
bit back to 1 (enabled) after exiting stop mode.
When the PM21 bit in the PM2 register is 1 (clock change disabled), the CM20 bit remains unchanged
even when being written.
CM21 (System clock select bit 2) (b1)
When the CM07 bit is 0 (main clock, PLL clock, or on-chip oscillator clock used as CPU clock source),
the CPU clock source and the peripheral function clock f1 can be selected by the CM21 bit. When the
CM07 bit is 1 (sub clock used as CPU clock source), the peripheral function clock f1 can be selected by
the CM21 bit.
When the CM20 bit is 1 (oscillator stop/restart detect function enabled) and the CM23 bit is 1 (main
clock stopped), do not set the CM21 bit to 0 (main clock or PLL clock).
When the CM20 bit is 1 (oscillator stop/restart detect function enabled), the CM27 bit is 1 (oscillator
stop/restart detect interrupt), and the main clock is used as a CPU clock source, the CM21 bit becomes
1 (on-chip oscillator clock) if the main clock stop is detected. Refer to 8.7 “Oscillator Stop/Restart Detect
Function” for details.
b7
0
0
b6 b5 b4
b1
b2
b3
Oscillation Stop Detection Register
Symbol
CM2
Address
000Ch
Bit Symbol
Bit Name
RW
Reset Value
0X00 0010b
b0
Function
CM20
Oscillator stop/restart detect
enable bit
0: Oscillator stop/restart detect function
disabled
1: Oscillator stop/restart detect function
enabled
RW
CM21
System clock select bit 2
RW
0: Main clock
1: On-chip oscillator clock
CM22
Oscillator stop/restart detect
flag
RW
0: Main clock stop/restart not detected
1: Main clock stop/restart detected
CM23
XIN monitor flag
RO
0: Main clock oscillating
1: Main clock stopped
—
(b5-b4)
Reserved bits
Set to 0
RW
—
(b6)
No register bit. If necessary, set to 0. The read value is undefined.
—
CM27
Operation select bit
(when an oscillator stop/restart
is detected)
0: Oscillator stop detect reset
1: Oscillator stop/restart detect interrupt
RW
or PLL clock
Содержание M16C Series
Страница 846: ...M16C 64C Group R01UH0092EJ0110...