ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed May 09, 2012 2:23 am |
|
|
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. |
|