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.

[51] Controlling timer externally

Status
Not open for further replies.

Ali250

Newbie level 1
Newbie level 1
Joined
May 17, 2014
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
11
Hello all.

Concisely put, I need to measure the width of a pulse using the timer on AT89C52. The maximum width of the pulse will be 25ms so I figured I could easily use the 16-bit mode and measure the entire pulse at once without the timer overflowing. The thing is I'd like to start and stop the timer externally since I'm doing a couple of other tasks as well.

From what I learned, I thought all I needed to do was set TR0 in TCON and the gate bit for timer 0 in TMOD and that would cause the timer would start as soon as the INT0 pin turned low (since its INT0-bar in 8052). But it isn't working like that in my Proteus simulation. Later on I tried enabling IE.7 as well thinking I might need to enable the interrupts for this to work but that didn't work either.

NOTE: I DO NOT want to check for overflow. I just want to to know how to start and stop the timer based on an external input without constantly polling it.

Thanks in advance.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top