Hardware Design


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. 

                              Default Level


Third Level

I L O Down
S V Y Enter
UND 0 UND Mode


Second Level

H K N Down
R U X Enter
Z 0 UND Mode


First Level

G J M Down
P T W Enter
Q 0 UND Mode


Default Level

1 2 3 Up
4 5 6 Down
7 8 9 Enter
space 0 Backspace Mode


                                 Third Level


DTMF Generator

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.


DTMF Decoder

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.

Digit D8 D4 D2 D1
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
0 1 0 1 0