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.

frequency counter using at89s51

Status
Not open for further replies.

joajas

Junior Member level 1
Joined
Jul 17, 2004
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
176
Hi, I need to determined a square digital waveform's frequency. Any suggestions on how to do that?? I am thinking of using one of the i/o pins as input from and external source and determining that the frequency of the waveform on that input is 424hz. Please advice...
 

You can put the signal to the counter input pin, use the internal timer(for example, 1s interval) as the other resource. The working sequence is as follows:
i. start timer, at the same time, start the counter.
ii. check the timer's interrupt flag.
iii. when the timer's interrypt flag has been set (1s passed), stop the counter, read the counter number, then you got the frequency.
 

So.. How do I read the values from TH and TL??? :?: Please advice. Thank you and best regards.
 

It's quite easy to read TH and TL no matter using C or ASM code. If you can't do this now, you can do nothing on MCU, so just study the basic concept at first, a book on MCU will be suitible for you.
 

You can use 12M Crystal in external Oscillator.Then the internal clock time is 1us/1clock (1(12M/12)).Use the Time0 in Mode 1.Than Set TR0=GATE0=1 and connect probe to P3.2. When the P3.2 is high level,the Time0(Conuter0) will count until the P3.2 change to low level.I suppose the count value is 100. the count value mean the 1 period is 200us.So the frequency is 1/200us.But the method must be high level equal low level of the square signal.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top