lanceaustin
Programmer
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
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