Page 1 of 1

DTMF

Posted: Fri Jun 11, 2010 7:21 am
by Taurus
Hello

How can I generate a DTMF signal with flowcode.
I would like to generate the following signals
The lower group has 4 frequencies; 697 , 770 , 852 and 941 Hz
The higher group has 4 frequenties; 1.209, 1.336, 1.477 and 1.633 Hz
These DTMF tones are similar as from a keypad from a telephone.
I did read that PICBASIC has a function for this, does flowcode this option or is there an example of this.

Maybe something like DTMF (port, bit, timeon, timeoff, Low hz, high hz)
DTMF (B,1,40,40,697,1.209)

Key DTMF Low,High freq
'1 [ 697, 1209 ]. . . . '6 [ 770, 1477 ]. . . . '* [ 941, 1209 ]
'2 [ 697, 1336 ]. . . . 'B [ 770, 1633 ]. . . . '0 [ 941, 1336 ]
'3 [ 697, 1477 ]. . . . '7 [ 852, 1209 ]. . . . '# [ 941, 1477 ]
'A [ 697, 1633 ]. . . . '8 [ 852, 1336 ]. . . . 'D [ 941, 1633 ]
'4 [ 770, 1209 ]. . . . '9 [ 852, 1477 ]
'5 [ 770, 1336 ]. . . . 'C [ 852, 1633 ]

Thanks

Re: DTMF

Posted: Fri Jun 11, 2010 9:17 am
by Benj
Hello Taurus,

You could do this by using a fast timer interrupt and counter variables to generate two square waves at paricular frequencies. Once you have two output pins outputting your required frequencies you can then join the two signals together using diodes to prevent voltage travelling back to the uC. This then becomes your DTMF signal.

Re: DTMF

Posted: Wed Jun 16, 2010 7:05 am
by Taurus
Hello

I did try a lot of things, but I don’t get the right frequencies that I need. Do you have a sample of them, so that I can go on. Otherwise I have to use the HT9200A. I suppose when it is possible with PICBASIC, then Flowcode surely should be able to do it.

Thanks

Re: DTMF

Posted: Wed Jun 16, 2010 7:46 am
by Steve
Here's a link that might help:
http://www.brouhaha.com/~eric/pic/

Another idea is to use PWM to generate one of the signals and a continuous program loop to generate the other on a separate pin, and then combine the pins using diodes as Ben suggested.

Or you could generate the waveforms using multiple lookup tables on the same pin.