Using The Oscillator Stop/Restart Detect Function; Interrupt - Renesas M16C/64C User Manual

Table of Contents

Advertisement

M16C/64C Group
8.7.3

Using the Oscillator Stop/Restart Detect Function

After oscillator stop is detected, if the main clock reoscillates, set the main clock back to the clock
source for the CPU clock and peripheral functions by a program. Figure 8.6 shows the Switching from
On-Chip Oscillator Clock to Main Clock.
Main clock stopped
Figure 8.6
Switching from On-Chip Oscillator Clock to Main Clock
The CM22 bit becomes 1 at the same time an oscillator stop/restart detect interrupt is generated. When
the CM22 bit is 1, the oscillator stop/restart detect interrupt is disabled. When setting the CM22 bit to 0
by a program, the oscillator stop/restart detect interrupt is enabled.
8.8

Interrupt

The oscillator stop/restart detect interrupt is a non-maskable interrupt.
The watchdog timer interrupt, oscillator stop/restart detect interrupt, voltage monitor 1 interrupt, and
voltage monitor 2 interrupt share the same vector. When using multiple interrupts together, read the
detect flags of the events in the interrupt processing program, and determine the source of the interrupt.
The detect flag for oscillator stop/restart detect is the CM22 bit in the CM2 register. After the interrupt
source is determined, set the CM22 bit to 0 (not detected).
R01UH0092EJ0110 Rev.1.10
Jul 31, 2012
Switch the main clock
Check several times whether
the CM23 bit is 0
(main clock oscillates)
Main clock oscillating
Set the CM06 bit to 1
(divide-by-8)
Set the CM22 bit to 0
(main clock stop/restart not detected)
Set the CM21 bit to 0
(main clock or PLL clock)
End
CM06
: Bit in the CM0 register
CM21 to CM23
: Bits in the CM2 register
8. Clock Generator
Page 105 of 807

Advertisement

Table of Contents
loading

This manual is also suitable for:

M16c/60 seriesM16c series

Table of Contents