Home

STM32L-DISCOVERY: current consumption

image

Contents

1. Ti AN3413 YZ Application note STM32L DISCOVERY current consumption measurement and touch sensing demonstration July 2011 Introduction This application note provides an overview of the demonstration firmware delivered with the STM32L DISCOVERY evaluation board It allows you to explore the rich set of power saving modes available in the STM32L microcontroller by using the STM32L DISCOVERY embedded IDD measurement circuit that is used to demonstrate the real capabilities of the ultra low power microcontroller STM32L The demonstration application does not require any additional hardware Once the STM32L DISCOVERY is powered up through a USB cable connected to the host PC the application is ready to display the STM32L power consumption of each low power modes selected by the user In addition the demonstration firmware allow you to explore touch sensing capabilities of STM32L microcontroller demonstrated by sensing of linear touch sensor or set of four touchkeys Reference documents m STM32L DISCOVERY evaluation board user manual UM1079 m STM32L151xx and STM32L152xx Flash and EEPROM programming PM0062 The above documents are available at http www st com Doc ID 018933 Rev 1 1 18 www st com Contents AN3413 Contents 1 Application description 000 cee eee ee 3 1 1 Used hardware components 0 02 eee eee eee 3 1 2 STM32L DISCOVERY hardware settings 0000 eee eee 3 1 3 Applica
2. depending on the selected power saving mode When the device enters low power run mode MSI is switched OFF and LSE acts as the main clock source until the device is woken up by an external event When exiting Low power run mode the MCU switches the MSI oscillator back ON LSE is switched ON during Manufacturing test mode see Section 1 5 3 to check its functionality Doc ID 018933 Rev 1 ky AN3413 Software description 2 2 STM32L15x standard firmware library configuration The stm32M xx_conf h file of the STM32L standard firmware library allows you to configure the library by enabling the peripheral functions used by the application The header files of library modules are included in the stm32 1 xx_conf h file as listed bellow include stm32I1xx_adc h include stm32I1xx_exti h include stm32I1xx_flash h include stm32l1xx_gpio h include stm32I1xx_syscfg h include stm32I1xx_lIcd h include stm3211xx_pwr h include stm32I1xx_rcc h include stm32I1xx_rtc h include misc h The corresponding library modules has to be present in the project for successful compilation and linking 2 3 Application software flow 2 3 1 Main application After powering up the STM32L DISCOVERY the initialization of the peripherals and LCD display is performed and then the application immediately checks whether the USER push button is pressed If pressed then the application goes to the Bias current record operation Otherwise Demo mode Ipp measurement is
3. test function the application displays OK and the measured values when available If all checks are successfully completed then the message TEST OK is continuously displayed If one of the tests fails then the application alerts the user by continuously displaying the test name followed by NO OK To exit this manufacturing test press the RESET button Generally if the manufacturing test is not successful first check that JP1 is placed in the ON position and that all solder bridges are in default position If errors are found in the Low power and Halt modes Ipp measurements the bias current record operation should be performed again Doc ID 018933 Rev 1 ky AN3413 Application description 1 6 Low power modes The low power modes used in this application are listed below The microcontroller can be woken up from any power saving mode by an external wake up event generated by counter U3 Sleep mode The CPU is stopped the peripherals kept running The system is clocked by the MSI oscillator at a frequency of 4 MHz Low power run mode The CPU and some of the peripherals are running During Low power run mode the code is executed from RAM and the CPU is clocked at a frequency of 32 kHz by the MSI oscillator Flash and data EEPROM are stopped and the voltage regulator is configured in Ultra low power mode Low power sleep mode The CPU is stopped The system clock frequency is reduced to 32 kHz Flash a
4. DD meas Counter nL STM32L15x PAO EN PC13 LP wake up MS19811V1 This resistor is connected between the differential inputs of a high side current sense operational amplifier A with a fixed gain that amplifies the voltage V present on the resistors A sample and hold stage is placed at the operational amplifier output and is then connected to an analog input of the MCU PA4 Ipp Measurement that finally converts the resulting voltage image of the consumption current In low power modes only a counter enabled by STM32L15x PC13 pin manages the measurement timing while the microcontroller is idle The microcontroller is woken up after a 150 ms delay when the rising edge is triggered on a wake up pin PAO controlled by the K2 switch While the microcontroller is in one of the power saving modes a capacitor C is charged with the voltage amplified by the operational amplifier The microcontroller can later sample during its wake up phase 50 ms the value of capacitor voltage proportional to the current consumption of MCU in low power mode Switch S is opened at device start up in order to keep the charge collected in capacitor C intact while the microcontroller is in low power mode The current measurement precision is enhanced by taking into account the current bias of high side current operational amplifier When JP1 is placed in OFF position lpp measurement circuitry disabled a special test invoked by the user at dev
5. andby mode flowchart START LCD disabled RTC disabled Disable clock sources System clock to MSI 32 kHz Configure wake up pin Regulator Ultra low power mode GPIO Low power config v Enable external counter U3 y Enter Standby mode YES Reset Standby flag Ot Measure Standby current Continue MS19817V1 lbp measurement and display The following flowchart describes the Ipp measurement process Doc ID 018933 Rev 1 4 AN3413 Software description Figure 7 Measurement and display flowchart START IDD measurement amp display y Disable interrupts ADC init y nversion 4 times YES y Disable external counter U3 y7 Disable ADC peripheral y Perform average display on LCD measured current MS19815V1 As shown in Figure 7 the ADC conversion is performed 4 times in succession and an average value is computed The averaged value is displayed on the LCD 2 Doc ID 018933 Rev 1 15 18 Conclusion AN3413 3 Conclusion This application note shows the demonstration firmware delivered with your STM32L DISCOVERY kit This example allows you to evaluate the touch sensing capability of STM32L1xx microcontrollers and demonstrate its ultra low power features by providing the measured current consumption values in selected low p
6. automatically selected If during Demo mode the user presses the USER key for more than 3 seconds then the application enters manufacturing test To exit manufacturing test the application needs to be restarted by pressing the RESET button 2 3 2 Demo mode Ipp measurement When Demo mode is launched it starts displaying a welcome message and then after a few seconds the Vpp value The user then selects one of the Ipp measurement functions by pressing successively on the USER pushbutton as described in Section 1 5 1 These functions are mainly divided in 2 steps e Configuring the device according to the selected power mode Ibp measurement and display this part is common for all power modes The Demo mode sequence is as follows Doc ID 018933 Rev 1 11 18 Software description AN3413 12 18 Figure 4 Demo mode sequence START Demo mode IDD measurement i EDADA nae q777 L We i l Run mode LP Run Stop RTC ON Standby Configuration Sleep Mode LP Sleep Stop RTC OFF steps I I l l lasc Lss t1 ae EEREN J J IDD measurement amp display END MS19814V1 Low power modes configuration For Ipp measurement in Run mode there is no particular setup needed other that performed during the STM32L1xx power on initialization For this function the application goes directly to Ipp measurement and display routine The configuration of device for Low power run Sleep Sto
7. dware settings The Ipp jumper JP1 must be placed in position ON for standard operation except for bias current record operation see Section 1 5 2 Both jumpers on CN3 must be fitted to allow communication of STM32L15x with ST Link debugging tool thru SWD interface Note All solder bridges must be in the default state as described in UM1079 1 3 Application schematics Figure 1 shows the simplified application electrical schematics Figure 1 Application schematics IDD measurement circuitry VDD User push button C25 I Touch sensing linear sensor PA4 PAO PC13 STM32L152RBT6 LD4 PBO 1 PC4 5 Blue LCD controller PAG 7 a LCDCOM 3 0 LCDSEG 23 0 BERRAR ING GUNS INEN IAN LCD MS19810V1 ky Doc ID 018933 Rev 1 3 18 Application description AN3413 1 4 1 4 1 1 4 2 4 18 Application principle Overview STM32L DISCOVERY includes specific analog and logic hardware that is connected to STM32L152 microcontroller and which is intended to measure and display the supply Ipp current when the device is placed in different power consumption modes such as Run mode Sleep mode Low power run mode Low power sleep mode Stop mode with operating RTC Stop mode without RTC Standby mode The user reads the value displayed on the STM32L DISCOVERY s LCD panel to know how much power the device is currently consuming With this demonstration you can obtain an overview of low
8. functions as described in the state diagram in Figure 3 The first step is a demonstration of the linear touch sensor function followed by a touchkey demo activated by pressing the user button When the used push button is pressed again the power consumption measurement functions are launched These functions consist of configuring the device for each low power consumption mode and then measuring and displaying the result on the LCD panel Doc ID 018933 Rev 1 ky AN3413 Application description Figure 3 Function Change state diagram reset STANDBY IDD TOUCH LINEAR SENSOR User button pressed LPRUN LPSLEEP IDD MS19812V1 BARO to BAR3 are used by the application to indicate ongoing measurements as shown in Table 1 In order to save power during the Ipp measurement in Stop mode without LCD the LCD is switched off Once the measurement is performed the LCD is switched on to display the power consumption value Table 1 Bars and LCD display linked to functions Function Bars VDD Linear sensor Touch buttons Run mode Sleep mode Low power run Low power sleep Doc ID 018933 Rev 1 Application description AN3413 1 5 2 1 5 3 Note 8 18 Table 1 Bars and LCD display linked to functions continued Function Bars STOP STOP without LCD STANDBY mode Bias current record This operation consists of stor
9. ice start up measures this current value and stores it in the non volatile memory Once this value is stored in the device it is deducted from the next Ipp measurement to compensate errors due to I bias current see Section 1 5 2 Bias current record ky Doc ID 018933 Rev 1 5 18 Application description AN3413 1 5 1 5 1 6 18 For additional information related to the Ipp measurement feature please refer to STM32L DISCOVERY evaluation board user manual UM1079 Getting started with the application This STM32L DISCOVERY example application has 3 application modes that can be run Demo mode touch sensor Ipp measurement e Bias current record e Manufacturing test Demo mode is available at application power up while the two others are invoked by the user using a specific procedure that is described in detail later in this chapter However for best performance it is recommended to measure and record the bias current before starting evaluation of low power mode Ipp current Demo mode Touch sensing demonstration and Ipp measurement Once the application is powered up via the USB cable or by external power supply it starts displaying a welcome message and then after a few seconds the value of the Vpp voltage applied to the STM32L device LD3 green LED and LD4 blue LED blink alternately As soon as Ipp consumption values are displayed both LEDs are turned off The User push button allows you to change the
10. ies Information in this document supersedes and replaces all information previously supplied The ST logo is a registered trademark of STMicroelectronics All other names are the property of their respective owners 2011 STMicroelectronics All rights reserved STMicroelectronics group of companies Australia Belgium Brazil Canada China Czech Republic Finland France Germany Hong Kong India Israel Italy Japan Malaysia Malta Morocco Philippines Singapore Spain Sweden Switzerland United Kingdom United States of America www st com 18 18 Doc ID 018933 Rev 1 ky
11. ing the bias current value of operational amplifier A see Figure 2 in the data memory The bias current value is taken into account for low power measurements in order to minimize measurement errors Once recorded this value is kept in non volatile memory for later use It is recommended to perform this operation when you start your evaluation in order to obtain the best precision This mode is only accessible at application power up by executing the following steps in the order below 1 Switch OFF STM32L DISCOVERY Place JP1 in OFF position Ipp measurement disabled Keep USER push button pressed while powering ON the STM32L DISCOVERY At power on a scrolling message Bias Current is displayed Release the USER push button the bias current value is displayed and immediately stored in non volatile memory af wD Once this operation completed replace JP1 in ON position so that the measurement circuitry is connected again to the STM32L152 Ipp measurement enabled Manufacturing test You can access this mode while Demo mode is running by pressing the USER push button for more than 3 seconds and by releasing it This allows you to verify that the hardware modules needed by the STM32L DISCOVERY for this example are working properly In this mode application checks the LSE oscillator Low Speed External Vpp voltage value Ipp RUN OA bias and LP low power Ipp currents The currents are tested for lower and upper limits For each
12. ling time 192 cycles SYSTICK Timer The Systick timer is used to generate the delay needed for display or wait loops GPIOs Port C and Port E are connected to the USER push button and the LEDs e PB1 set as an input floating pin with interrupt connected to the USER push button e PB7 green LD3 and PB6 blue LD4 set as an output push pull e PAO set as a wake up pin configured either as an input floating pin with interrupt with detection on rising edge or as an alternate function AFIOO WKUP1 during Standby mode e PAG PA7 PC4 PC5 PBO PB1 are used for linear touch sensor or touchkeys during the touch sensor demonstration e During the low power modes I Os are placed in analog input mode to reduce power consumption except for a few pins related to the hardware interface PB7 green LD3 PB6 blue LD4 PA4 Ipp measurement pin PAO LP WakeUp pin and PC13 IDD timer enable This means that all Schmitt triggers on unused standard I O pins are disabled to reduce power consumption LCD controller The different functions available in the firmware library for LCD are used to initialize clear display strings and scrolling messages needed in the application code For some low power mode measurements the LCD controller is turned OFF to minimize the current consumption of the STM32L152 Clock The MSI the multi speed internal oscillator oscillator is selected as clock source The application manages the peripheral clocks
13. nd Data EEPROM are in power down mode and the voltage regulator is configured in Ultra low power mode Stop mode The Core is in deepsleep mode Flash Data EEPROM and all clocks except LSE are in power down mode All peripherals except the LCD are disabled The voltage regulator is in low power mode Stop mode without LCD This is the same as Stop mode except that the LCD controller is also disabled in this case Standby mode This is the deepest low power mode The voltage regulator is disabled Core peripherals RAM Flash and Data EEPROM are powered off Power is maintained for the RTC registers backup registers and standby circuitry Device wake up is done by an external wake up event generating a system reset For further information please refer to STM32L 15x reference manual RM0038 and programming manual PM0062 where you can find more details about all the available configurations for each STM32L15x low power mode Doc ID 018933 Rev 1 9 18 Software description AN3413 2 2 1 10 18 Software description STM32L peripherals used by the application This application example uses the following STM32L peripherals with the settings described below ADC ADC performs analog to digital conversions of the internal reference voltage Vpp voltage display and of the voltage coming from the operational amplifier that is the image of Ipp current e ADC resolution 12 bit ADC conversion mode single e ADC samp
14. ower modes directly on the LCD The low cost STM32L DISCOVERY kit with the firmware example associated with this application note provides a starting point for your own evaluation of current consumption of application specific tasks running on the ultra low power STM32L microcontroller 16 18 Doc ID 018933 Rev 1 ky AN3413 Revision history 4 Revision history Table 2 Document revision history Date Revision Changes 04 07 2011 1 Initial release Doc ID 018933 Rev 1 17 18 AN3413 Please Read Carefully Information in this document is provided solely in connection with ST products STMicroelectronics NV and its subsidiaries ST reserve the right to make changes corrections modifications or improvements to this document and the products and services described herein at any time without notice All ST products are sold pursuant to ST s terms and conditions of sale Purchasers are solely responsible for the choice selection and use of the ST products and services described herein and ST assumes no liability whatsoever relating to the choice selection or use of the ST products and services described herein No license express or implied by estoppel or otherwise to any intellectual property rights is granted under this document If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party product
15. p with and without RTC is detailed in Figure 5 Please see RM0038 for more details about low power modes available on STM32L1 xx Doc ID 018933 Rev 1 ky AN3413 Software description Figure 5 Low power mode flowchart START LCD disable LCD clock OFF RTC clock source None RTC clock OFF Regulator in Ultra low power mode GPIO Low power config Disable external counter U3 Disable fast wakeup Configure LP clock Configure interrupt even Switch OFF flash memory Switch OFF regulator WFE set to external event from PAO Enable external counter U3 y Wait For Event or Wait For Interrupt Event o Interrupt occurred YES y Clear interrupt event Switch ON regulator 7 except Stop with RTC Reconfigure clock except Sleep mode only for LP RUN Sleep and LP Sleep END MS19816V1 In Standby mode the device is in its deepest energy saving state The device enters the Cortex M3 deepsleep mode and the voltage regulator is disabled All oscillators are switched off SRAM and register contents are lost with the exception of the RTC registers RTC backup registers and Standby circuitry The device is woken up from this mode by an external wakeup event generated by the U3 counter invoking a system reset Doc ID 018933 Rev 1 13 18 4 Software description AN3413 14 18 Figure 6 St
16. power modes and supply current requirements for each low power mode available on STM32L152 The firmware associated with this application note also provides a demonstration of the touch sensing functionality available on STM32L DISCOVERY The touch sensing electrodes can be configured either as a linear touch sensor to perform linear sensing of finger position displayed as a percentage on the LCD or it can be configured as a group of four independent touchkeys It also includes a manufacturing test mode for performing a quick diagnosis of the STM32L DISCOVERY related to this application example See Section 1 5 3 Manufacturing test for details regarding the test activation and for an explanation of the different test modes lbp measurement principle The STM32L DISCOVERY Ipp measurement circuitry consists of measuring the high side shunt voltage value V at the terminals of a high precision serial resistor 1 inserted between the 3V3 power supply and the Vpp pin of the MCU Depending on the device power modes the application uses R or 2000 2 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 pA range K1 is opened and the equivalent resistance is 2002 x R Doc ID 018933 Rev 1 ky AN3413 Application description Figure 2 Ipp measurement equivalent circuitry Q14 Q13 PA4 I
17. s or services or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION OR INFRINGEMENT OF ANY PATENT COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE ST PRODUCTS ARE NOT RECOMMENDED AUTHORIZED OR WARRANTED FOR USE IN MILITARY AIR CRAFT SPACE LIFE SAVING OR LIFE SUSTAINING APPLICATIONS NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY DEATH OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE ST PRODUCTS WHICH ARE NOT SPECIFIED AS AUTOMOTIVE GRADE MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER S OWN RISK Resale of ST products with provisions different from the statements and or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever any liability of ST ST and the ST logo are trademarks or registered trademarks of ST in various countr
18. tion schematics 0 0c cece ee 3 1 4 Application PNCIPIO lt tae ees buetoswes ees ved sekeuSel oot ee Rares 4 1 4 1 OVEINVIEW seei a a Gta eh ee bee tede bees See eee ea de 4 1 4 2 lpp measurement principle annann nunen 4 1 5 Getting started with the application 0 00 cee eee 6 1 5 1 Demo mode Touch sensing demonstration and Ipp measurement 6 1 5 2 Bias current record 0 e ec eee 8 1 5 3 Manufacturing test ceus 6 tee 8 1 6 LOW power modes 2 e2h4secssduene eae taeeede beweagadee bee uate 9 2 Software description 0 ccc eee eee eee 10 2 1 STM32L peripherals used by the application 10 2 2 STM32L15x standard firmware library configuration 11 2 3 Application software flow 2ccvceodeeeeen de eueetveee Vesouk aves 11 2 3 1 Main application 0 0 eee 11 2 3 2 Demo mode lpp measurement 0 00 eee ee 11 3 CONCIUSION s cs ctcc itech tet easel aende et ge Rbk ease wee Ree ee 16 4 REVISION history asia ee eee ede eee eee ee eR ek awl 17 2 18 Doc ID 018933 Rev 1 ky AN3413 Application description 1 Application description 1 1 Used hardware components This application example uses the hardware components available on STM32L DISCOVERY on board LEDs green LD3 and blue LD4 the 6 digit 4 bar LCD glass display the user push button and touch sense slider No additional components are required 1 2 STM32L DISCOVERY har

Download Pdf Manuals

image

Related Search

Related Contents

Napoleon Fireplaces fireplaces User's Manual  Canon DR-M160 User's Manual  Metra Stereo Dash Kits Installation Instructions  FTS-H and FTS-HC USER MANUAL  HQ TIMER-10  École Centrale de Lyon PE 103 : Création d`un outil d`aide à la  Menu - Brother  Raymarine S100 Controller User Guide  

Copyright © All rights reserved.
Failed to retrieve file