| 数据搜索系统,热门电子元器件搜索 |
|
AN3280 数据表(PDF) 7 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN3280 数据表(HTML) 7 Page - STMicroelectronics |
|
7 / 13 page ![]() 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. |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| 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 |