Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 30, 2024, 12:50:14 00:50


Login with username, password and session length


Pages: [1]
Print
Author Topic: DTMF  (Read 7462 times)
0 Members and 3 Guests are viewing this topic.
ph_cabral
Guest
« on: February 05, 2008, 03:32:54 15:32 »

   
I need help develop a program to generate a DTMF, through a door of the PWM pic, someone would have a suggestion.

I have that site but for atmel and I want one with pic

http://Http://www.infidigm.net/projects/dtmf2/

Thanks
Logged
jeanninemtv
Senior Member
****
Offline Offline

Posts: 311

Thank You
-Given: 57
-Receive: 25


« Reply #1 on: February 07, 2008, 04:16:43 04:16 »

use pbp or proton++ command dtmfout
and a good filter
Logged
mayler
Junior Member
**
Offline Offline

Posts: 68

Thank You
-Given: 14
-Receive: 13


Roger that!


WWW
« Reply #2 on: March 12, 2008, 12:21:36 00:21 »

Read this application note :
http://ww1.microchip.com/downloads/en/AppNotes/00655a.pdf
Logged

Computer Engineer.
Digital IC Designer - Cadence certified.
ppa88
Active Member
***
 Muted
Offline Offline

Posts: 200

Thank You
-Given: 49
-Receive: 131


« Reply #3 on: March 12, 2008, 06:51:36 18:51 »

I know you want to use PWM for DTMF generation and the app note AN655 will help you to achieve this. But I just want to mention here that if you have scope to  use an alternative in your design, then you can use a hardware DTMF generator which is much more reliable. I would suggest UM91531 which I have recently used very successfully in a design. It has a very simple interface to a microcontroller.
Logged
veiledcavalier
Newbie
*
Offline Offline

Posts: 11

Thank You
-Given: 8
-Receive: 0


« Reply #4 on: March 14, 2008, 10:43:48 22:43 »

yeh hardware DTMF is very very dependable i used it,
the one i used is HT9170B
from datasheet u can find the schematic of connection with capacitors, crystal ,.....
Logged
jasonix
Newbie
*
Offline Offline

Posts: 12

Thank You
-Given: 48
-Receive: 3


« Reply #5 on: March 27, 2008, 06:16:13 18:16 »

hey ph_cabral if you are looking for still for a dtmf routine,you can search for pic list at www and i sure you will find something usefull for your project

cheers!!!
Logged
jeanninemtv
Senior Member
****
Offline Offline

Posts: 311

Thank You
-Given: 57
-Receive: 25


« Reply #6 on: March 27, 2008, 07:54:26 19:54 »

i finished dtmf adapting circuit for dtmfout

very similar to the talking electronics circuits but i added one npn stage for wave shaping...
Logged
quadro
Newbie
*
Offline Offline

Posts: 18

Thank You
-Given: 3
-Receive: 3


« Reply #7 on: March 27, 2008, 09:34:22 21:34 »

ph_cabral,
From the link that you wrote in you post I can see that it is a DTMF decoder with AVR.
You said that you have a circuit with Atmel but that you would like to use PIC for the same thing.
I am now confused since you are asking for DTMF generator with PIC.
Maybe I did miss something but what do you need:
1. DTMF coder
2. DTMF decoder

BR
Logged
kami_kami
Inactive

Offline Offline

Posts: 5

Thank You
-Given: 1
-Receive: 0


« Reply #8 on: April 18, 2008, 01:24:43 13:24 »

use mt8870
Logged
fr5cu
Guest
« Reply #9 on: April 24, 2008, 08:44:12 08:44 »

ph_cabral,

You can use SSI202 to décode DTMF.


Posted on: April 24, 2008, 09:30:48 09:30 - Automerged

Hi ph_cabral,

put "PWM DTMF on a PIC" in google and you have the solution.


Posted on: April 24, 2008, 09:39:26 09:39 - Automerged

