Mitsubishi microcomputers
M16C / 6N0 / 6N1 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
49
Power Control
Figure 1.10.9. Structure of the oscillation stop detection register
Oscillation stop detection register (Note 1)
Symbol
Address
When reset
CM2
000C16
0016
Bit name
Function
Bit symbol
b7
b6
b5
b4
b3
b2
b1
b0
CM20
CM21
Main clock source
select bit (Note 3)
CM22
CM23
CM27
Oscillation stop detection
0: The function is disabled
1: The function is enabled
0: Select XIN
1: Select ring oscillator
0: Invalid
1: Oscillation stop has been detected
0: XIN is in operation
0: Issue internal reset
1: Invalid
1: Switch to ring oscillators and
request an interrupt
interrupt request bit (Note 4)
Oscillation stop
detection bit (Note 2)
Clock monitor bit (Note 5)
W
R
Reserved bits
Must be set to "0"
Action selection on
stop detection (Note 5)
Note 1: Set bit 0 of the protect register to "1" before writing to this register.
Note 2: Not valid during wait mode with disabled peripheral clocks (CM02 = "1"), main clock
stop (CM10 = "1"), or if the ring oscillator is selected manually (CM21 = "1").
Note 3: If CM07 = "1", the selection of XCIN takes precedence over fRING.
Note 4: CM22 may be reset but not set
Note 5: Valid when CM20 = "1".
00 0
Oscillation Stop Detection Bit (CM20)
The oscillation stop detection is activated by setting CM20 to "1".
Set this bit to "0" before entering the stop mode. When returning from stop mode, the external oscillator
may be unstable for a period of time. The detection may be enabled again after returning from stop mode.
Set this bit to "0" also before setting main clock stop bit (bit 5 at address 000616).
Do not enable the detection function if XIN is lower than 2MHz.
Main Clock Source Selection Bit (CM21)
The internal ring oscillator may be selected as the main clock source independently of the oscillation stop
detection by setting this bit to "1". The division ratio of the ring oscillator, like that of XIN, is governed by
CM06, CM16, and CM17. Note that the selection of the sub clock (XCIN) takes precedence over the ring
oscillator selection.
Switching to fRING manually disables the oscillation stop detection regardless of CM20.
Oscillation Stop Detection Interrupt Request Bit (CM22)
This bit signals an oscillation stop detection interrupt. The oscillation stop/restart detection and the watch-
dog timer share an interrupt request line. The interrupt service routine can determine which unit re-
quested the interrupt by sampling this bit. Whe an oscillation stop is detected, this bit goes high. It has to
be reset manually during interrupt servicing.
See also Figure 1.10.10.