| Electronic Components Datasheet Search |
|
AN2142 Datasheet(PDF) 14 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2142 Datasheet(HTML) 14 Page - STMicroelectronics |
|
14 / 16 page ![]() Application example: interrupt handling AN2142 14/16 2 Application example: interrupt handling This section describes a simple ST10F27x software example making use of the interrupts. The application uses Timers’ overflow interrupts to generate two square signals with different frequencies on two standard port pins: P2.0 & P2.1. The project contains 3 source files: ● Timer.c: It contains c source code for the following project routines – Configure_GPT1_Timer_2(): In this routine, GPT1 Timer 2 is set up to operate in Timer mode and is configured to generate an interrupt every 1.678 seconds. – Configure_GPT1_Timer_3(): In this routine, GPT1 Timer 3 is set up to operate in Timer mode and is configured to generate an interrupt every 104.8 milliseconds. – Timer 2 and Timer 3 interrupts’ definitions: Timer 2 interrupt is toggling P2.0 while Timer 3 interrupt is toggling P2.1. ● Timer.h: It contains Timer.c routines prototypes. ● main.c: It uses the routines described in Timer.c in order to start the two timer overflow interrupts. Timings suppose that the chip is operating at a frequency of 40 Mhz. Both hardware and software environments have been setup as described in the first chapter. The figure below shows the behaviour of the port 2 pins 0 and 1 and the GPT1 Timer 2 & Timer 3 overflow interrupts. The example source code is located in the ’..\Example2’ directory. For more details about the timers’ functionalities, their registers and interrupts’ handling, refer to the ST10F27x user’s manual. PIN P2.1 OUTPUT (GPT1 TIMER 3 OVERFLOW INTERRUPT) PIN P2.0 OUTPUT (GPT1 TIMER 2 OVERFLOW INTERRUPT) |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List 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 |