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

X  

AN3280 数据表(PDF) 7 Page - STMicroelectronics

部件名 AN3280
功能描述  Displaying variable voltage on a bar of LEDs using STM8S-DISCOVERY
PDF  13 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  STMICROELECTRONICS [STMicroelectronics]
网页  http://www.st.com
标志 STMICROELECTRONICS - STMicroelectronics

AN3280 数据表(HTML) 7 Page - STMicroelectronics

Back Button AN3280 Datasheet HTML 3Page - STMicroelectronics AN3280 Datasheet HTML 4Page - STMicroelectronics AN3280 Datasheet HTML 5Page - STMicroelectronics AN3280 Datasheet HTML 6Page - STMicroelectronics AN3280 Datasheet HTML 7Page - STMicroelectronics AN3280 Datasheet HTML 8Page - STMicroelectronics AN3280 Datasheet HTML 9Page - STMicroelectronics AN3280 Datasheet HTML 10Page - STMicroelectronics AN3280 Datasheet HTML 11Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 7 / 13 page
background image
AN3280
Software description
Doc ID 17983 Rev 1
7/13
2
Software description
This application uses neither the STM8S standard library nor the STM8 touch sensing
library. The peripherals used in this application are:
●
ADC1: Voltage acquisition. Must be configured as:
–
Single conversion mode
–
External trigger by TIM1 TRGO
–
ADC_clock = Fmaster/8
–
Left alignment result (otherwise a software modification is required to calculate the
average)
–
Disable Schmitt trigger on ADC1 input 9: for analog input
●
TIM1: Timer TIM1 has two aims in this application:
–
To wake up the ADC for incoming conversion when the counter value reaches
CCR1 (Capture/compare interrupt). This action is very useful to allow ADC
stabilization time before the conversion.
–
To send a conversion trigger signal to launch the ADC conversion when the
counter value reaches TIM1_ARR.
With these two events you can easily manage ADC wake-up and conversion timing. For
this use, TIM1 must be configured with:
–
Compare-OC1REF trigger output
–
PWM1 mode on PC1 (negative polarity): for testing purpose (to measure exactly
the time allowed for stabilization)
●
GPIO: Configures PB0, PB1, PB2 and PB3 in output push/pull mode to control LEDs
LD2, LD3, LD4 and LD5.
Figure 2 illustrates ADC1 acquisition principle.
1.
TIM1 is configured as an upcounting counter.
2.
When the compare/capture interrupt occurs, the ADC1 is woken up for the incoming
conversion (the stabilization time of the ADC1 is respected before the ADC
conversion).
3.
On TIM1 TRGO, the ADC1 starts the conversion.
4.
When the conversion is finished, the result is stored in RAM and the ADC1 is powered
down until the next compare/capture interrupt.
5.
When 8 conversion results have been stored, the main routine calculates the average
of these results and displays it on the LED bar.
Note:
OC1REF complementary signal is forced out on CC1 output pin (PC1) for test purposes.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13


数据表 下载

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