PIC dialer

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
nmindana
Posts: 82
Joined: Thu Nov 18, 2010 5:00 pm
Has thanked: 52 times
Been thanked: 5 times
Contact:

PIC dialer

Post by nmindana »

Hi Can anyone help.

Is it possible to generate DTMF tones as part of a dialer circuit using PIC and flowcode.
any ideas will be much appriciated.

thanks in advance

Indana

nmindana
Posts: 82
Joined: Thu Nov 18, 2010 5:00 pm
Has thanked: 52 times
Been thanked: 5 times
Contact:

Re: PIC dialer

Post by nmindana »

Hi All,

Found useful article :

http://iiuhassan.wikispaces.com/file/vi ... ROJECT.pdf


Found a programme written in C+
Problem is I don't know the above. Just wondered if any knows how to interpret this ? :wink:



#include <16F877.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)// Jumpers: 8 to 11, 7 to 12

CONST unsigned int SINE_WAVE[200] = { 128,132,136,139,143,147,150,154,158,161,165,169,172,176,179, 182,186,189,192,195,199,202,204,207,210,213,215,218,220,223, 225,227,229,231,233,235,237,238,240,241,242,243,244,245,246, 247,247,247,248,248,248,248,248,247,247,247,246,245,244,243, 242,241,240,238,237,235,233,231,229,227,225,223,220,218,215, 213,210,207,204,202,199,195,192,189,186,182,179,176,172,169, 165,161,158,154,150,147,143,139,136,132,128,124,120,117,113, 109,106,102, 98, 95, 91, 87, 84, 80, 77, 74, 70, 67, 64, 61, 57, 54, 52, 49, 46, 43, 41, 38, 36, 33, 31, 29, 27, 25, 23, 21, 19, 18, 16, 15, 14, 13, 12, 11, 10, 9, 9, 9, 8, 8, 8, 8, 8, 9, 9, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 21, 23, 25, 27, 29, 31, 33, 36, 38, 41, 43, 46, 49, 52, 54, 57, 61, 64, 67, 70, 74, 77, 80, 84, 87, 91, 95, 98,102,106, 109,113,117,120,124};

int index1,index2,inc1,inc2;

#INT_RTCC void wave_generator() { int wave = 0; set_rtcc(25); // when clock is 20MHz, interrupts every 100us
wave = ((long)SINE_WAVE[index1]+(long)SINE_WAVE[index2])/2;

output_d(wave);
index1 += inc1;
index2 += inc2;

if(index1 >= 200) index1 -= 200;
if(index2 >= 200) index2 -= 200;

}

#define DTMF_ROW1 14 // for 700 Hz, increment this many times every 100us #define DTMF_ROW2 15 // for 750 Hz, increment this many times every 100us #define DTMF_ROW3 17 // for 850 Hz, increment this many times every 100us #define DTMF_ROW4 19 // for 950 Hz, increment this many times every 100us #define DTMF_COLA 24 // for 1200 Hz, increment this many times every 100us #define DTMF_COLB 27 // for 1350 Hz, increment this many times every 100us #define DTMF_COLC 30 // for 1500 Hz, increment this many times every 100us

void generate_dtmf_tone(char keypad, long duration)

{

index1=0;
index2=0; inc1=0;
inc2=0;
if((keypad=='1')||(keypad=='2')||(keypad=='3')) inc1=DTMF_ROW1; else if((keypad=='4')||(keypad=='5')||(keypad=='6')) inc1=DTMF_ROW2;
else if((keypad=='7')||(keypad=='8')||(keypad=='9'))
inc1=DTMF_ROW3; else if((keypad=='*')||(keypad=='0')||(keypad=='#'))
inc1=DTMF_ROW4;

if((keypad=='1')||(keypad=='4')||(keypad=='7')||(keypad=='*')) inc2=DTMF_COLA; else if((keypad=='2')||(keypad=='5')||(keypad=='8')||(keypad=='0')) inc2=DTMF_COLB; else if((keypad=='3')||(keypad=='6')||(keypad=='9')||(keypad=='#')) inc2=DTMF_COLC;

setup_counters(RTCC_INTERNAL,RTCC_DIV_2);
enable_interrupts(INT_RTCC);
enable_interrupts(GLOBAL);

while(duration-- > 0)
{
delay_ms(1);
}
disable_interrupts(INT_RTCC);
output_d(0);
}

nmindana
Posts: 82
Joined: Thu Nov 18, 2010 5:00 pm
Has thanked: 52 times
Been thanked: 5 times
Contact:

Re: PIC dialer

Post by nmindana »

Hi Martin,

Can you help ?

regards

Indana :(

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: PIC dialer

Post by Benj »

Hello,

Have you seen this forum topic it gives suggestions on how DTMF might be achieved.

http://www.matrixmultimedia.com/mmforum ... =29&t=7459

MW
Posts: 38
Joined: Mon Feb 26, 2007 2:04 am
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: PIC dialer

Post by MW »

Hi,

If you can I would suggest using a separate DTMF chip. I have used a couple of different ones but the Holtek HT9200B used in parallel mode is a particularly simple device to incorporate into a Pic/Flowcode Project.

Good Luck
MW

nmindana
Posts: 82
Joined: Thu Nov 18, 2010 5:00 pm
Has thanked: 52 times
Been thanked: 5 times
Contact:

Re: PIC dialer

Post by nmindana »

Hi Thanks,

Have you got a working model, would you be able to post fcf file :!:

regards


Indana

MW
Posts: 38
Joined: Mon Feb 26, 2007 2:04 am
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: PIC dialer

Post by MW »

Hi,

Unfortunately that was a few PC's ago and I don't appear to have archived any of those file. I have done a really quick & dirty example of how to output a DTMF 7 using the Holtek 9200B in parallel mode. Hopefully this will give you enough to go on with.

This example, using a 16F877A, assumes:

The Holtek is in parallel mode (pin 10 tied high).

Holtek ----------->PIC
CE ---------------> D4
D0----------------->D0
D1----------------->D1
D2----------------->D2
D3----------------->D3
Attachments
Holtek example.fcf
(4.5 KiB) Downloaded 272 times

nmindana
Posts: 82
Joined: Thu Nov 18, 2010 5:00 pm
Has thanked: 52 times
Been thanked: 5 times
Contact:

Re: PIC dialer

Post by nmindana »

Many thanks MW,

I will let you know how I got on.

regards :)

Indana

Post Reply