![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
september 2012 doc id 018847 rev 3 1/30 AN3404 application note low power considerations for stm8tl5xxx devices introduction this document is intended for touch sensing application designers who require an overview of low power modes in the stm8tl5xxx devices. it describes how to use the general features of these devices in low power modes by explaining the differences between the various modes. it focuses on how to reduce consumption when using the proxsense peripheral and demonstrates how this is managed by the stm8tl5x stmtouch library in addition to giving some code examples. this application note is not intended to replace the stm8tl 5xxx datasheet. all values given in this document are for guidance only. for guaranteed values, please refer to the stm8tl5xxx datasheet. table 1. applicable products type product sub-class microcontroller stm8tl5xxx www.st.com
contents AN3404 2/30 doc id 018847 rev 3 contents 1 power consumption factors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.1 internal supply structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3 clock management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.1 clock system overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2 default clock source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.3 clock configuration and power management . . . . . . . . . . . . . . . . . . . . . . . 8 3.4 clock selection versus power consumption . . . . . . . . . . . . . . . . . . . . . . . . 8 4 low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.1 flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.2 overview of low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.3 slowing down the clock frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.4 peripheral clock gating (pcg) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.5 execution from ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.6 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.6.1 entering wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.6.2 exiting wait for interrupt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.6.3 exiting wait for event mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.7 halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.7.1 entering halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.7.2 exiting halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.8 active-halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.8.1 entering active-halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.8.2 exiting active-halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.9 activation level control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 5 general power management tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 5.1 choosing the optimal low power mode for your application . . . . . . . . . . . 16 5.2 gpio initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 5.3 dynamic control of pull-up resistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 AN3404 contents doc id 018847 rev 3 3/30 5.4 waiting loops/delays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 5.5 minimizing power consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 6 proxsense and low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 6.1 possible cpu low power modes combined with proxsense . . . . . . . . . . 19 6.2 main factor of the proxsense acquisition consumption . . . . . . . . . . . . . . 19 6.3 low power features in the proxsense peripheral . . . . . . . . . . . . . . . . . . . 20 6.3.1 low_power bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 6.3.2 stabilization time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 6.3.3 bias parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 6.3.4 inactive state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 6.3.5 receiver disabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 7 low power mode management by the stm8tl5x stmtouch library 22 7.1 configuration available in the stm8_tsl_con f.h file . . . . . . . . . . . . . . . . . . 22 7.1.1 acquisition time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 7.1.2 low_power bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 7.1.3 stabilization time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 7.1.4 bias parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 7.1.5 receiver configuration when disabled . . . . . . . . . . . . . . . . . . . . . . . . . . 24 7.1.6 transmitter configuration when disabled . . . . . . . . . . . . . . . . . . . . . . . . 24 7.2 practical code example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 7.2.1 low power management with all acquisition banks . . . . . . . . . . . . . . . . 24 7.2.2 very low power management with proximity detection . . . . . . . . . . . . . 25 8 conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 9 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 power consumption factors AN3404 4/30 doc id 018847 rev 3 1 power consumption factors the stm8tl5xxx microcontrollers are digital logic devices using the complementary metal oxide semiconductor (cmos) technology. in these type of devices, power consumption is a sum of: static power (mainly caused by transistor polarization and leakage) dynamic power which depends on the supply voltage and the clock frequency dynamic power is calculated using equation 1 . equation 1 where: c is the cmos load capacitance v is the supply voltage f is the clock frequency static consumption is negligible compared to dynamic consumption when the clock is running. in some low power modes, when no clock is running, static consumption is the main consumption source. total consumption is a sum of static and dynamic consumption as given by equation 2 . equation 2 where: i dd is the supply current i dynamicrun is the current consumption dependent on the cpu frequency i static is the current consumption independent on the cpu frequency dynamic power c v 2 f ? ? = i dd fi dynamicrun ? a mhz ?? ? ?? i static a ?? + = AN3404 power consumption factors doc id 018847 rev 3 5/30 consequently, power consumption depends on: the microcontroller unit (mcu) chip size this includes the technology used, the number of transistors, and the analog features/peripherals embedded and used in the application. the mcu supply voltage the amount of current used in cmos logic is directly proportional to the square of the power supply voltage (v2). thus, power consumption may be reduced by lowering the mcu supply voltage. this is less critic al for stm8tl5xxx devices than for other microcontrollers, as an internal voltage regulator is used. however, the mcu supply voltage could have an impact on the remaining components on the board. the clock frequency power consumption may be reduced by decreasing the clock frequency when fast processing is not required by the application. the number of active peripherals or mcu features used (such as timers, communication peripherals, watchdogs, proxsense, etc.) the greater the number of active peripherals or features, the greater the amount of power consumed. the operating mode power consumption depends on which mode a particular application is running (example: central processing un it (cpu) on/off, o scillator on/off). fo r an application powered by a battery, the consumption is very important. usually, the average consumption should be below a certain target value to ensure an optimum battery lifetime. this means that an application can consume more for short periods of time and keep its average current consumption below the target value. power supply AN3404 6/30 doc id 018847 rev 3 2 power supply the stm8tl5xxx family embeds two regulators which provide a supply voltage (v core ) for the core and internal peripherals. figure 1. power supply overview 1. each power supply pair must be decoupled with filtering ceramic c apacitors as shown above. these capacitors must be placed as close as possible to, or below, the appropriate pins to ensure the correct functionality of the device. 2. the 1 f capacitor must be connected to the v dd pin. 3. the 1 f ceramic capacitor connected to pxs_vreg must be low esr (esr ? 1 ? ). the main voltage regulator (mvr) provides a 1.8 v supply voltage but in case v dd is lower than 1.8 v, the mvr delivers v dd to v core . it has a high current capa bility, as it can deliver up to 25 ma. however, the consumption of this regulator is higher than the consumption of the lpvr. consequently, the mvr is used during a standard operation only. the consumption of the lpvr is very low as required for low power modes. the lpvr can deliver up to 200 a, providing 1.55 v to the digital part of the mcu. after reset, the mvr provides a supply voltage (v core ) to the internal digital parts of the microcontroller. depending on the functional mode, the mvr can be switched off. in this case, the lpvr continues to provide the v core voltage. the power supply is monitored by the power-on reset/power-down reset (por/pdr). this system ensures a proper startup and reset of the mcu, while v dd rises above the por threshold. it resets the mcu when v dd falls below the pdr threshold. 6 d o m a i n 0 8 3 ? 6 2 % ' 6 $ $ ) / 6 $ $ 6 3 3 ) / 6 3 3 n & 6 $ $ ? & 6 $ $ ? & n & a i ! n a l o g b l o c k s 6 o l t a g e r e g u l a t o r m a i n v o l t a g e r e g u l a t o r - 6 2 l o w p o w e r v o l t a g e r e g u l a t o r , 0 6 2 - ( z 2 # o s c i l l a t o r ( 3 ) k ( z 2 # o s c i l l a t o r , 3 ) , i n e a r v o l t a g e r e g u l a t o r $ i g i t a l b l o c k s ) / s 3 4 - - # 5 c o r e # 0 5 2 ! - & |