DTMF

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Taurus
Flowcode V4 User
Posts: 46
Joined: Tue Feb 23, 2010 3:58 pm
Has thanked: 3 times

DTMF

Post 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
Taurus

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DTMF

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

Taurus
Flowcode V4 User
Posts: 46
Joined: Tue Feb 23, 2010 3:58 pm
Has thanked: 3 times

Re: DTMF

Post 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
Taurus

User avatar
Steve
Matrix Staff
Posts: 3418
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: DTMF

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

Post Reply