CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Problem interfacing pic16f84a with Dtmf generator Ic TP5088!
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
raz



Joined: 22 Feb 2012
Posts: 22

View user's profile Send private message

Problem interfacing pic16f84a with Dtmf generator Ic TP5088!
PostPosted: Sun Apr 15, 2012 10:11 am     Reply with quote

Hey,
I'm currently working on a project to interface pic16f84a to Tp5088 and then to the telephone line to call a number stored in the uc automatically.
Whats confusing me is that in the datasheet of the tp5088 it says that there is a tone enable pin that on transition from low to high it latches the data on the ports D0-D3 (which represent the binary eq. of the number and coming from the pic).
Say I'm dialing 0123...... does that mean that I have to send the binary of zero to the IC then set the tone enable high then low then send the binary of 1 then make the enable high again and so on for each digit?
I can't find the IC model in Proteus or anywhere. That's why I can't try it as software.
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Apr 15, 2012 10:31 am     Reply with quote

Yes, that's what the datasheet timing diagram shows on page 4. The tone
output will continue until Tone Enable goes back low.
_________________
Google and Forum Search are some of your best tools!!!!
raz



Joined: 22 Feb 2012
Posts: 22

View user's profile Send private message

Tp5088
PostPosted: Sun Apr 15, 2012 10:43 am     Reply with quote

Yeah I got so the mute goes with the enable in highs and lows.
Considering the mark and space time of the dtmf is it okay to make 75ms and 75ms [the digit is on for 75ms then wait another 75ms then send the other digit] instead of 40ms and 40ms or does it depend on the telephone system of the country ?

Thanks
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Apr 15, 2012 12:10 pm     Reply with quote

Standard Whelen timing is 40 msec mark with a 20 msec space which I
would expect would apply to most phone systems. You can actually go much
faster than this if required but for compatibility I would not recommend it.
Not sure if slower will cause a problem.
_________________
Google and Forum Search are some of your best tools!!!!
raz



Joined: 22 Feb 2012
Posts: 22

View user's profile Send private message

PostPosted: Sun Apr 15, 2012 12:36 pm     Reply with quote

Okay thanks alot
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sun Apr 15, 2012 5:39 pm     Reply with quote

Longer MARK timing is not much of an issue with most detection chips.

But too short a SPACE can be troublesome with chip sets that use an adaptive
filter.
I prefer 50ms mark and 30 ms space for DTMF and/or CCITT in band signaling.
raz



Joined: 22 Feb 2012
Posts: 22

View user's profile Send private message

PostPosted: Sun Apr 22, 2012 5:25 pm     Reply with quote

Hi again,
I'm done with the circuit and program and connected it to a speaker. I heard pulses so i guess the generator is working fine, but when i connect it to the telephone line the 5v of the regulator drops to 1v and the ics are thus off. So what might be the problem ????
temtronic



Joined: 01 Jul 2010
Posts: 9241
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Apr 22, 2012 5:44 pm     Reply with quote

umm... what kind of DAA are you using? That's the circuit to interface your PIC to the telephone wires??
You cannot just wire the PIC to the lines !!!
Simplest DAA would be a 600r:600r transformer...
raz



Joined: 22 Feb 2012
Posts: 22

View user's profile Send private message

PostPosted: Sun Apr 22, 2012 6:11 pm     Reply with quote

um connecting the output of the generator to a 560 ohm and a bridge rectifier then the telephone lines
raz



Joined: 22 Feb 2012
Posts: 22

View user's profile Send private message

PostPosted: Sun Apr 22, 2012 6:13 pm     Reply with quote

Can I connect the output of my circuit parallel with a telephone set ??
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sun Apr 22, 2012 6:28 pm     Reply with quote

you might want to post the circuit you are trying to use.......
raz



Joined: 22 Feb 2012
Posts: 22

View user's profile Send private message

PostPosted: Mon Apr 23, 2012 2:44 am     Reply with quote

This is the schematic

http://img710.imageshack.us/img710/429/dtmf.png
raz



Joined: 22 Feb 2012
Posts: 22

View user's profile Send private message

PostPosted: Mon Apr 23, 2012 3:08 am     Reply with quote

