EE 476: Laboratory 5

Sinewave generator.


You will produce a sinewave generator which is controlled by a 16-key keypad and which shows the frequency on a LCD display.


You will need to build a simple digital-to-analog converter as shown below.

The Liquid Crystal Display (LCD):

A 16 character, two line (16x2), LCD display will show the frequency for the sinewave generator. The display we are using has an industry-standard interface. A more detailed data sheet for a similar display shows the command set. There are several aspects of the display you should note:

Here is a sample C code which outputs a sinewave of a user-selectable, fixed frequency. The program organization page has an example of squarewave synthesis in C and ASM. The same program is recoded using a mixture of C and ASM (as you will need to do for this assignment).

Be sure to read the serial communication page if you are going to debug using the time-honored printf.


Write a program and build a circuit which will:

When you demonstrate the program to a staff member, you should exercise the keypad commands and show that the generated frequency is correct. Full credit will be given only if you can generate sinewaves above 10 kHz (with at least 16 samples/cycle) with an 8 MHz crystal.

Your written lab report should include:

Copyright Cornell University Jan 2002