You can use PCD3312 with I1C bus!
Logged
EDSONCT
Junior Member
**
Offline Offline

Posts: 36

Thank You
-Given: 72
-Receive: 5


WWW
« Reply #10 on: April 24, 2008, 11:05:55 11:05 »

// DTMF.C

#define  T2CON    0x12
#define  TMR2ON   0x02
#define  RP0      0x05

struct DTMF_Type
{
   unsigned int HighFreq_Pointer;// Pointer for high frequency band, points to sinusoidal pattern
   unsigned int LowFreq_Pointer; // Pointer for low  frequency band, points to sinusoidal pattern
   unsigned int HighFreq_Offset; // Offset necessary to give the wave frequency to HF Pointer
   unsigned int LowFreq_Offset;  // Offset necessary to give the wave frequency to LF Pointer
   long     int Tone_Duration;   // Tone duration
   short    int Active;
} DTMF_Generator;

// The keypad has the tones as follows:
//
//                1209  1336  1477  1633
//                  1     2     3     A   697
//                  4     5     6     B   770
//                  7     8     9     C   852
//                  *     0     #     D   941
//
// To assembly the sinusoidal wave form with these frequencies
// from the sinusoidal pattern table Sine, we step an offset a fixed
// time, as follow below:
//
//                   697 Hz -> Offset 09
//                   770 Hz -> Offset 10
//                   852 Hz -> Offset 11
//                   941 Hz -> Offset 12
//                  1209 Hz -> Offset 15
//                  1336 Hz -> Offset 17
//                  1477 Hz -> Offset 19
//                  1633 Hz -> Offset 21

#define  O_0697  9
#define  O_0770 10
#define  O_0852 11
#define  O_0941 12
#define  O_1209 15
#define  O_1336 17
#define  O_1477 19
#define  O_1633 21

const unsigned int Offsets [32]={O_0941,O_1336, // '0' -> 941 and 1336
                                 O_0697,O_1209, // '1' -> 697 and 1209
                                 O_0697,O_1336, // '2' -> 697 and 1336
                                 O_0697,O_1477, // '3' -> 697 and 1477
                                 O_0770,O_1209, // '4' -> 770 and 1209
                                 O_0770,O_1336, // '5' -> 770 and 1336
                                 O_0770,O_1477, // '6' -> 770 and 1477
                                 O_0852,O_1209, // '7' -> 852 and 1209
                                 O_0852,O_1336, // '8' -> 852 and 1336
                                 O_0852,O_1477, // '9' -> 852 and 1477
                                 O_0697,O_1633, // 'A' -> 697 and 1633
                                 O_0770,O_1633, // 'B' -> 770 and 1633
                                 O_0852,O_1633, // 'C' -> 852 and 1633
                                 O_0941,O_1633, // 'D' -> 941 and 1633
                                 O_0941,O_1209, // 'E' -> 941 and 1209
                                 O_0941,O_1477};// 'F' -> 941 and 1477

const unsigned int Sine [256]=
{ 64, 65, 67, 68, 70, 71, 73, 74, 76, 77, 79, 80, 82, 83, 85, 86,
  88, 89, 91, 92, 93, 95, 96, 97, 99,100,101,103,104,105,106,107,
 108,109,111,112,113,114,115,115,116,117,118,119,120,120,121,122,
 122,123,123,124,124,125,125,125,126,126,126,127,127,127,127,127,
 127,127,127,127,127,127,126,126,126,125,125,125,124,124,123,123,
 122,122,121,120,120,119,118,117,116,115,115,114,113,112,111,109,
 108,107,106,105,104,103,101,100, 99, 97, 96, 95, 93, 92, 91, 89,
  88, 86, 85, 83, 82, 80, 79, 77, 76, 74, 73, 71, 70, 68, 67, 65,
  64, 62, 60, 59, 57, 56, 54, 53, 51, 50, 48, 47, 45, 44, 42, 41,
  39, 38, 36, 35, 34, 32, 31, 30, 28, 27, 26, 24, 23, 22, 21, 20,
  19, 18, 16, 15, 14, 13, 12, 12, 11, 10,  9,  8,  7,  7,  6,  5,
   5,  4,  4,  3,  3,  2,  2,  2,  1,  1,  1,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  1,  1,  1,  2,  2,  2,  3,  3,  4,  4,
   5,  5,  6,  7,  7,  8,  9, 10, 11, 12, 12, 13, 14, 15, 16, 18,
  19, 20, 21, 22, 23, 24, 26, 27, 28, 30, 31, 32, 34, 35, 36, 38,
  39, 41, 42, 44, 45, 47, 48, 50, 51, 53, 54, 56, 57, 59, 60, 62};

