September 2010 Doc ID 17904 Rev 1 1/19
AN3269
Application note
Introduction to STM8L15x power saving modes
using the STM8L-DISCOVERY I
DD
measurement feature
Introduction
This application note introduces some of the power saving modes available in the STM8L
microcontroller family. The STM8L-DISCOVERY has a built-in I
DD
measurement feature that
is used to demonstrate the real capabilities of the STM8L15x microcontroller’s low power
modes.
This application does not require any additional hardware. Once the STM8L-DISCOVERY is
powered-up through a USB cable connected to the host PC, the application is ready to
dynamically display the STM8L power consumption in each of the different modes selected
by the user.
This software example comes preloaded with your STM8L-DISCOVERY and is readily
accessible at application power-up.
Reference documents
STM8L-DISCOVERY evaluation board user manual (UM0970)
STM8L-DISCOVERY software user manual Developing and debugging your STM8L-
DISCOVERY application code (UM0991)
Application note STM8L family power management (AN3147)
The above documents are available at http://www.st.com.
www.st.com
Contents AN3269
2/19 Doc ID 17904 Rev 1
Contents
1 Application description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1 Hardware required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 STM8L-DISCOVERY hardware settings . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Application schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 Application principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4.2 I
DD
measurement principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5 Getting started with the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5.1 Demo mode (I
DD
measurement) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5.2 Bias current record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.5.3 Manufacturing test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.6 Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2 Software description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1 STM8L peripherals used by the application . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 STM8L15x standard firmware library configuration . . . . . . . . . . . . . . . . . 11
2.3 Application software flowcharts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3.1 Main application flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3.2 Demo mode (I
DD
measurement) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18