| ??? 05/17/03 15:04 Read: times |
#45751 - suggest some thing about this code Responding to: ???'s previous message |
ok,
what i made and iam trying is for as follow:- Off Hook :- logical 1 On Hook :- 0 1) It is only for one Telephone Set, 2) When ever the telephone goes off hook, 3) program jmp to pulse dialing 4) wait for dailing 5) then as the digit is pressed 6) 10 milli second and 60 milli second delay is call 7) after that it is checked whether the user is still off-hook or not. 8) then 40 milli second delay is called 9) then again it is checked if the user is off hook or not.. 10) then the program jmp to the a routine which conncted MT8816 switch so that Dial Tone Appears in the telephone . 11) if incorrect digit dialed i.e. other then 2 then nothing happens.. on dialing 2 controller perform the task other wise do nothing.. ORG 00H MOV P3,#00000000B ;STROBE IS CLEARED MOV P2,#00000000B ;RESETING THE PIN MOV P1,#00000000B ;RESETING THE PIN AJMP MAIN ORG 0030H MAIN: OFF: JNB P2.0,OFF ;WAITING FOR OFF-HOOK CALL PULSE_DIAL MT8816: MOV P1,#10010000B ;ADDRESS LINE TO CONNECT Y0 WITH X2 FOR DIAL TONE SETB P3.5 ;STROBE IS SET HIGH DO: SJMP DO END PULSE_DIAL: MOV R0,#00D ;PULSE COUNTER REGISTER WAITING: JB P2.0,WAITING ;WAITING FOR DIALING CALL DELAY_10MS CALL DELAY_60MS ;MAKE =60 MILLI SECOND JNB P2.0,MAIN ;CHECKING IS USER CONNECTED OR NOT CALL DELAY_40MS ;BREAK = 40 MILLI SECONDS INC R0 ;COUNT PULSES JB P2.0,TASK ;IF USER IS STILL ON HOOK PERFORM THE TASK JMP MAIN TASK: CJNE R0,#02D,DO JMP MT8816 I have not shown the delays but these delays are used using DJNZ as only one telephone is under consideration. Now if 2 is pressed dial tone must appear in the telephone but its not happening...is there something wrong with the code.. |



