Step 9: Source Code
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.
The code uses the following peripherals of the PIC 12F683 processor:
*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")
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.