Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

AN2142 Datasheet(PDF) 14 Page - STMicroelectronics

Part # AN2142
Description  This document provides an introduction to the Tasking toolchain
PDF  16 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN2142 Datasheet(HTML) 14 Page - STMicroelectronics

Back Button AN2142 Datasheet HTML 8Page - STMicroelectronics AN2142 Datasheet HTML 9Page - STMicroelectronics AN2142 Datasheet HTML 10Page - STMicroelectronics AN2142 Datasheet HTML 11Page - STMicroelectronics AN2142 Datasheet HTML 12Page - STMicroelectronics AN2142 Datasheet HTML 13Page - STMicroelectronics AN2142 Datasheet HTML 14Page - STMicroelectronics AN2142 Datasheet HTML 15Page - STMicroelectronics AN2142 Datasheet HTML 16Page - STMicroelectronics  
Zoom Inzoom in Zoom Outzoom out
 14 / 16 page
background image
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)



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16


Datasheet Download

Go To PDF Page


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


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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