Contents:
Contributors: Terry Lalonde, Dbsnow, Andrew R. Ghali, Brad Yearwood, Gary Schaum, John Fields, Neil Harrison, Arkady Horak-Systems
(From the Editor)
Here's a more detailed explanation of what DTMF is:
Q: What frequencies do touch tones use for which numbers?
A: The touch tone system uses pairs of tones to represent the various keys. There is a "low tone" and a "high tone" associated with each button (0 through 9, plus * (star) and # (octothorpe or pound symbol). The low tones vary according to what horizontal row the tone button is in, while the high tones correspond to the vertical column of the tone button.
The tones and assignments are as follows:
1 2 3 A : 697 Hz 4 5 6 B : 770 Hz (low tones) 7 8 9 C : 852 Hz * 0 # D : 941 Hz ---- ---- ---- ---- 1209 1336 1477 1633 Hz (high tones) or: 1209 Hz 1336 Hz 1477 Hz 1633 Hz ABC DEF 697 Hz 1 2 3 A GHI JKL MNO 770 Hz 4 5 6 B PRS TUV WXY 852 Hz 7 8 9 C oper 941 Hz * 0 # D or: 1 697+1209 2 697+1336 3 697+1477 4 770+1209 5 770+1336 6 770+1477 7 852+1209 8 852+1336 9 852+1477 0 941+1336 * 941+1209 # 941+1477 A 697+1633 B 770+1633 C 852+1633 D 941+1633
The tone frequencies were designed to avoid harmonics and other problems that could arise when two tones are sent and received. Accurate transmission from the phone and accurate decoding on the telephone company end are important. They may sound rather musical when dialed (and representations of many popular tunes are possible), but they are not intended to be so.
The tones should all be +/- 1.5% of nominal. The high frequency tone should be at least as loud, and preferably louder than the low frequency. It may be as much as 4 db louder. This factor is referred to as "twist." If a Touchtone signal has +3db of twist, then the high frequency is 3 db louder than the low frequency. Negative twist is when the low frequency is louder.
Q: What are the A, B, C and D touch tone keys used for?
Why are they not found on touch tone phone sets?
A: These are extensions to the standard touch-tones (0-9, *, #) which originated with the U.S. military's Autovon phone network. The original names of these keys were FO (Flash Override), F (Flash), I (Immediate), and P (Priority) which represented priority levels that could establish a phone connection with varying degrees of immediacy, killing other conversations on the network if necessary with FO being the greatest priority, down to P being of lesser priority. The tones are more commonly referred to as the A, B, C and D tones respectively, and all use a 1633 Hz as their high tone.
Nowadays, these keys/tones are mainly used in special applications such as amateur radio repeaters for their signalling/control. Modems and touch tone circuits tend to include the A, B, C and D tones as well. These tones have not been used for general public service, and it would take years before these tones could be used in such things as customer information lines; such services would have to be compatible with the existing 12-button touch tone sets in any case.
Most of these ICs do not require more than one (inexpensive) 3.58 MHz x-tal or resonator and the power circuitry. Usually the output is 4-bit binary + 1 strobe.
-------------- l l- d3 l DTMF l- d2 signal in -l Decoder l- d1 4-bit binary out l chip l- d0 l l- strobe --------------Note: This figure is merely for decoration, it does not imply package information
Nice text to read about DTMF and telephony can be found in:
We have a pinout for the SSI-202 from WDUNCKEL1:
Data 1 =| |= Data 2 HEX/B =| S |= DATA 4 ENABL =| S |= DATA 8 IN1633 =| I |= CLRDATA VALID VP =| |= DATA VALID NC =| 2 |= ATB (CLOCK OUT) GND =| 0 |= X IN X ENBL =| 2 |= X OUT ANALOGIN=| |= GNDA 10 Meg resistor accross the colorburst crystal is neccessary. Pins 5,2,3,8 are tied high and 4,15,9,7,10 are tied to ground. Data output on d1-d8 will be valid when data valid goes high.
All req. 3.58 MHz (3.579545 MHz) crystal
(From John Fields)
Here's a bombshell for you: It doesn't have to be a color burst crystal! As long as the encoder and the decoder are working on the same clock freq, and the freq isn't too high, (or maybe too low) the decoder will decode the tone pair sent by the encoder.
[back to the original FAQ]
A neat and well documented design + PCB layout by Tom Miller KA1JQW, can be found in "The ARRL handbook for radio amateurs", ISBN: 0-87259-169-7
I spent about the last 14 months of my life working on an integrated DTMF receiver here at Motolora and I would like to have you add the part to the DTMF-list. The receiver is part of a 6805 8-bit microcontroller and is called the MC68HC05F5. Here is a quick feature list:
Arkady Horak <ark@oakhill-csic.sps.mot.com>
Motorola CSIC Microcontroller Division
Austin, TX
A ready to build schematic by R.G. Krijgsman based on this Teltone M957-2 chip can be found in: "Het Elektuur telefoonboek" ISBN 90-70160-94-3, (Dutch language)
[*]: For those in the USA, see the addresses section for this chip.
Note:
Files of interest concerning this faq are:
TEL-2-1.EXE 57K | DTMF Encoder/Decoder for C3x by DSP TEL-2-2.EXE 53K | DTMF Detection Data Sheet by Ensigma Ltd. DTMF10.EXE 24K | TMS320C10 based DTMF decoder DTMF10E.EXE 19K | TMS320C10 based DTMF encoder DTMF_C17.EXE 126K | TMS320C17 based DTMF encoder/decoderTexas Instruments (http://www.ti.com) has expanded their WWW presense. They have an excellent search function that will search their whole site for any keywords. You will find it at URL: http://www.ti.com/corp/docs/search.htm.
For example, try searching for "BBS" and you will find the very useful TMS320 Hotline FAQ at http://www.ti.com/sc/docs/dsps/develop/hotfaq2.htm. If you search for "DTMF" you will find a bunch more useful things about DTMF and chips, etc. Way to go, TI!
If you are designing a device that will attach to the phone line and you are situates in USA, you will need to make the FCC happy. You can either do this by submitting your completed circuit to them for compliance testing (which can run a few thou$and) or you can purchase a small device that is preapproved by the FCC. It is called DAA for Data Access Arrangement. It is a small, usually potted, module that isolates (literally) your circuit from the phone line.
The FCC section you are trying to satisfy is part 68. You should visit your local library and read up on it whether your get the preapproved part or try to have the FCC [affiliated lab] do the testing .. or just plain hope you don't get caught. It's pretty dry reading but that's life.
There are several different modules on the market that fit into this category. They are:
Xecom
374 Turquoise St
Milpitas, Ca. 95035
Tel: 1-408-945-6640
Fax: 1-408-942-1346
"They carry quite a few different daa modules. Some with Touch tone encode/decoder built in which sells for about $45. And a basic daa for about $25."
Dallas Semiconductor
ftp://ftp.dalsemi.com/pub/datasheets/
Tel: 1-214-450-0448
[They take VISA]
(From James T. Wyatt)
My favorite odd-device company, Dallas Semiconductor, has two types of hybrids One is a SIMM stick with about everything, you can even get an FCC type-accepted sticker from them for it to make your project look more engineered.
The other part is a chip-only that you have to add some external parts to. It needs a transformer and optocoupler (can get from Radio Shack), and a non- critical resistor/cap or two. You can call them up, give them your VISA number, and get the chip in the mail.
The chip is a DS1360/S and costs about $7 each. Both provide the FCC-mandated 2-second billing delay, automatic output overload limiting, *two* inputs and outputs (for monitor or DTMF inject), ring detection/anti-falsing, remote loop current detect, etc...
"The chip plugs into phone lines, splits the signal between input and output, has pins for ringing, off-hook, etc. The chip has FCC-transferable Part 68 registration, so it's 100% legal to connect whatever you want to it. There's an international version that should work down there in Oz."
Someone was obviously not too happy using Cermetek parts. This is included here NOT because I'm biased but as a general precaution to designers. These things inherenly impose regulations. Need I say more?.. he writes:
I once worked on a telephone-interface project with the unfortunate selection of the Cermetek parts. They were originally chosen for their small size and supposed FCC ease, but it turns out that a DDA interface from discrete parts was much cheaper and much better quality.
Cermetek problems:
There are just my experiences, and they were with early-rev parts, so they may have improved. Still, it would have saved us several months of engineering time if we had avoided Cermetek from the start.
(This from Steve in Vigra - you know who you are :-)
CircuitWerkes
6212 SW 8th Place
Gainesville, FL 32606
Tel: 1-904-331-5999
Fax: 1-904-331-6999
(FYI, this information posted by Dan Hoehnen and dated Sep 11, 1994)
They sell a partial or full kit or an assembled unit for MPC-2. It provides an FCC approved interface (if you buy the pre-assembled unit) that gives you acces to audio in/out, ring detect and off-hook detect connections.
Circuit board only is $9.00, Complete MPC-2 kit is $19.95, MPC-2 that is assembled and FCC approved is $29.95
The above mentioned company also sells an upgrade board that basically conditions the outputs a little better for pc interfacing.
The upgrade can be bought for $69.95 kit, inlcludes an assembled MPC-2. Or assembled for $99.95.
Telephone hybrids are a real pain in the butt to design. Don't waste your time. Buy one. They're not expensive.
Ok, ok. If you're curious, the reason they're so difficult is that they have to be optimally balanced in such a way that they will work on almost any phone line they are hooked up to. A hybrid's function is to transmit a signal over the phone line at the same time that it is receiving the signal from the other end. Ideally, the received signal will have none of the transmitted signal on it (because otherwise you would hear yourself EXTREMELY loudly whenever you talk into a telephone handset, for instance). The degree to which a hybrid's receiver can cancel out the transmitted signal is called 'rejection' and is usually expressed in db. It depends strongly on the complex impedance of the phone line, and unfortunately each phone line has a different impedance. To design a hybrid with good rejection you gotta twiddle a lot with different caps and resistors and all that, and it can be hairy if you want a design that will work with more than one phone line without having to be adjusted. Ma Bell publishes specs on what the distribution of phone-line impedances is and all that, and you'd try to make your circuit nail the median impedance. Of course, in your application it seems like you're only dealing with one phone line, which makes things a little, but not much, easier.
In addition, your DAA has to be able to deal with all the nasty spikes and so on that come down the line, and that isn't much fun to design, either. And the output levels have to be within Ma Bell's specs, and so on.
But, Anyway, the good news is that the ideal solution is quite simple.
You can purchase a complete DAA and hybrid, which comes on a little thick-film module all pre-engineered and calibrated and adjusted, for less than $20. You just hook up the phone line to two of the pins (you DO need a switch to take it on and off hook) and connect your headphone amplifier and microphone amplifier and dialer (or whatever you are using for your studio) to two other pins. Simple.
You get at least 6db rejection, and typically 12 to 16 db. And you don't have to worry.
SSI-202 $2.25 8870 $2.25
TDK/Silicon Systems (SSi)
Tel: (714) 573 6000 (for closest distributor)
Fax: (714) 573 6914
E-Mail for Info: info@ssi1.com
WWW: http://www.ssi1.com
The SSI202 is manufactured by Silicon Systems Inc (SSI) and the full part number is 75T202-IP.
"It is a 30 pin socketed dual sided surface mount PCB. All protection is on the module and includes a speaker driver and additional relay drivers. Can be used up to 14.4KBPS V32.bis speeds."
Head office in Canada:
MITEL Semiconductor
360 Legget Dr.
P.O. Box 13320
Kanata, Ontario, Canada K2K 1X3
Tel: 1-800-267-6244
Tel: 1-800-561-0860 (maybe)
Tel: 1-613-592-2122 (ask for Semiconductor Applications)
Fax: 1-613-592-6909
UK
Tel: 044 291430000
Fax: 044 291436389
Germay
Tel: 49 7117701522
Fax: 49 7117701524
Unfortunately, I'm not that experienced yet to answer any difficult technical questions about this subject.
For suggestions, improvements, info, flames, waterbuckets (?) please e-mail me at: tsjoit@solist.htsa.hva.nl.
I graduated July 1st 1994, so I won't continue writing updates for this faq (no time, no space, no money :)
I like to thank all of you who think this faq was usefull, especially the ones who wrote me e-mail . I was very suprised to see this faq appear in the most strange places on the Net :)
Anyway...have fun with those di-du-dit-di-duh tones :)
#include <stdio.h> #include <ctype.h> #include <math.h> #include <conio.h> #define BITS 0xFF00 #define NOISE 0 /* enable noise shaper */ #define TON 0.100 /* tone duration */ #define TOFF 0.100 /* silence duration */ #define RAMP 0.002 /* tone rise and fall time */ #define RATE 11025.0 /* sample rate */ #define numberof(n) (sizeof(n)/sizeof(*n)) struct { char letter; double f1, f2; } button[] = { {'1', 697, 1209}, {'2', 697, 1336}, {'3', 697, 1477}, {'A', 697, 1633}, {'4', 770, 1209}, {'5', 770, 1336}, {'6', 770, 1477}, {'B', 770, 1633}, {'7', 852, 1209}, {'8', 852, 1336}, {'9', 852, 1477}, {'C', 852, 1633}, {'*', 941, 1209}, {'0', 941, 1336}, {'#', 941, 1477}, {'D', 941, 1633}, {'X', 20, 20}, {'Y', 100, 100}, {'Z', 500, 500}, }; int main(void) { double t, v=0; char c; int value=0, n; FILE *fout; puts("Press 123A456B789C*0#D to digitize DTMF-tones to file. Fs=11025. ESC quits."); fout = fopen("x", "wb"); while (1) { c = toupper(getch()); if (c == 0x1B) break; for (n=0; n<numberof(button); n++) { if (c==button[n].letter) { putchar(c); for (t=0.0; t<TON; t+=1/RATE) { v = sin(2*M_PI*button[n].f1*t) + sin(2*M_PI*button[n].f2*t); if (t<RAMP) /* See Note Below */ v *= t/RAMP; /* See Note Below */ if (t>TON-RAMP) /* See Note Below */ v *= (TON-t)/RAMP; /* See Note Below */ #if NOISE value = floor(v*(BITS/4)+BITS/2) + (value&~BITS); #else value = floor(v*16383+32768.5); #endif fputc((value&BITS)>>8, fout); } for (t=0.0; t<TOFF; t+=1/RATE) fputc(0x80, fout); } } } putchar('\n'); fclose(fout); return 0; } v *= (TON-t)/RAMP; #if NOISE value = floor(v*(BITS/4)+BITS/2) + (value&~BITS); #else value = floor(v*16383+32768.5); #endif fputc((value&BITS)>>8, fout); } for (t=0.0; t<TOFF; t+=1/RATE) fputc(0x80, fout); } } } putchar('\n'); fclose(fout); return 0; }
Do you understand the noise shaper? It's a more advanced concept. The effect is subtle, and it's not required for DTMF use. It was just a fun experiment :-)