Log in

View Full Version : DTMF and PIC 16F628A



ultramegaok
- 23rd April 2010, 21:31
Hi
I'm really new with DTMF staff and I have been trying to dial a number throught the telephone line, I had tried differents circuits but not one has work succesfully, with the one attached sometimes I have a response from the central but not able to complete the call never.... I'm using PBP with a 16F628A PIC @ 4MHz. any help what am I doing wrong??? Somebody has completed successfully this project with those components???. Is the pic able to give a clear DTMF tone or I have to implement something else besides what the PBP manual shows??

BobK
- 23rd April 2010, 22:19
Hello ultramegaok,

Start by going to www.epanorama.net/circuits/teleinterface.html#audioint. This will be your wealth of knowledge on telephone line interfaces. I can guarantee that your circuit will NOT work. You have to be extremely careful on what you put on the telephone network. I only glanced through this site but I saw a very basic interface circuit that you should be able to construct without too much difficultly.

You can find several PBP telephone line programs at www.melabs.com. Look under sample programs and you will find a program that lets your PIC dial in pulse and DTMF.

I am going away for a few days so I'll check back in Tuesday night. Start reading and have some fun!!

HTH,

BobK

ultramegaok
- 24th April 2010, 00:26
tried this circuit which didn't work too...

BobK
- 28th April 2010, 03:08
Hello, ultramegaok

You will not be able to send any thing out to the phone line through a bridge rectifier!
The only thing the bridge rectifier is good for, on a phone line, is drawing power FROM the phone line to power some circuitry. You need to use a 600:600 isolation transformer. Go to www.microchip.com and lookup application note AN854. There in Figure 1 is an example of what it takes (their engineer's opinion) to communicate over the phone lines using a PIC and a few discrete components.

Pretty much any circuit today uses the transformer to isolate the product from the phone line. There are several alarm dialers on the market that use opto-isolators and P-mos relays to connect to the phone line. Did you look at the site that I listed on my first reply?

BobK

Art
- 28th April 2010, 11:07
You'll be wanting to run your pic at 20MHz to stand a chance of your phone system
recognizing the DTMF tones produced by PicBasic/Pro.
Don't forget to DEFINE OSC 20
The tones produced by the pic aren't a very pure sine wave.

An external DTMF generator chip would be best,
but I have used a 16F84 to dial numbers and navigate DTMF phone menu systems.
One project was an automated thing to retrieve my bank balance over the phone on payday.

ultramegaok
- 28th April 2010, 17:44
Hello, ultramegaok

You will not be able to send any thing out to the phone line through a bridge rectifier!
The only thing the bridge rectifier is good for, on a phone line, is drawing power FROM the phone line to power some circuitry. You need to use a 600:600 isolation transformer. Go to www.microchip.com and lookup application note AN854. There in Figure 1 is an example of what it takes (their engineer's opinion) to communicate over the phone lines using a PIC and a few discrete components.

Pretty much any circuit today uses the transformer to isolate the product from the phone line. There are several alarm dialers on the market that use opto-isolators and P-mos relays to connect to the phone line. Did you look at the site that I listed on my first reply?

BobK


Thanks BobK
I have read the website from your first reply which helps me a lot to undertands how telephones work, I was trying to avoid the transformer because I don't have one on hand rigth now, but I think I need to go to radioshack and get one. That seams the most safest way to connect the pic...... I let you now my progress...Checking AN854.

ultramegaok
- 28th April 2010, 17:47
You'll be wanting to run your pic at 20MHz to stand a chance of your phone system
recognizing the DTMF tones produced by PicBasic/Pro.
Don't forget to DEFINE OSC 20
The tones produced by the pic aren't a very pure sine wave.

An external DTMF generator chip would be best,
but I have used a 16F84 to dial numbers and navigate DTMF phone menu systems.
One project was an automated thing to retrieve my bank balance over the phone on payday.

Thanks Art for the Tip
I will try at 20MHz.....by the way , I like your website......

Angus Anderson
- 28th April 2010, 21:13
Hi ultramegaok

I have done a lot of development accessing the PSTN using Pics and PBP Pro
First of all, the DTMF tones out of a PIC are dreadful as produced on the pin - you need to clean them up with an active low pass filter. This will remove all t he nasty higher order stuff that clogs it and will produce a pretty good DTMF waveform. Using a single opamp 2nd order filter, I was able to shape and send tones without problems, and have them accepted at destination. And yes, clock at 20Mhz minimum to make the waveforms acceptable

Eish! (as we say in South Africa before the World Cup). You need an audio transformer and what is called an "active Gyrator" with a single transistor to match to a PSTN line. Will gladly send design tips

You want to receive DTMF with a PIC? Good luck. It's vastly more complicated, so rather use an industry standard IC like the MT8870 decoder IC. The Microchip website has an application note that decodes DTMF, but it looks like complicated software

Will gladly send u the details on the low pass filter if that interests you.

regards

Angus Anderson
KwaZulu Natal, South Africa

ultramegaok
- 29th April 2010, 00:51
Hi ultramegaok

I have done a lot of development accessing the PSTN using Pics and PBP Pro
First of all, the DTMF tones out of a PIC are dreadful as produced on the pin - you need to clean them up with an active low pass filter. This will remove all t he nasty higher order stuff that clogs it and will produce a pretty good DTMF waveform. Using a single opamp 2nd order filter, I was able to shape and send tones without problems, and have them accepted at destination. And yes, clock at 20Mhz minimum to make the waveforms acceptable

Eish! (as we say in South Africa before the World Cup). You need an audio transformer and what is called an "active Gyrator" with a single transistor to match to a PSTN line. Will gladly send design tips

You want to receive DTMF with a PIC? Good luck. It's vastly more complicated, so rather use an industry standard IC like the MT8870 decoder IC. The Microchip website has an application note that decodes DTMF, but it looks like complicated software

Will gladly send u the details on the low pass filter if that interests you.

regards

Angus Anderson
KwaZulu Natal, South Africa

Thanks for the information Angus, could you share the low pass filter circuit that you use before...my project is only to send DTMF (just Dialing)

my email is [email protected].


Greeting from Mexico!!!!

I think my futbol team is going to be in the inaugural game against your team in the wolrd cup

abdulmueed
- 31st January 2013, 14:24
Thanks for the information Angus, could you share the low pass filter circuit that you use before...my project is only to send DTMF (just Dialing)

my email is [email protected].


Greeting from Mexico!!!!

I think my futbol team is going to be in the inaugural game against your team in the wolrd cup

please if you got the solution please tell me too i am also stuck.. i also have to generate DTMF dail tone to call through phone line using pic.. i am using pic 16f877a with 20mhz crystal.. in my programmer i have dtmfout instruction.. i can write dtmfout porta.0, [3] and it will generate dtmf for numbe 3 at porta.0 and it is generating tones but those tones are not working properly.. with ptcl and even if i try to decode those tones using mt8870 the ic is not decoding the tones i don't know about how to filter those please mail me too about how to filter or how to make it work
my email is
[email protected]