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 Previous  1, 2
 
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

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

This is the schematic im using
http://img233.imageshack.us/img233/990/interfacecr.png
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed May 09, 2012 2:23 am     Reply with quote

Here is a reference to just an article with schematics I found about building a DTMF receiving microcontroller circuit: http://www.driveforinnovation.com/build-a-telephone-interface-for-remote-home-automation
The schematics are a starting point for desigining a safe and protected interface circuit.

What happens when you connect your circuit in parallel to a real phone and then use this real phone to listen to the signal on the line? You should be able to hear your DTMF tones. And do these sound similar to the same digits when you press the keys on the real phone?

Then some generic remarks to your coding style:
1) The C-language is case sensitive. The CCS compiler ignores case differences by default, but that is no excuse to become sloppy. You are mixing lower case and capital case in all possible combinations. A good practice is to write constants and defines in all capital words and use lower case for the variables (CamelCase notation is allowed depending on personal preference). But whatever you choose, be consistent.
By adding #case to your program the compiler becomes case sensitive and helps you in writing better programs.

2) When I see a code pattern repeating itself 11 times I get a strong itching feeling. Please write a function to dial a digit. Your code will become shorter and much easier to maintain. Now when you want to make a change to your dialing code you have to make the change at 11 locations, a large risk that you forget to modify one line and you'll spend a lot of time hunting the bug. Even now I see differences in your 11 digit functions, thus proofing my point.
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 Previous  1, 2
Page 2 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