void DTMF_ExecuteTone (unsigned int tone);
void DTMF_Setup (void);
void DTMF_DutyUpdate (void);

void DTMF_ExecuteTone (unsigned int tone)
{
   DTMF_Generator.HighFreq_Offset = Offsets [2*tone];
   DTMF_Generator.LowFreq_Offset  = Offsets [2*tone+1];

   DTMF_Generator.HighFreq_Pointer = 0;
   DTMF_Generator.LowFreq_Pointer  = 0;

   DTMF_Generator.Tone_Duration = 0;

   enable_interrupts (INT_TIMER2);

   setup_ccp2 (CCP_PWM_PLUS_2);  // Configures PWM with 2 Duty LSBs to B'10' (mean value).
   set_pwm2_duty (127>>2);       // Set duty initial value to 0 (Duty 50%).
   set_timer2 (0);               // Clears Timer 2.
   setup_timer_2 (T2_DIV_BY_1, 0x3F, 4);  // Configures Timer 2 to 78,12 KHz.

   return;
}

void DTMF_DutyUpdate (void)
{
   set_pwm2_duty ((Sine[DTMF_Generator.HighFreq_Pointer]>>2)+
                  (Sine[DTMF_Generator.LowFreq_Pointer ]>>2));

   DTMF_Generator.HighFreq_Pointer += DTMF_Generator.HighFreq_Offset;
   DTMF_Generator.LowFreq_Pointer  += DTMF_Generator.LowFreq_Offset;

   return;
}

void DTMF_TurnOff (void)
{
   disable_interrupts (INT_TIMER2);
#asm
   bcf   STATUS,RP0
   bcf   T2CON,TMR2ON
#endasm
   return;
}
Logged
bxngoc
Newbie
*
Offline Offline

Posts: 9

Thank You
-Given: 2
-Receive: 1


« Reply #11 on: May 02, 2008, 06:54:44 06:54 »

I'm going to build a telephone dialer use MT8880 and found a lot similar project. I quote some  MT8880 functions for your reference.
Code:
#define  _MT8880_C

/***************************************************************
* Name: Void MT8880_WC (Byte com);
* Function: Writes control register CRA or the CRB
* intake conditions: Com-- must read in data
* exportation parameter: Does not have
* the date: 2,006 - 11 - 23 - test - ljj - ok!
****************************************************************/

void MT8880_WC(unsigned char com)
{
       
         MT_Staut=DDRC|0xF0// causes PC4~PC7 to output
        MT_SDataBus=PORTC|0xF0;
        delay_ms(20);
        MT_CS_L;
        MT_RS0_H;delay_ms(20);
        MT_RW_L;delay_ms(20);
        delay_ms(20);
        com&=0xF0;
      delay_ms(20);       
        MT_SDataBus&=0x0F;
        delay_ms(20);
        MT_CLK_H;
        MT_SDataBus|=com;
        delay_ms(20);       
        MT_CLK_L;       
        MT_CS_H;
}

/***************************************************************
* Name: Void MT8880_WD (Byte dat);
* Function: Writes MT8880 the transmission data register
* intake conditions: Dat-- must transmit data
* exportation parameter: Does not have
****************************************************************/

