After detecting presence of a valid DTMF signal StD goes high for Short duration (Refer Data sheet) and outputs Q1-Q4 gets latched according to received tone-pair (Refer above table)
ALGORITHM
· Poll for Ring Detection.
· Activate of relay to place 220 Ohm (1/2 watt.) resistor in line so as to lift phone .(The 220-ohm loop on telephone line disconnects the ringer from the telephone line in the exchange.)
· Poll for StD and when it goes high Read port 0 to find out received tone-pair from Q1-Q4.
· Take control action according to received tone & Poll for the strobe again if you wish and deactivate relay when you finish.
COADING(ASSEMBLY LANGUAGE)
· mov p0 ,#0ffh ; To configure P0 for input
· setb p2.6 ; To configure P2.6 (RING DETECT) for input.
· AGAIN
· jnb p2.6 , AGAIN ; Poll for ring detect signal
· setb 2.7 ; Activate relay to lift receiver
· setb p0.3
·
· POLL
· jnb p0.3 POLL ;Poll for high strobe
· mov a,p0 ;Read P0
· anl a,#0f0h ;To get code (Q1-Q4 ) for Received tone- pair in ACC.
· xrl a,#01h
· jnz TERMINATE ;If 0 is not received TERMINATE Session
· setb p1.0 ;make P1.0 High if 1 is received
· TERMINATE
· clr 2.7 ;Deactivate relay
Presented By- SANJEEV SHARMA [ Studying in EC 2nd Year]
Naraina College Of Engineering & Technology, kanpur
Comments
Post a Comment