Script: Playing Dial Tones with Pmod KYPD (Under Construction)

Under Construction

Introduction

This script streams key press data from the Pmod KYPD and generates the dial tones land-line telephones use to dial a number. The output signal can be heard using the 3.5mm headphone jack found on the Analog Discovery series, or accessed via the Wavegen outputs.

The KYPD uses pull up and pull down resistors to determine which rows and columns have closed switches, correlating to button presses. See “diagram.pdf” for the KYPD circuit diagram. The Analog Discovery detects button presses by scanning through DIO pins 0-4, representing the columns. These pins are set as open drains, so when the Analog Discovery 2 activates a certain pin, it provides a path to ground. Otherwise, the inactive pins provide a high impedance (high Z) path, like an open circuit. If a key is pressed, DIO pins 4-7 will detect a logic low signal on the row that was selected. By correlating the row and column pins to an array containing the possible characters, the script prints the key presses and determines which tones to play using the waveform generator.

A key tone is generated by simultaneously playing two sine waves at different frequencies. One frequency represents the row, and the other represents the column. This is how analog telephone signals were able to transmit data before digitization. Watch the Waveform Generator window to see it change frequencies as different keys are pressed, and listen via headphones.

Inventory


Setup Instructions

1. Software Setup

Download and extract the WaveForms workspace from the Script Playing Dial Tones with Pmod KYPD ZIP Archive (also linked in the inventory section, above).


2. Hardware Setup

This script requires that Pmod KYPD be connected to the Analog Discovery DIO Pins in the following order (see folder for pinout):

DIO Pin Pmod Pin
DIO-3 1
DIO-2 2
DIO-1 3
DIO-0 4
GND(↓) 5
V+ 6
DIO-7 7
DIO-6 8
DIO-5 9
DIO-4 10

3. Running the Script

Once the connections are made, open the workspace in WaveForms. Press the Run button (or F5) in the Script window. The Script Output window will show the key presses as they're detected. The script is designed so that each time a key is pressed, only a single key press is registered. Use headphones or speakers to listen to the audio output.


4. Stopping the Script

To stop the Script, press Stop button (or F6) in the Script window.


Final Notes

For more guides and example projects for your Test and Measurement device, please visit its Resource Center, which can be found through this wiki's Test and Measurement page.

For more information about how to use the Pmod KYPD featured in this demo, please visit its Resource Center.

For technical support, please visit the Digilent Forums.