
Demonstration applications
UM1000
Doc ID 17964 Rev 1
3.7.5 Halt
mode
This menu allows to put the STM8L15x in Halt mode. The software performs the specific
sequence of instructions required to enter Halt mode: the CPU and peripheral clocks are
stopped, and the device remains powered on.
In this demonstration, there are two ways to exit from halt mode:
●
An external interrupt (EXTI) generated by pressing
SEL
on the joystick exits the
STM8L15x from halt mode:
The LEDs blink until
SEL
is pressed from Halt menu. The system then enters halt
mode and the following message is displayed on the LCD:
Figure 32.
Halt wait for EXTI message
The STM8L15x remains in Halt mode unless the
SEL
button is pressed. The MCU then
exits from Halt mode, the system clock is set to 16 MHz, and the application execution
resumes. The following message is displayed on the LCD:
Figure 33.
Exit from Halt with EXTI message
●
A Comparator 1 interrupt can also exit the STM8L15x from Halt mode
This interrupt is generated when the non inverting input exceeds the internal reference
voltage.
The LEDs blink until
SEL
is pressed from the Halt menu (see
). The system
then enters Halt mode and the following message is displayed on the LCD:
Figure 34.
Halt wait for comparator interrupt message
When Comparator 1 non inverting input exceeds the internal reference voltage, the
system exits from Halt mode, and the application execution resumes. The message
shown in
is then displayed on the LCD screen:
Figure 35.
Exit from Halt with comparator interrupt message
Exit: EXTI
Press SEL
Halt mode
Exit: EXTI
Exit:COMP Int.
Rotate RV3
HALT mode
Exit: COMP Int.
www.BDTIC.com/ST