• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

using 8051 as pulse counter

Not open for further replies.


New Member
hi hello,

1) I have a 8051 Controller , A pulse Dialing Telephone Set, a off-hook indicator Circuit using optical coupler 4N25 and a LED. using 12 Mhz crsytal.

2) I need to use 8051 as a pulse counter,

3) From the Off-hook indicator the wire which gives logical High
Signal when ever the telephone set goes off-hook is connected at
> 4) At Pin 2.0 a LED is connected.
> 5) Controller should keep on monitoring Pin1.0
> ORG 00H
> JNB,P1.0,$
> 6) When ever the telephone set goes off-hook a logical high
signal will come at Pin1.0 , the controller turn on the LED and come
back to P1.0 Port Monitoring.
> SETB P2.0
> 7) Now the problem starts.... now when when the telephone dial
digit "1" , pulses will come at Pin1.0, now the controller
should move to next instruction which can count pulses and display
the LED with the corresponding pulses ..
> e.g. if "1" is pressed LED should turn off and turn on
> if "2" is pressed LED should turn off and On
two times...
> A pulse dialing telephone set sents 10 Pulses Per Second when a
"0" is pressed, it means if the user press "1"
then LED should Blink 10 Times in a second...
> Swear i have tried but i don't even able to develop a logic...
> May i have to input delay for each digit and when ever a Pulse
comes the controller should compare those pulse with the delay and
then if they matches perform the function..
> CJNE commands..
> Or the Controller should be able to count the pulses and then
generate same amount of pulses out.
> I need some example code at least for one digit pulse e.g. how
the controller will count or compare for digit "0".

or if i use the timer C/T option sending pulses at p3.2 pin then it can count the pulses but there are two telephone sets ,,is there any way i can make the timer count using two bits (pins) for two telephone sets..

Also can you tell me the frequency of Busy Tone and Ring Back Tone,,, i know the dial tone frequency which is 400Hz.

> Thankyou.
Not open for further replies.

Latest threads

EE World Online Articles