The user must be able to type in letters A-Z, and numbers 0-9 totaling to at least 36 buttons. Since the keypad we used only has 16 buttons, we enable extra alphabets by introducing up and down keys allowing alternatives to each button. The up, down, enter, and mode switch buttons must be accessible at all times, while the remaining 12 buttons can be traversed up to 4 stages (48 alphabets). The mapping of the keypad is shown in the table below, which corresponds to the keypad used by most phones.
We used two ports on STK500 to generate two sine waves with different frequencies. The sine wave has 16 samples in one period and each sample is as accurate as 8-bit. Therefore, two 8-bit DACs were built and connected to PORTB and PORTD of STK500. Since the signals coming out of the DACs are analog, we need an analog adder to sum up the sine waves. The LM7111 Op-Amp was used to build such adder. The output of the Op-Amp will be connected to the DTMF decoder to detect the phone number dialed.
The DTMF decoder gets the DTMF signal from the analog adder. It has 4 output pins D1, D2, D4 and D8 and different combination of these pins corresponds to different tone. In addition, there is also an output pin called DV which will be set to 1 when the input is a valid DTMF signal and otherwise will be set to zero. The mapping of D1, D2, D4 and D8 is shown in the following table.