Searching \ for 'DTMF Tones? Can somebody explain how I make sound' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/pots/dtmf.htm?key=dtmf
Search entire site for: 'DTMF Tones? Can somebody explain how I make sound'.

Truncated match.
PICList Thread
'DTMF Tones? Can somebody explain how I make sound'
1999\11\10@194556 by Darren King

flavicon
face
I would like to write some code to make DTMF tones.  However I can't figure
out even how to produce noise.  I have to hook up a capaciter or
something...  I can't find any sample circuits and then even if I did.  What
do I send?  A pulse of some sort?

Darren King

1999\11\10@202751 by Keith Causey

picon face
There is an application note from Microchip that is on their webpage and in
their applications manual. It explains the theory and describes the hardware
in detail.

> I would like to write some code to make DTMF tones.  However I can't
figure
> out even how to produce noise.  I have to hook up a capaciter or
> something...  I can't find any sample circuits and then even if I did.
What
> do I send?  A pulse of some sort?
>
> Darren King

1999\11\10@203002 by Dave VanHorn

flavicon
face
> I would like to write some code to make DTMF tones.  However I can't
figure
> out even how to produce noise.  I have to hook up a capaciter or
> something...  I can't find any sample circuits and then even if I did.
What
> do I send?  A pulse of some sort?


This is one that might be better done in an external chip.

You need to produce two tones, that have no harmonic relationship, with
fairly low harmonic content or distortion.   If all you want is simething
that works  most of the time, then you can get there with a resistive ladder
D/A and following lowpass filter. If you want to get part 68 (or foreign
telco) approval, then the external chip, or micro with onboard dedicated
hardware is the easy way to go. Cost, about $1.  My favorite is the
EFG71891, an 8 pin DIP that needs power, three proc pins (can share one) and
a crystal and resistor.

Doing it externally also means more CPU left for doing other things.

The specs for the tones are widely available, and are in the EFG datasheet.
Email me if you want it, and I'll send it off the list.

1999\11\10@225323 by Tracy Smith

picon face
--- Dave VanHorn <spam_OUTdvanhornTakeThisOuTspamCEDAR.NET> wrote:
> > I would like to write some code to make DTMF
> tones.  However I can't
> figure
> > out even how to produce noise.  I have to hook up
> a capaciter or
> > something...  I can't find any sample circuits and
> then even if I did.
> What
> > do I send?  A pulse of some sort?
>
>
> This is one that might be better done in an external
> chip.

I disagree. It might be easier if you have no idea how
to do it, but that's why people ask questions...

I can think of several ways. Probably the easiest
would be to generate two sinusoidally modulated PWM
wave forms on two I/O pins, add them together through
a resistor network and low-pass filter them. Eric
Smith has a fast algorithm for generating sine waves,
while Scott Dattalo has one that based on phase
accumulators (and consequently easier to control the
frequency). Either of these may be used to generate
the two sine waves corresponding to the two tones.
Generating two pwm wave forms in software is more
challenging, but it CAN be done. I believe Lawrence
and again Scott have posted software pwm algorithms.

I suspect (but don't have the time to show) that one
could combine the sinusoids digitally (as opposed to
an analog based summer). For example, the pwm duty
cycle could be formed by adding the sine waves
together. In other words, for every PWM cycle the duty
cycle is the proportional to the sum of the amplitudes
of the two sinusoids comprising the DTMF tone.

You'll want to use phase accumulators to minimize
frequency errors and you'll need low-pass filters to
filter the PWM signal to remove the carrier. IIRC, a
single cycle resolution, 256 level PWM waveform on a
20MHZ pic has a carrier frequeny just under 20khz.
This would give you about 12 samples for the highest
DTMF frequency.

.lo

=====

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

1999\11\11@002847 by Wagner Lipnharski

picon face
Tracy Smith wrote:
>
> --- Dave VanHorn <.....dvanhornKILLspamspam@spam@CEDAR.NET> wrote:
> > > I would like to write some code to make DTMF
> > tones.  However I can't
> > figure
> > > out even how to produce noise.  I have to hook up
> > a capaciter or
> > > something...  I can't find any sample circuits and
> > then even if I did.
> > What
> > > do I send?  A pulse of some sort?
> >
> >
> > This is one that might be better done in an external
> > chip.
>
> I disagree. It might be easier if you have no idea how
> to do it, but that's why people ask questions...

Yes and No. Perhaps "May be".

I used both versions in different situations. The external chip should
be used when the µC is not able to dedicate processing cycles to
generate it.  The software solution was using a sine wave table 128
entries per 180 senoidal degrees (PI), yes, ok, I could use only 64 for
90 degrees and reverse the scan for the even quadrants, but it had lots
of code memory available, so it was easy... then it needs to be reversed
signal polarity for quadrants 3 and 4.  The table had values between 0
and 7Fh, value added to 80h for quadrants 1 and 2, and subtracted from
80h for quadrants 3 and 4.

Then it was the tricky and laborious part; find the "skipping" sequence
and pseudo-delays for each one of the DTMF frequencies.  It means, for a
lower frequency, the scanning routine skip less bytes at the table, for
faster frequencies, the scanning was doing large skips.

The DTMF routine has only two counters to point different table
positions, and the increment of this counters are based on the skip
factor.  It read both table values, invert it for quadrants 3 and 4,
shift each one right (divide by 2) and add both. The composite wave form
was done.  A PWM or a direct DAC (resistor ladder) was to be used, used
the ladder for efficiency and speed. This routine got very small.

The sine table was used to generate lots of other signals at the device
operation through the telephone, and play with decreasing and increasing
senoidal level was piece of cake.    

Then I tested it using only 16 analog levels (4 bits), worked the same
way of 128 levels (7 bits), but then, why force nature? someday,
somewhere, it could fail, so left it with 7 bits...

The R-2R resistor ladder solution is simple because you only need to
purchase 24 equal resistors, precision to the value is not important,
they need to have *some* precision between them, what is normally easy
to happens when they are from the same production lot.

Several other solutions using 8 bits DAC is also possible, but them...
another chip?  why then not use the DTMF generator chip? :)

