|
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. |
|
|
| 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. |
|

|
| Figure 2: 8870 Decode Table |
|
|
|
| Figure 2 shows the output latch status according to the tone pair received. |
|
|
| Figure 3:8870 Basic Circuit |
|
|
|
|
| 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 InputMain: 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 MainC1_MAIN: CJNE A, #01H, MAIN //CHECK IF KEY PRESSED IS ‘2’ CLR P2.5 //IF YES P2.5=0 JMP Main |
|
|
|
|
Comments
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?
Thanks.
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.
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.
2. how can I use either * or # to control an appliance on or of.
Thank u
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.
RSS feed for comments to this post