Objective is when ever Telephone Set goes off hook , controller detects off hook and sents a Dial Tone to the telephone set for 20 Seconds and after 20 seconds program END.
Using 12 MHz Crystal.
Firstly the Program do nothing untill a logical high signal comes at P1.0.
When a Logical high Signal somes at P1.0,
Timer 0 interrupt comes in act
1000 Hz square wave is produced at P2.0.
Now how I can make controller to sent this upto 20 seconds and,
After that sents a Busy TONE type of Sound by generating the same square wave but with 0.1 second ON and 0.1 Second OFF.
ORG 00H
LJMP MAIN
ORG 000BH
CPL P2.0
RETI
MAIN:
JNB P1.0,$
JMP DIAL TONE
DIAL TONE:
MOV TMOD,#20H
MOV TH0,,#-50
SETB TR0
MOV IE,#82H
Upto 20 seconds DIAL TONE and after that BUSY TONE keeps on going.
END
Using 12 MHz Crystal.
Firstly the Program do nothing untill a logical high signal comes at P1.0.
When a Logical high Signal somes at P1.0,
Timer 0 interrupt comes in act
1000 Hz square wave is produced at P2.0.
Now how I can make controller to sent this upto 20 seconds and,
After that sents a Busy TONE type of Sound by generating the same square wave but with 0.1 second ON and 0.1 Second OFF.
ORG 00H
LJMP MAIN
ORG 000BH
CPL P2.0
RETI
MAIN:
JNB P1.0,$
JMP DIAL TONE
DIAL TONE:
MOV TMOD,#20H
MOV TH0,,#-50
SETB TR0
MOV IE,#82H
Upto 20 seconds DIAL TONE and after that BUSY TONE keeps on going.
END