ST6391,92,93,95,97,99
WAIT & STOP MODES
The STOP and WAIT modes have been imple-
mented in the ST639x Core in order to reduce the
consumption of the device when the latter has no
instruction to execute. These two modes are de-
scribed in the following paragraphs. On ST639x as
the hardware activated digital watchdog function is
present the STOP instruction is de-activated and
any attempt to execute it will cause the automatic
execution of a WAIT instruction.
WAIT Mode
The configuration of the MCU in the WAIT mode oc-
curs as soon as the WAIT instruction is executed.
The microcontroller can also be considered as being
in a “software frozen” state where the Core stops
processing the instructions of the routine, the con-
tents of the RAM locations and peripheral registers
are saved as long as the power supply voltage is
higher than the RAM retention voltage but where the
peripheralsare still working.
The WAIT mode is used when the user wants to re-
duce the consumption of the MCU when it is in idle,
while not losing count of time or monitoring of exter-
nal events. The oscillator is not stopped in order to
provide clock signal to the peripherals. The timers
counting may be enabled (writing the PSI bit in
TSCR register) and the timer interrupt may be also
enabled before entering the WAIT mode; this allows
the WAIT mode to be left when timer interrupt oc-
curs. If the exit from the WAIT mode is performed
with a general RESET (either from the activation of
the external pin or by watchdog reset) the MCU will
enter a normal reset procedure as described in the
RESET chapter. If an interrupt is generated during
WAIT mode the MCU behaviour depends on the
state of the ST639x Core before the initialization of
the WAIT sequence, but also of the kind of the in-
terrupt request that is generated. This case will be
described in the following paragraphs.In any case,
the ST639x Core does not generate any delay af-
ter the occurrence of the interrupt because the os-
cillator clock is still available.
STOP Mode
On ST639x the hardware watchdog is present and
the STOP instruction has been de-activated. Any
attempt to execute a STOP will cause the automat-
ic execution of a WAIT instruction.
Exit from WAIT Mode
The following paragraphs describe the output pro-
cedure of the ST639x Core from WAIT mode when
an interrupt occurs. It must be noted that the restart
sequence depends on the original state of the
MCU (normal, interrupt or non-maskable interrupt
mode) before the start of the WAIT sequence, but
also of the type of the interrupt request that is gen-
erated. In all cases the GEN bit of IOR has to be set
to 1 in order to restart from WAIT mode. Contrary
to the operation of NMI in the RUN mode, the NMI
is masked in WAIT mode if GEN=0.
Normal Mode. If the ST639x Core was in the main
routinewhen the WAIT instruction has been executed,
theST6398xCore outputsfromthewait mode as soon
as any interrupt occurs; the related interrupt routine is
executedand at the end of the interruptservice routine
the instruction that follows the WAIT instruction is exe-
cutedif no other interrupts are pending.
Non-maskable Interrupt Mode. If the WAIT in-
struction has been executed during the execution
of the non-maskable interrupt routine, the ST639x
Core outputs from the wait mode as soon as any
interrupt occurs: the instruction that follows the
WAIT instruction is executed and the ST639x Core
is still in the non-maskable interrupt mode even if
another interrupt has been generated.
Normal Interrupt Mode. If the ST639x Core was
in the interrupt mode before the initialization of the
WAIT sequence, it outputs from the wait mode as
soon as any interrupt occurs. Nevertheless, two
cases have to be considered:
– If the interrupt is a normal interrupt, the inter-
rupt routine in which the WAIT was entered will
be completed with the execution of the instruc-
tion that follows the WAIT and the ST639x
Core is still in the interrupt mode. At the end of
this routine pending interrupts will be serviced
in accordance to their priority.
– If the interrupt is a non-maskable interrupt, the
non-maskable routine is processed at first.
Then, the routine in which the WAIT was en-
tered will be completed with the execution of
the instruction that follows the WAIT and the
ST639x Core is still in the normal interrupt
mode.
Notes :
If all the interrupt sources are disabled, the restart
of the MCU can only be done by a Reset activation.
The Wait instruction is not executed if an enabled
interrupt request is pending. In the ST639x the
hardware activated digital watchdog function is
present. As the watchdog is always activated the
STOP instruction is de-activated and any attempt
to execute the STOP instruction will cause an exe-
cution of a WAIT instruction.
23/64
®