Please update your Flash Player to view content.

                  FOLLOW  US





 
 
INTERFACING 8870 DTMF DECODER
Tutorial - 8051 Tutorial
Written by Amol Shah   

DTMF is as acronym for Dual Tone Multi-frequency Signaling it is used in telecommunication signaling basically it is a signal that is sent to the switching center (phone company) when the phones keys are pressed.

DTMF is also called as Multi Frequency Signaling because for each key you press two tones of specific frequencies are generated. This is done so that a voice cannot imitate the tones. One tone is generated from a high frequency group and the other from a low frequency group. In all there are 16 DTMF tones but currently only 12 tones are being used in our phones so we will only study those over here.

1209 Hz
1336 Hz 1477 Hz
697 Hz 1 2 3
770Hz 4 5 6
852 Hz 7 8 0
941 Hz * 0 #

You can also check our PROJECT LIST for a list of College Projects. Any custom ideas regarding projects will be considered & implemented.

Check the Tutorial section for basic Microcontroller interfacing tutorials. We will be updating it as and when it’s possible. If you are interested in submitting any articles/project idea please mail us along with your contact details.

In the above table you can see the row is representing a low frequency and the columns represent the high frequency. So when a key is pressed a sinusoidal signal containing corresponding low & high frequency is sent. E.g. if key ‘5’ is pressed the sinusoidal signal will consist of two frequencies 770Hz & 1336Hz. These tones are then decoded at the switching center to determine which key was pressed.

A number of companies make chips which decode these DTMF signal one such IC is MT 8870. MT 8870 is a complete DTMF receiver so all you have to do is to is give it a supply and an oscillator (crystal) and it will decode the received tones pairs it into a 4 bit code.

MT8870 Pin Diagram
Figure 1: 8870 Pin Diagram
The device after detecting a valid tone-pair makes one of the pins high (StD) for a short duration and the output latch is updated (Q1-Q4) according to the received tone-pair.
MT8870 Decode Table
Figure 2: 8870 Decode Table
Figure 2 shows the output latch status according to the tone pair received.
Basic Circuit
Figure 3:8870 Basic Circuit
Interfacing MT8870 to 8051 Microcontroller
Figure 4: 8870 Interfacing to 8051 Microcontroller

Figure 3 shows the basic circuit for 8870. Figure 4 shows how to connect the 8870 to a Microcontroller.

Now let’s write a simple code to interface 8870 to 8051 Microcontroller.

CODE OBJECTIVE

Make pin P2.5 = 1 when key ‘1’ is pressed and make P2.5=0 when key ‘2’ is pressed.

ORG 0000h
MOV P2, #0FFH                                                //Configure P2 as Input
Main:
JNB P2.0, $                                          //Wait till a High Pulse is received from StD
MOV A, P2                                          //Take data in from the output Latch
ANL A, #1EH                                       //Mask the unwanted bits
RRC A
CJNE A, #01H, C1_MAIN                               //CHECK IF KEY PRESSED IS ‘1’
SETB P2.5                                             //IF YES P2.5=1
JMP Main
C1_MAIN:
CJNE A, #01H, MAIN                       //CHECK IF KEY PRESSED IS ‘2’
CLR P2.5                                               //IF YES P2.5=0
JMP Main
 

Comments  

 
-1 # Sanowar Ashraf 2011-11-10 00:03
I have connected the circuit as shown in the schematic. I get the outputs when i press the buttons from the cell that is directly connected to MT8870 via IC but when i try that from another cell ohone by calling the cellphone at the reciver end..sometimes i get output for only certain buttons and sometimes i dont get any output at all...please help me to solve the issue.
Reply | Reply with quote | Quote
 
 
+1 # Amol Shah 2011-11-10 09:49
This is a new problem never encountered it myself.....which two wires have you connected to the DTMF IC? you should use the headphone wires i.e. the wire connected to the speaker and a ground wire...
Reply | Reply with quote | Quote
 
 
0 # Sanowar Ashraf 2011-11-11 08:42
Yes i have connected those two wires correctly otherwise i wouldnt have got any output after pressing the button form the cellphone that is directly connected to the IC. Its only when i call from another cell to the cell connected that i dont get any output..sometimes i get outputs form 7 8 9 * # sometimes for none..

What i guess is the signals becomes too weak fro the IC to decode when i call to that cellphone...can it be the reason? If that is so then how can i solve that?
Reply | Reply with quote | Quote
 
 
-1 # Amol Shah 2011-11-11 10:51
I don't think signal strength is the issue what are the values of resistor and capacitor that you have used? Also change the mobile both the one from which you are dialing and the one on the circuit
Reply | Reply with quote | Quote
 
 
0 # Sanowar Ashraf 2011-11-11 14:03
I have used resistors and capacitors as suggested in the figure three above. Ok i will try changing the phones at both the ends.

Thanks.
Reply | Reply with quote | Quote
 
 
0 # Jay 2012-01-10 13:32
Amol,

I understand the DTMF decoding concept and interpreting the bits connected to pins. But there is one question I have.

Upon receiving the call, what makes the cell phone connect the call. What do we have to do from microcontroller end to pick up the call and then start receiving the key values?

Thanks in advance.
Reply | Reply with quote | Quote
 
 
+1 # Yogesh Kumar 2012-01-13 00:08
Mr. shah you are right we nweed to make the ground common of complete system. I haven't checked your circuit but as following the datasheet i make Differential Input Configuration.
Now its working very fyn & also i have tested it on many cellphones. Use phone on auto answer mode for auto pick the incoming call.
Reply | Reply with quote | Quote
 
 
0 # Anis jreissati 2012-02-19 01:39
Could pls assist me if I want to have a 1 sec latch as output when I send a valid Dtmf code.
2. how can I use either * or # to control an appliance on or of.
Thank u
Reply | Reply with quote | Quote
 
 
0 # Ankit 2012-03-30 09:25
Sir i've been having this doubt for so long i hope you'll help me out, how to connect mobile phone with the ic, i've tried many a times but i never succeeded. Could you please tell me the proper way to connect cell with dtmf decoder ic.
Thank you
Reply | Reply with quote | Quote
 
 
0 # Amol Shah 2012-03-30 10:05
Quoting Ankit:
Sir i've been having this doubt for so long i hope you'll help me out, how to connect mobile phone with the ic, i've tried many a times but i never succeeded. Could you please tell me the proper way to connect cell with dtmf decoder ic.
Thank you



You will have to connect it via the headphones ....there are two wires going from the mobile to the headphones.....one of the wire should be connected to the DTMF i/p pin and the another to ground.
Reply | Reply with quote | Quote
 

Add comment


Security code
Refresh

 

Featured Products

Rs800.00
Rs720.00
You Save: 10.00%

Rs600.00
Rs540.00
You Save: 10.00%

 

Random Products





Rs12.00







Latest Video

Random Articles

Search Products

User Login






 
 
.
 TUTORIALS
.
  8051 Tutorial
 
  Power Supply
 
CODE LIBRARY
.

  8051 Assembly
 
  C Code Library

.
 PROJECTS
.
  Project List
 
  Synopsis and Abstract
 
DOWNLOADS
.

  Datasheets
 
  Download

.
 POPULAR
.
  About Us
 
  DNA Shop
 
  Totorial
 
  Code Library
 
  Download
 

.
 CONTACT US
.

Mr. Amol Shah

DNA Technology Nashik,

Maharashtra 422009 India

Phone : 0253-3023939

Mobile : 09225145135

Email : contact@dnatechindia.com