
UM1000
Demonstration applications
Doc ID 17964 Rev 1
The STM8L15x remains in WFI mode unless joystick
SEL
is pressed. The MCU then
exits from WFI mode, the system clock frequency is set to 16 MHz, and the application
execution resumes. The following message is displayed on the LCD screen:
Figure 21.
Exit from WFI with EXTI message
Note:
If an alarm occurs when the system is in WFE mode, it is delayed until the EXTI interrupt
wakes up the device; then all LEDs are ON and a sound is played for ~10s.
●
The RTC alarm is used to wake up the STM8L15x from WFI mode.
The LEDs blink until
SEL
is pressed from the WFI menu (see
). The system
then enters WFI mode and the following message is displayed on the LCD:
Figure 22.
WFI wait for alarm message
When the alarm time is reached, the system exits from WFI mode, the system clock
frequency is set to 16 MHz, and the application execution resumes. The message
shown in
is then displayed on the LCD screen:
Figure 23.
Exit from WFI with alarm message
3.7.3
Wait for event mode
This menu allows to put the STM8L15x in Wait for event mode (WFE). The software
executes the specific sequence of instructions required to enter WFE mode: the CPU clock
is stopped, and selected peripherals go on running.
In this demonstration, there are two ways to exit from WFE mode:
●
An external interrupt (EXTI) generated by pressing joystick
SEL
exits
the STM8L15x
from WFE mode.
The LEDs blink until
SEL
is pressed from the WFE menu (see
). The system
then enters WFE mode and the following message is displayed on the LCD:
Figure 24.
WFE wait for EXTI message
WFI Mode
Exit: EXTI
WFI Mode
Wait for ALARM
WFI Mode
Exit: RTC ALARM
Exit: EXT Event
Press SEL
www.BDTIC.com/ST