Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forum i need help on this one please

Status
Not open for further replies.

lanceaustin

Programmer
May 5, 2003
23
DE
Forum People,
Swear for last 4 days iam sitting in front of computer and doing the pulse dialing work...i really worked hard on this but still iam only able to make controller detect digit "1" and "2" and nothing else...

Ya its right that i have tried my level best to place this question on all oevr the internet but only to get clues no do any home works ...

i have used 40Mhz Scope to see the pulses but when i press digit "0" i get the same frequencies of all digits but with different duty cycles..

i really beg this forum to guide me some thing to understand this pulse dialing i have tried every thing.. the final program which i made

firstly detects off-hook :- logical "1" at p2.0
then detect connects the dial tone
then waits for a low signal which arrive due to any sort of dialing at p2.0.

now this program perform different tasks but only detect digit "1" and digit "2"...

now i really request all of you to please just explain it in simpler manner if possible guiding whats wrong the following prorgam...

only objective is to make the controller detect single digit from 1,2,3--0 and perform 10 tasks related with these 10 digits that's all.. there has to be some standards showing pulse dialing detections method..i have gone through books and web links most of them recommend 60 Make time and 40 Break Time..

Now here one thing to note is that the maximum time taken by a digit is 1 second digit "0"

Now can some how i can make 1 milli second delay and each time when a pulse comes i decrement a counter register which has initial value 10..or something like that..i have tried this also but no use.


ORG 00H
LJMP MAIN


ORG 030H

DELAY_10MS:
MOV R0,#05D ; 10 milli second delay
L2: MOV R1,#10D
L1: MOV R2,#200D
DJNZ R2,$
DJNZ R1,L1
DJNZ R0,L2
RET

DELAY_40MS:
MOV R0,#05D ;40 milli second delay
f2: MOV R1,#49D
f1: MOV R2,#180D
DJNZ R2,$
DJNZ R1,f1
DJNZ R0,f2
RET

DELAY_60MS:
MOV R0,#05D ; 60 milli second delay
G2: MOV R1,#53D
G1: MOV R2,#250D
DJNZ R2,$
DJNZ R1,G1
DJNZ R0,G2
RET

DELAY_1SEC:
MOV R0,#50D
M2: MOV R1,#100D
M1: MOV R2,#200D
DJNZ R2,$
DJNZ R1,M1
DJNZ R0,M2
RET


MAIN:
MOV P0,#00000000B
MOV P1,#00000000B
MOV P2,#00000000B
MOV P3,#00000000B
OFF_HOOK: JNB P2.0,$ ;WAITING FOR LOGICAL HIGH I.E. OFF-HOOK
CALL DELAY_10MS
MOV P1,#10010000B ;X2 WITH Y0 FOR DIAL TONE
SETB P3.7 ; STROBE IS SET HIGH
MOV R7,#00D ;PULSE COUNTER
JB P2.0,$ ;WAITING FOR DIALING
MORE_PULSES: CALL DELAY_40MS ;LOW
CALL DELAY_10MS ;HIGH
CALL DELAY_10MS
INC R7
JNB P2.0,MORE_PULSES
DIAL2: CJNE R7,#02,DIAL_1
CLR P1.7
CLR P3.7
DIAL_1: CJNE R7,#01,DIAL_3
AGAIN: CLR P1.7
CLR P3.7
CALL DELAY_1SEC
CALL DELAY_1SEC
CALL DELAY_1SEC
MOV P1,#10010000B ;X2 WITH Y0 FOR DIAL TONE
SETB P3.7 ; STROBE IS SET HIGH
CALL DELAY_1SEC
CALL DELAY_1SEC
SJMP AGAIN
DIAL_3: CJNE R7,#03,DONOTHING
AGAIN1: CALL DELAY_1SEC
CALL DELAY_1SEC
SETB P0.2
CALL DELAY_1SEC
CLR P0.2
SJMP AGAIN1
DONOTHING: SJMP DONOTHING
END

now in above case controller detect digit 1 and 2 separately but when i press any other digit like 3, 4 , 5 upto 0 it only takes 2 pulses and perform the task of 2 pulses...

hope to get some help as alway ..

thankyou

 
Hi lanceaustin,

I noticed you had ask this question more than once. It makes me think (maybe) no one here really understand about "pulse dialing".

I suggest you go to You might get helps there

Good luck!

-- AirCon --
 
If you doing this project without any kind of school restrictions, in other words if your instructor didn’t request you to implement it just with a controller, I suggest you use glue logic as input for you controller instead of trying to reinvent the wheel your self.
There are some ICs on the market performing PWM (Pulse width modulation) and demodulation.
You can even go extra mile and use embedded modem chip and set its mode to Pulse instead of Tone (The data sheet will tell you how to do that) and take the out put and feed it to your controller.

Good luck


Walid Magd
Engwam@Hotmail.com
 
ok,,
so what should i add with my controller then for detecting pulse dialing..but i don;t understand one thing y on the entire internet and in any book there is no information about making assembly or even C langauge code for detecting pulse dialing through software...there has to be some specifications.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top