| 数据搜索系统,热门电子元器件搜索 |
|
AN2979 数据表(PDF) 5 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2979 数据表(HTML) 5 Page - STMicroelectronics |
|
5 / 12 page ![]() AN2979 Software description Doc ID 15651 Rev 1 5/12 2 Software description The software provided with this application note describes a way of implementing an A/D converter (using a timer and analog comparator interrupts). The application uses four peripherals: ● CLK: the clock enables and provides the correct clock frequency for the peripherals. ● COMP: the comparator detects when the input voltage is above the reference voltage ● TIM2: Timer 2 provides the 2 ms PWM with a duty cycle of 0.25 generating the capacitor charge and discharge. Timer 2 Capture/compare interrupt routine handles the conversion. ● GPIO: the general purpose I/O handles the I/O used. ● SPI: used to communicate with the LCD. A generic file param.h contains the parameter values that can be modified in order to re-use the application and adapt it easily to other conditions. At the start, the LCD displays “STM8L ADC using COMP”. Then it continously displays the measured values. Figure 3. Application architecture & description Note: The software can be compiled with Cosmic and Raisonance compilers. It contains projects for STVD and Raisonance IDE. A calibration of some parameters can be optionally set if “#define Calibration” is uncommented in the param.h file. param.h param.c ai15372 main.c stm8l10x.h stm8l10x.h stm8l10x.h stm8l10x.h stm8l10x tim stm8l10x comp stm8l10x tim stm8l10x.comp stm8l10x cl stm8l10x api stm8l10x cl stm8l10x api Application layer API layer Standard peripheral drivers STM8L101x microcontroller |
|
|
链接网址 |
| 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 |