void MT8880_WD(unsigned char dat)
{
       
         MT_Staut=DDRC|0xF0;//Causes PC4~PC7 to output
        MT_SDataBus=PORTC|0xF0;       
        MT_CS_L;
      delay_ms(20); 
        MT_RS0_L;
      delay_ms(20);         
        MT_RW_L;       
        delay_ms(20);
        dat&=0xF0;
        MT_SDataBus&=0x0F;       
        MT_CLK_H;delay_ms(20);
        MT_SDataBus|=dat;
        delay_ms(20);       
        MT_CLK_L;       
        delay_ms(20);
        MT_CS_H;
       
}

/***************************************************************
* Name: Byte MT8880_RD (void);
* Function: Reads MT8880 the receive data register
* intake conditions: Does not have
* the exportation parameter: Temp-- read-out data, low 4 effectiveness
****************************************************************/

unsigned char MT8880_RD(void)
{
        unsigned char temp;       
         MT_Staut=DDRC&0x0F;//Causes PC4~PC7 to input
        delay_ms(10);         
        MT_CS_L;  delay_ms(10);   
        MT_RS0_L;
        MT_RW_H;  delay_ms(10);
        MT_CLK_H; delay_ms(10);
        PORTC=0XF0;         
        temp=PINC;delay_ms(10);             
        MT_CLK_L;       
        MT_CS_H;       
       
        return(temp);
}

/***************************************************************
* Name: Byte MT8880_RS (void);
* Function: Reads MT8880 the condition register
* intake conditions: Does not have
* the exportation parameter: Temp-- read-out data, low 4 effectiveness
****************************************************************/   

unsigned char MT8880_RS(void)
{
        unsigned char temp;
               
         MT_Staut=DDRC&0x0F;//使PC4~PC7输入
        MT_SDataBus=PORTC|0xF0;       
        MT_CS_L;  delay_ms(20);
        MT_RS0_H; delay_ms(20);     
        MT_RW_H;  delay_ms(20); MT_CLK_H;
                  delay_ms(40);         
        temp=MT_RDataBus&0xF0;       
        delay_ms(20);
        MT_CLK_L;       
        delay_ms(20);
        MT_CS_H;
        return(temp);
}
/***************************************************************
* Name: Void InitMT8880 (Byte mode);
* Function: Initialization MT8880, severance permission, double sound pattern
* intake conditions: Mode may choose CP8880, DTMF8880, the RST8880 three parameters
* exportation parameter: Does not have
****************************************************************/
void InitMT8880(unsigned char mode)
{       
      MT8880_RS();
        MT8880_WC(0x00);delay_ms(50);               
        MT8880_WC(0x00);delay_ms(50);         
        MT8880_WC(mode);delay_ms(50);               
        MT8880_WC(0x00);delay_ms(50);               
        MT8880_RS();                   
               
        delay_ms(20);
}
Logged
kittikhun
Inactive

Offline Offline

Posts: 6

Thank You
-Given: 0
-Receive: 0


« Reply #12 on: May 07, 2008, 10:18:09 10:18 »

I use mt8870 with PIC18F458 it Work well and easy
Logged
zawmintun1
Active Member
***
Offline Offline

Posts: 138

Thank You
-Given: 2142
-Receive: 26


« Reply #13 on: June 10, 2008, 04:51:42 04:51 »

Please SCH & Code
Logged
ta2lt
Guest
« Reply #14 on: June 18, 2008, 02:34:33 14:34 »

please dtmf decoder pic versiyon
Logged
lillbear
Senior Member
****
Offline Offline

Posts: 276

Thank You
-Given: 223
-Receive: 182



« Reply #15 on: June 18, 2008, 06:13:41 18:13 »

I'm going to build a telephone dialer use MT8880 and found a lot similar project. I quote some  MT8880 functions for your reference.

So MCU type PIC AVR i assume AVR? Compiler GCC or commersial?

yours
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC