Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

8051 timer and external interrupts in c

Status
Not open for further replies.

MichaelBridge12

Newbie level 1
Joined
Dec 6, 2012
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
I want to know how I can use an external interrupt to control a timer interrupt. I am using keil as my compiler and programming in c. Let's say I want to produce a square wave in the timer interrupt and then every time my external interrupt is active I want to turn off/turn on the square wave. I pretty much just want to know how I can use the external interrupt to control my timer interrupt or would I just complement the square wave in the external interrupt anytime the external interrupt is activated? Any advice on how to go about doing this would be great. Thanks!
 
Last edited:

When your MCU encounters an external interrupt start the timer which has been initialized previously. Make the timer to generate square wave for the required time and turn OFF. The process repeats with every external interrupt.
 

When your MCU encounters an external interrupt start the timer which has been initialized previously. Make the timer to generate square wave for the required time and turn OFF. The process repeats with every external interrupt.


also when u startup the timer via the external interrupt,you also have to disable it else the system will hang in an endless loop of the external interrupt service routine
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top