ECE 4760: Laboratory 2

DTMF generator.


You will construct a standard Dual Tone Multi-Frequency (DTMF) generator like those used on any tonch-tone or cell phone. As you press the buttons, the system will play the correct frequencies. The system will record up to 12 digits, then play them back through the DAC to simulate redial. To do this you will have to use Direct Digital Synthesis sampling at a fairly high rate to a DAC, then route the DAC output to speakers.


You will use a keypad to make a DTMF dialer with audio output to a speaker. Analog output will be through a SPI controlled DAC. The analog signal will be DTMF sine wave bursts generated using Direct Digital Synthesis (DDS) technique to one channel of the DAC. An example on the Dev board page (example DAC/DDS example) shows how you might implement a DDS, with the SPI DAC. Your DDS unit must resolve 256 table entries. For this lab, you will need to modulate the amplitude, and you will need to run two simultaneous DDS units and sum them. The sine wave table will need to be scaled to prevent overflow. For high quality audio synthesis, you are going to need to generate audio samples in an ISR based on a timer interrupt running at high rate. You probably will not have time in the ISR to use floating point arithmetic. Note that many of my examples toggle the RA0 line to time the ISR rate. You need to omit that feature, if you attach the keypad to RA0!

You will need to get user input from a keypad, as explained below. You can use either seven pins on the PIC32, or you can use the port-expander to add 16 new i/o pins using the socket that you mounted on the big board.


In this lab and every lab, make sure you are running Protothreads 1_2_2 or later.
I suggest organizing the code as:


Week one required checkpoint

By the end of lab session in week one of the lab you must either have:


  1. Write a Protothreads C program which implements a DTMF generator with the following specifcations:
  2. Connect the DAC output to a speaker audio input (green phone plug, see below) and listen the output.
    This will aid in debugging and is required for the demo.
  3. Demo this program to a staff member. Show that all specifications are met by verifying frequencies with an oscilloscope.
  4. At no time during the demo should you need to press RESET.
  5. Your written lab report should include the sections mentioned in the policy page, and :


Copyright Cornell University September 14, 2018