This is the code in C using PIC C:
Code:

#include <16F84A.h>
#FUSES XT,NOWDT,NOPROTECT,NOPUT
#use delay(clock=4000000)

//Connection
#define Enable PIN_A1
#define Pwr_led PIN_A0
#define Mute pin_a2
#define dial pin_a3
#define D0 pin_b0
#define D1 pin_b1
#define D2 pin_b2
#define D3 pin_b3

void Init(void);

void main (void)
{
    Init();
    output_high(pwr_led);
    output_low(enable);
    output_low(mute);
   while(true)
    {
       if( !input(dial))
       {  // 01017774569
       
     
       //First Digit "0"
       output_b(10);
       output_high(enable);
       output_high(mute);
       delay_ms(50); //mark
       output_low(enable);
       output_low(mute);
       delay_ms(40); //space
       
       //Second Digit "1"
       output_b(1);
       output_high(enable);
       output_high(mute);
       delay_ms(50);
       output_low(enable);
       output_low(mute);
       delay_ms(40);
       
       //Third Digit "0"
       output_b(10);
       output_high(enable);
       output_high(mute);
       delay_ms(50); //mark
       output_low(enable);
       output_low(mute);
       delay_ms(40); //space
       
       //Fourth digit "1"
       output_b(1);
       output_high(enable);
       output_high(mute);
       delay_ms(50);
       output_low(enable);
       output_low(mute);
       delay_ms(40);
       
       //Fifth Digit "7"
       output_b(7);
       output_high(enable);
       output_high(mute);
       delay_ms(50);
       output_low(enable);
       output_low(mute);
       delay_ms(40);
       
       //Sixth Digit "7"
       output_b(7);
       output_high(enable);
       output_high(mute);
       delay_ms(50); //mark
       output_low(enable);
       output_low(mute);
       delay_ms(40); //space
       
       //Seventh Digit "7"
       output_b(7);
       output_high(enable);
       output_high(mute);
       delay_ms(50); //mark
       output_low(enable);
       output_low(mute);
       delay_ms(40); //space
       
       //Eight Digit "4"
       output_b(4);
       output_high(enable);
       output_high(mute);
       delay_ms(50); //mark
       output_low(enable);
       output_low(mute);
       delay_ms(40); //space
       
       //Nineth Digit "5"
       output_b(5);
       output_high(enable);
       output_high(mute);
       delay_ms(50); //mark
       output_low(enable);
       output_low(mute);
       delay_ms(40); //space
       
       //Tenth Digit "6"
       output_b(6);
       output_high(enable);
       output_high(mute);
       delay_ms(50); //mark
       output_low(enable);
       output_low(mute);
       delay_ms(40); //space
       
       //Eleventh Digit "9"
       output_b(9);
       output_high(enable);
       output_high(mute);
       delay_ms(50); //mark
       output_low(enable);
       output_low(mute);
       delay_ms(40); //space
       }
   }
}
  void Init(void)
   {
    //initialize ports
     set_tris_a(0b01000);
     set_tris_b(0);
     port_b_pullups(true);
    output_a(0);
     output_b(0);
   }
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Apr 23, 2012 7:11 am     Reply with quote

your telephone line coupling circuit in the upper RH corner is defective.

1- it can link the floating tel line to your GROUNDED supply, if it were to work at all.
2- it will allow damaging ring voltage into your circuitry w/o a protective
clamp. and actually - the diode arrangement makes no electrical sense at all.

the national semiconductor data sheet for the part illustrates
a simple ( tho not line protected , ring clamped) proper way to connect to
the tel line circuit , showing how audio transformers are your friend.......
raz



Joined: 22 Feb 2012
Posts: 22

View user's profile Send private message

PostPosted: Wed May 09, 2012 1:35 am     Reply with quote

Hey I managed to get an audio xfmr from an old telephone but its not 600 ohm its 200 : 160 and with centertaps. I found an interface ct. connecting 470 ohm along with the xfmr and the telephone. That solved the power problem I had, but the call still can't be placed. The telephone line doesn't seem to recognize the generated tone and keeps giving me that tone that is waiting for you to dial :s:s. What could be the problem ????
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group