Wagner.

1999\11\11@005627 by Dave VanHorn

flavicon
face
> > This is one that might be better done in an external
> > chip.
>
> I disagree. It might be easier if you have no idea how
> to do it, but that's why people ask questions...

Been there, done that, both ways. The software approach is more difficult,
and takes more attention to the output to achieve "in-spec" spectral purity
and twist. The hardware approach costs more, and leaves more processor
cycles free for other things.

> Generating two pwm wave forms in software is more
> challenging, but it CAN be done. I believe Lawrence
> and again Scott have posted software pwm algorithms.

I didn't say it couldn't be, that would be silly.

> I suspect (but don't have the time to show) that one
> could combine the sinusoids digitally (as opposed to
> an analog based summer).

Yes, did it some years ago on a Z8, with 12 MHz clock (1 mips) while reading
barcodes from a "light pen" wand at the same time. It took some work in
mathcad to get the right resistor values, due to also factoring in the twist
requirement, and the analog filter was a little interesting.

> You'll want to use phase accumulators to minimize
> frequency errors and you'll need low-pass filters to
> filter the PWM signal to remove the carrier.

And you have to set the "twist" properly, which is the relative level
between the two tones. Otherwise, it won't be detected at the CO under all
circumstances.  High tones get attenuated more than low tones over distance,
so you start out with the highs a couple dB hotter than the lows, and the
line "untwists" it.  You can't twist too much, or a close CO can't hear you
properly, too little, and a far CO can't hear you.  Get it right, and it
works all the time, even on crappy lines, like phone equipment should.

1999\11\11@105957 by Tracy Smith

picon face
Wagner,

Phase accumulators in conjunction with look up tables
solve all of the digital synthesis problems you
mention (namely: using 16 or 32 etc sized table to
obtain 128 or 256 or whatever number of samples; phase
accumulators solve [or at least minimize] the jitter
frequency you allude to).

In fact, Eric Smith has already written it:

http://www.brouhaha.com/~eric/pic/dtmf.html

David Thomas has the 2-pin version I alluded to in an
earlier post.

http://www.rt66.com/dthomas/pic/dtmf.txt

Scott Dattalo has the sine generation and phase
accumulators integrated into one program:

http://www.interstice.com/~sdattalo/technical/software/pic/picsine.html

and a software-only pwm routine as well:

http://www.interstice.com/~sdattalo/technical/software/pic/pwm256.txt

And not to be left out, Scenix has some code as well:

http://www.scenix.com/virtual/vp/vplibrary.html#library

A quick search on alta-vista for all documents
containing PIC and DTMF yielded over 1300 URLs.

You really ought to check these out. These people have
solved the problem.

.lo

--- Wagner Lipnharski <wagnerlspamKILLspamEARTHLINK.NET> wrote:
{Quote hidden}

=====

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

1999\11\11@135834 by Lea

picon face
At 07:55 PM 11/10/99 -0800, you wrote:
>I would like to write some code to make DTMF tones.  However I can't figure

Hi Darren, I was on this subject for a while and I think that do it by
software is complicated, specially because you need to make 2 diferent tones
at the time with the lowest harmonic component possible, may be you
should consider to use an external IC, I was using UM91531 , parallel,
works fine with pic but uses 6 pin (4 data, 2 control), may be too much and
also the tone length is fixed, a better one is HT9200A (holtek) serial, only
3 pin (CE/SDA/SCK) tone length is determined by the stop command send serially
so it's very flexible, the only problem is this one makes a very ugly noise
when you start or stop the oscillator (Some kind of TAC (DC peak)), so the
only way that I find is to do the spaces with a 4066 switching the audio
and generating tone continuously, this results in a very clean DTMF output.
there are others DTMF Ics in the market but I just told you my experience
on this 2 IC's...
if you whant more about those 2 chips let me know.
hope it helps, see you.
  Leandro J. Laporta (LU2AOQ)
  mail: EraseMElu2aoqspam_OUTspamTakeThisOuTyahoo.com
  wrk: Arg. Assoc. for Space Technology.
  ham: TCP/IP high speed group HSG


__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

1999\11\17@081401 by Alan Aldaba

flavicon
face
Hi Everyone,

       Sorry, I'm rather late with my info..., Regulus Berdin have some dtmf
generation codes on his page. It uses 2 pins of the 16F84, you just have
to combine them then filter the output. Reggie even help me personally
with his code...Thanx, Reggie :)

http://www.skyinet.net/~ecb/

Darren King wrote:
>
> I would like to write some code to make DTMF tones.  However I can't figure
> out even how to produce noise.  I have to hook up a capaciter or
> something...  I can't find any sample circuits and then even if I did.  What
> do I send?  A pulse of some sort?
>
> Darren King

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...