![](http://datasheet.mmic.net.cn/130000/ML66Q517-NGA_datasheet_5009273/ML66Q517-NGA_78.png)
ML66517 Family User’s Manual
Chapter 3
CPU Control Functions
3 – 7
(2) STOP mode
Setting the stop code acceptor (STPACP) to “1” by consecutively writing n5H, nAH (where n = 0 to F) and
then setting bit 0 (STP) of the standby control register (SBYCON) to “1” will change the mode to the STOP
mode.
In the STOP mode, the CPU and internal peripheral modules (TBC, WDT, general-purpose 8/16-bit timers,
serial ports, etc.) are halted.
Because the clock supply to the CPU is halted, instructions are not executed. Instruction execution stops at
the beginning of the next instruction (following the instruction that set bit 0 (STP) of SBYCON to “1”).
The STOP mode is released when either an interrupt occurs or input to the
RES pin causes a reset.
When the STOP mode is released due to an interrupt request, if the interrupt is non-maskable, the STOP
mode is released unconditionally, and the CPU processes the non-maskable interrupt.
In the case of a maskable interrupt, the interrupt is released if the interrupt request flag (IRQ bit) and the
interrupt enable flag (IE bit) have been set to “1”.
During the STOP mode, the following factor generates maskable interrupt requests.
Interrupt caused by input of the valid edge to an external interrupt pin (EXINT0 to EXINT3)
After the STOP mode is released, if the master interrupt enable flag (MIE in PSW) has been set to “1”,
processing of the requested maskable interrupt is performed.
If the master interrupt enable flag (MIE in PSW) has been reset to “0”, the next instruction (following the
instruction that set the STOP mode (that set bit 0 (STP) of SBYCON to “1”) is executed. However, if the
STOP mode has been set during the processing of a non-maskable interrupt routine, the STOP mode can be
released by an interrupt request. After being released, the next instruction in the non-maskable interrupt
routine (following the instruction that changed the mode to the STOP mode) will be executed. If interrupt
priority is set (bit 7 (MIPF) of EXI2CON set to “1”) and the STOP mode is set during a high priority
interrupt routine, a low priority interrupt request can release the STOP mode. However, after release the low
priority interrupt is suspended and the next instruction in the high priority interrupt routine will be executed.
If an interrupt request from the STOP mode (main clock oscillation terminated) causes the STOP mode to
be released, operation will continue after waiting for the oscillation stabilization time of the main clock
(OSCCLK) as set by SBYCON. The STOP mode can also be entered while the main clock continues to
oscillate (quick activating STOP mode). In this case, when returning from the STOP mode, activation is
possible without waiting for the oscillation stabilization time of the main clock.
Figure 3-3 shows the STOP mode timing diagram.
If the STOP mode is released by reset due to the
RES pin input, the CPU will perform the reset processing.
If the
RES pin input is to be used to release the STOP mode with main clock oscillation halted, apply a low
level to the
RES pin until the main clock oscillation stabilizes. For the Flash ROM version, apply a low
level to the
RES pin for 50 s (tentative) or more. If the clock multiplier (multiplication by 2 or by 4) is
used, apply a low level to the
RES pin until the oscillator circuit stabilizes and the clock multiplier stabilizes
(100
s, tentative).