数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

AN3147 数据表(PDF) 21 Page - STMicroelectronics

部件名 AN3147
功能描述  Power management in STM8L and STM8AL
PDF  25 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  STMICROELECTRONICS [STMicroelectronics]
网页  http://www.st.com
标志 STMICROELECTRONICS - STMicroelectronics

AN3147 数据表(HTML) 21 Page - STMicroelectronics

Back Button AN3147 Datasheet HTML 17Page - STMicroelectronics AN3147 Datasheet HTML 18Page - STMicroelectronics AN3147 Datasheet HTML 19Page - STMicroelectronics AN3147 Datasheet HTML 20Page - STMicroelectronics AN3147 Datasheet HTML 21Page - STMicroelectronics AN3147 Datasheet HTML 22Page - STMicroelectronics AN3147 Datasheet HTML 23Page - STMicroelectronics AN3147 Datasheet HTML 24Page - STMicroelectronics AN3147 Datasheet HTML 25Page - STMicroelectronics  
Zoom Inzoom in Zoom Outzoom out
 21 / 25 page
background image
DocID17035 Rev 3
21/25
AN3147
Power management tips
24
5.3
Dynamic control of pull-up resistor
Many applications have buttons which are used as a user interface. Those buttons are
connected to I/Os that are connected to VSS once the buttons are pressed. An internal pull-
up is used in order to have a defined logic level on these I/Os when the button is off.
Once the button is pressed, the I/O is grounded and it generates an additional current of ~
40 – 70 µA, drawn from the power supply. This current is negligible if the application is in
Run mode, but becomes very important for applications mainly running in low power modes.
For this type of applications, you can control the pull-up dynamically. Once a button is
pressed, the related service routine is executed. This routine disables the pull-up and the
interrupt, in order to save consumption while the button is pressed.
As the application has to check the button status regularly, this pull-up is enabled again
before this check. If the button is still pressed, this process is repeated. Once a button
release is detected, the pull-up remains on.
For this task, an I/O can be left floating for a short time frame, given by a check period,
generating an extra consumption in the range of ~10 µA. Therefore, the total current
consumption for a button press operation is lower than without this dynamic control.
5.4
Waiting loops / delays
In some cases, the application has to wait for an input from the user, slow peripheral (ADC),
or another external unit.
If there is no useful code to execute in the meantime, instead of using:
a typical delay loop:
(delay = 0; delay < 0xFFFF; delay++)
_asm ("nop");
or a polling loop like:
ADC_CR1 I= ADC_START; // start conversion
while (!( ADC_SR & ADC_SR_EOC)); // wait for EOC bit set
it is recommended to use a more advanced solution, using a Wait for event mode:
1.
Configure the ADC as a source of event
2.
Enable an event by allowing the related interrupt:
WFE_CR2 I= ADC_COMP_EV; // enable ADC as a source of event
ADC_CR1 = ADC_EOCIE; // enable interrupt for end of conversion
An event is then generated after each conversion. The conversion starts as follows:
ADC_CR1 = ADC_START; // start conversion
_asm ("wfe");
The sequence described above uses WFE mode to wait for an end of conversion. This can
also be used for other sources like communication lines, etc. In case of external sources
(like interrupt from an I/O port), you can also consider using Halt mode.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com