EE 476: Laboratory 3
TV control and video clock.
Introduction.
You will construct a simple stopwatch which displays time on a television.
There will be start, stop, and reset buttons to control it.
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.
Build the video DAC 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 one of the example programs on the video page.
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.
The power supplies on the TVs and development boards are NOT interchangable.
Assignment
- Write a C program which:
- Simulates a stopwatch with start, stop and reset buttons. The reset
only works when the stopwatch is stopped. Note that it makes no sense
to debounce the switches.
- Displays the elasped time, in minutes:seconds:100ths of a second (e.g.
032:24:80) on the TV screen in numeric form.
- The time should be accurate to 1/60 second with a maximum time of 1000
seconds.
- The button state should be checked 60 times/sec.
- There should be no flicker, image tearing, or other visual artifacts.
- Demo this program to a staff member. Show that all specifications are met
by verifying the video waveform with an oscilloscope.
- Your written lab report should include:
- The scheme you used to detect the pushbutton state.
- How you generated the synch signals and an measurement of how accurate
they are relative to NTSC standards
- By inspecting the assembler code generated by the compiler, determine
the duration of the synch pulses.
- How you generated the various time intervals required by this project.
- What happens to the image on the TV if sleep is disabled on the mcu?
Why?
- A heavily commented listing of your code.
Copyright Cornell University Jan 2003