DTMF Touch Tone Decoder Using Microchip PIC Microprocessor by LargeMouthBass

Step 9: Source Code

The source code is written in assembly, using the free MPASM tool from Microchip.

The *.asm file contains the entire code used to create the *.hex file attached to Step 1. You should be able to assembly the *.asm file and get a *.hex file that will work exactly like the one I attached originally.


At a high level, the program contains code to do the following:

*Code for the programming process.
*Code for detecting that receipt of the programmed string of DTMF digits.
*Code for the simplified Goertzel algorithm.
*Code for analyzing the results of the Goertzel algorithm to determine if a valid DTMF tone is present.

Peripherals:

The code uses the following peripherals of the PIC 12F683 processor:
*A/D converter
*Timer1 (16 bit timer)
*Internal EEPROM, for storaging the programmed DTMF sequence.

There is no harware serial peripheral on this processor, so I had to implement it in software ("bit banged")

Other Details:

The code is designed for use with an 8MHz external crystal oscillator.
This gives a 2MHz instruction cycle frequency, so each instruction cycle is 0.5 microseconds long. The internal 8MHz oscillator has too high a tolerance (up to 2%) to use for this application.

If you intend to port this to a different PIC processor, you will have to make sure that all the peripherals, registers, and other details are configured properly. There can be slight differences between other very similar PICs.




 
Remove these adsRemove these ads by Signing Up
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!