| Zakładka z wyszukiwarką danych komponentów |
|
AN2979 Arkusz danych(PDF) 5 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2979 Arkusz danych(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 |
|
|
Link URL |
| Czy Alldatasheet okazała się pomocna? [ DONATE ] |
O Alldatasheet | Reklama | Kontakt | Polityka prywatności | Link do karty katalogowej | Linki | Lista producentów 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 |