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.

counting pulses without using counters in 89c51 microcontrol

Status
Not open for further replies.

vijiembed

Newbie level 5
Newbie level 5
Joined
Jul 8, 2008
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,331
Hai friends,
I need an urgent help.
Pl help me.
Actually, i gave a sensor output pulse to a single IO pin.
I want to count how many pulses entered within a single second without using couner.
Is it possible in AT89c51 microcontroller or AT89c55wd microcontroller.
Pl help me...
Thanks in advance...


VIJI.R
 

Re: counting pulses without using counters in 89c51 microcon

connect the signal to interrupt.
in the ISR just increment the software variable and exit. use assembly for fast response.
hock
 

Re: counting pulses without using counters in 89c51 microcon

Hai friend,
Actually, i try to write the code for counting pulses without using timers.
The code is shown below.
Pl check it.



sbit x=P1^5; //the pulse is given to this pin
void sensor()
{
unsigned char i=1275,j=1000,k=0;
x=0;
delay();
while(j)
{
while(i)
{
if(x==1)
{
k=k+1; //k has the no of pulses
x=0;
}
i--;
}
j--;
}



Pl check it.
Thanks in advance.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top