You will produce a digital oscilloscope which takes one voltage channel input and displays the resulting voltage trace on the TV. There will be a selectable timebase, a fixed tirgger criterion, an RMS calculation, and an option to lowpass filter the signal.
Procedure:
You will probably want to review the code examples given
in Video Generation with AVR.
Use this example as a basis for your program.
Before compiling, under the Project
menu, choose Configure...
, then in the Compiler
tab. Set "Optimize for Speed
",
reduce the Data Stack size
to 100 bytes, and turn off the "char
is unsigned
" option.
Build the video DAC shown below and connect it to the yellow connector on the TV using clip leads and a RCA phone jack. Make sure the TV is set to video input. Test the TV connection using the example program linked above. The power supplies on the TVs and development boards are NOT interchangable.
The scope will be AC coupled. Use the following circuit to isolate the signal source from the DC level required by the ADC. I suggest setting Vref to Vcc for easy connection to the STK500. This example shows one way to set up the A/D converter. More information about the ADC converter is available. Because of the sample speed required in this lab, you will have to be sure the ADC prescalar is set appropriately.
Note that timing is very critical for this lab. You will need to write compact code which will fit into the horiziontal sync interrupt. The filtering routines required in the assignment are described on the Fixed Point math page. You will need to convert the ADC output to a fixed point number, filter it, then convert it back to a char.
Write a program in C and assembler for the microcontroller with these specifications:
When you demonstrate the program to a staff member, you should exercise all the scope functions and show that the voltage and time scales are accurately calibrated. One way to do this is to simultaneously display the output of the signal generator on your scope and on the Tek scope.
Your written lab report should include: