AN3269
Application note
Introduction to STM8L15x power saving modes using the STM8L-DISCOVERY IDD 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 IDD 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 STM8LDISCOVERY application code (UM0991)
■Application note STM8L family power management (AN3147)
The above documents are available at http://www.st.com.
September 2010 |
Doc ID 17904 Rev 1 |
1/19 |
www.st.com
Contents |
AN3269 |
|
|
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 IDD measurement principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5 Getting started with the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5.1 Demo mode (IDD 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 (IDD measurement) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3 |
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
17 |
4 |
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
18 |
2/19 |
Doc ID 17904 Rev 1 |
AN3269 |
List of tables |
|
|
List of tables
Table 1. Bars and LCD display linked to functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Table 2. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Doc ID 17904 Rev 1 |
3/19 |
List of figures |
AN3269 |
|
|
List of figures
Figure 1. Application schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Figure 2. IDD measurement equivalent circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Figure 3. Function Change state diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 4. Main application flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Figure 5. Demo mode sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Figure 6. Measurement and display flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Figure 7. Low power run mode flowchart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Figure 8. Halt mode flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4/19 |
Doc ID 17904 Rev 1 |
AN3269 |
Application description |
|
|
This application uses the STM8L-DISCOVERY on-board LEDs (green LD3 and blue LD4), the 6-digit/4-bar LCD glass display and the user push-button. No additional components are required.
1.2STM8L-DISCOVERY hardware settings
The IDD jumper JP1 must be placed in position ON for standard operation (except for bias current record operation, see Section 1.5.2).
Note: |
All solder bridges SB11 to SB17 must be shorted (bottom side of STM8L-DISCOVERY). |
Figure 1 shows the application electrical schematics.
|
)$$$MEASUREMENTSCIRCUITRY |
|
||
|
0& |
0% |
0# |
|
|
|
|
|
6$$ |
|
|
|
|
2 |
|
0% |
|
|
KȰ |
|
|
|
|
|
|
|
|
|
0# |
2 |
34-, # 4 |
5SER PUSH BUTTON |
||
|
||||
Ȱ |
# |
|||
|
|
|
|
N& |
,$ |
|
|
|
|
'REEN |
0# |
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
Ȱ |
|
|
|
,$ |
|
,#$#CONTROLLER |
|
|
"LUE |
|
|
||
|
|
|
|
|
|
|
|
,#$#/-; = |
|
|
|
|
,#$3%'; = |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"!2 |
|
|
|
,#$ |
|
AI |
Doc ID 17904 Rev 1 |
5/19 |
Application description |
AN3269 |
|
|
STM8L-DISCOVERY includes specific analog and logic hardware that is connected to STM8L152 microcontroller and which is intended to measure and display the supply IDD current when the device is placed in different power consumption modes such as:
●Run mode
●LPR (Low power run mode) with LCD display ON
●LPR (Low power run mode) with LCD display OFF
●Halt mode
The user reads the value displayed on the STM8L-DISCOVERY’s LCD panel, to know how much power the device is currently consuming.
With this demonstration, you can obtain a precise and dynamic measurement of the STM8L152 supply current depending on the low power mode used.
It also includes a manufacturing test mode for performing a quick diagnosis of the STM8LDISCOVERY related to this application example. See Section 1.5.3: Manufacturing test to have details regarding the test activation and meaning.
1.4.2IDD measurement principle
The STM8L-DISCOVERY IDD measurement circuitry consists of measuring precisely the voltage value V at the terminals of a high precision serial resistor (1%) inserted between the +3V3 power supply and the VDD pin of the MCU. Depending of the device power modes, the application uses R or [1000 + 1] x R as the equivalent resistor value by closing or opening K1. In Run mode, the current is in the range of mA, K1 is closed, and the equivalent resistor is R. In low power modes, the current is in the range of µA, K1 is opened, and the equivalent resistor is 1001 x R.
|
|
|
6 |
|
|
|
|
|
|
)$$ |
|
|
|
|
2 |
|
'AIN |
|
|
|
|
||
|
|
|
|
6 |
! |
|
|
+ |
2 |
|
3 |
|
|
# |
|||
|
|
|
|||
|
|
|
|
|
|
1 |
1 |
|
6$$ |
|
|
|
|
|
|
||
|
|
|
|
0& |
|
|
|
|
|
)$$$MEAS |
|
#OUNTER |
|
34- , X |
6 |
||
|
|
|
+ |
||
|
|
|
|
0% |
|
|
|
|
|
|
|
|
%. |
|
0# |
,0 WAKE UP |
|
|
|
|
'.$ |
|
|
|
|
|
|
|
AI |
This resistor is placed in parallel to a high sense operational amplifier (A) with fixed gain that amplifies the voltage (V) present on resistors. A sample and hold stage is placed behind and
6/19 |
Doc ID 17904 Rev 1 |