| Electronic Components Datasheet Search |
|
AN1774 Datasheet(PDF) 8 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN1774 Datasheet(HTML) 8 Page - STMicroelectronics |
|
8 / 9 page ![]() 8/9 STR71x SOFTWARE DEVELOPMENT GETTING STARTED 2.2 APPLICATION EXAMPLE: INTERRUPT HANDLING This section implements an application with interrupt handling. The main() function initializes and starts two timer overflow interrupts. When a timer expires, an interrupt, handled in 71x_it.c, is generated. Timer0 generates an in- terrupt every 130 ms which toggles the GPIO0 pin. However Timer1 is configured to generate an interrupt every 4.2 s and to set GPIO1 pin to high level for 5 s. These timing suppose that the chip is clocked by an external oscillator operating at a frequency of 16 MHz. The Timer0 interrupt priority has been set to be higher than the Timer1 priority to allow the Timer0 T0TIMI_IRQHandler interrupt routine to be served during the execution of the Timer1 T1TIMI_IRQHandler interrupt routine. Figure 1. shows the behaviour of GPIO0 and GPIO1 pins and the Timer0 and Timer1 interrupts. The example source code is located in the ’..\STR71xGS\Example2’ directory and it contains, besides the standard files and main.c, the makefiles for the project, the project file Interrup- tHandling.prj, the interrupt handler file 71x_it.c and the interrupt header file 71x_it.h. This example has already been built for you. So there is no need to recompile it. You have, simply, to open the project file Example2.prj in the RealView Debugger, to load the image Example2.axf into the target and debug it. For more details on STR71x interrupts’ handling, refer to the Interrupt Handling application note, supplied within this package, or to the STR71x datasheet. Figure 1. Timer0 and Timer1 Interrupts handling GPIO0 pin GPIO1 pin Timer0 interrupt Timer1 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 |