You will construct a standard Dual Tone Multi-Frequency (DTMF) generator like those used on any tonch-tone phone. In addition, as you enter the phone number using a keypad, the digits will be spoken in English.
Procedure:
You will use a keypad to make a DTMF dialer. Analog output will be in the form of a PWM signal which will be filtered using a simple RC circuit to low pass filter the analog signal. Use a big enough resistor so that you don't load the port pin, and small enough to be below the input resistance of the TV audio input (30 kohm). You should set the RC time constant to more 10 times the period of the PWM, but not big enough to excessively attenuate the DTMF or voice signal. The output of the lowpass filter will go to the audio input of the TV. The PWM signal will be either
You will need to control various intervals of time and generate the PWM signal. I suggest the following timing scheme, but you may use any scheme you want. Timer 0 is used to generate the high speed PWM-based D/A signal necessary for the sound synthesis. The output will be through OC0 (port pin B.3). In PWM mode, each PWM cycle completion is signaled by the overflow interrupt. The timer0 OVFL ISR is therefore used to load a new output compare value for the next audio sample. In this ISR you can also increment a counter to count to 1 mSec. The resulting 1 mSec time base will be used to control all other timing (in the main program, not in the interrupt).
You will need to get user input from a keypad with one of two following configurations. Some keypads have the connector on the top, as shown. Some have them on the bottom. Demonstration keypad scanning code is here. See also the keypad library by Richard West.
Connector: top:8-pin top:9-pin bottom Pin 1 ---- row 1 2 3 A col 1 col 1 Pin 2 ---- row 4 5 6 B col 2 col 2 Pin 3 ---- row 7 8 9 C col 3 col 3 Pin 4 ---- row * 0 # D col 4 col 4 Pin 5 ---- col 1 4 7 * row 1 row 1 Pin 6 ---- col 2 5 8 0 row 2 row 2 Pin 7 ---- col 3 6 9 # row 3 row 3 Pin 8 ---- col A B C D row 4 row 4 Pin 9 ---- (NO CONNECT--common) (a) Each switch shorts one row to one column. (b) Each pin should be connected to one bit of an i/o port. (c) The i/o port pins will be used both as inputs and outputs. When they are inputs, they should have active pullup resistors. (d) On the 9-pin models, do not connect the common lead.
*
button erases the entire stored phone number.
#
button is pressed, the DTMF signal for each digit is produced for 100 millseconds to simulate dialing of the digits.
There should be at least 30 millseconds of silence between each digit.
Freq | 1209Hz | 1336Hz | 1477Hz |
697Hz | 1 | 2 | 3 |
770Hz | 4 | 5 | 6 |
852Hz | 7 | 8 | 9 |
941Hz | * | 0 | # |
*
button (or any button on the STK500) while pressing the buttons 1 through 7 should produce one of seven sine waves for as long as you hold the buttons.