EE 576: Laboratory 4
NiosII with microC/OS audio generator.
In this assignment you will implement a video interface to the NiosII processor, including lines and text, then use it to animate a ball dropping. You will use the SOPC builder to construct a NiosII processor, QuartusII to add an audio interface, and the NiosII IDE to write a GCC/microC/OS program to control an audio generator.
- You must handle the boards only on on the ESD mat. These boards are expensive and you must be careful of them.
- Make sure the Altera DE2 board is connected to power and to the PC as specified
in the evaluation board description. Turn on the power supply with the red switch
on the board. Make sure the toggle switch on the left edge of the board marked (
Run/Prog) is in the
Run position and leave it there at all times.
The FPGA will program in the
Run position. Putting the switch in the
Prog position writes your design to flash memory, which you do not want to do.
- The default top level module for the DE2 defines all of the logical i/o signals.
- You can define the mapping from logical signal to FPGA pins (pin assignment in QuartusII) for all the pins at once by importing this file using the menu item
Assignments... Import Assignments... and specifying the file name. There is no need to define pins one-by-one.
- You will need to read the Audio Codec datasheet. See also example 4 on the DE2 hardware examples page.
- You will design a cpu system, plus timers, UARTs and parallel interfaces in SOPC, then use Verilog to add the audio codec hardware interface. Don't use schematic entry or VHDL.
- You will use microC/OS to construct three tasks to:
- Handle the UART and set parameters from the human using hyperterm.
- Display the waveform type and frequency on the LCD.
Communicate with the Audio Codec and synthesis hardware to produce the appropriate waveform.
- The audio generator should take a serial command to produce sine, square, triangle or white noise.
- Sine, square, or triangle waveforms should be produced by hardware (not in a cpu) Direct Digital Synthesis.
- The audio generator should take a serial command to set the frequency if the wavefrom is sine, square, or triangle.
- The audio generator should take a serial command to set the cutoff frequency of the white noise.
- White noise should be produced by using a hardware (not in a cpu) xor-feedback shift register or Linear Congruential Generator followed by a first order hardware digital low pass filter.
Be prepared to demo your design to your TA in lab.
Your written lab report should include:
- A explaination of the audio codec commands
- How you implemented the random number and DDS circuits.
- A heavily commented listing of your Verilog design and GCC with microC/OS code.
Copyright Cornell University July 2006