ECE 448: Lab 4 VGA Display. Bouncing Ball.
Organization and Grading
Flexibility in the Second Part of the Semester You can work on all lab assignments from Part II of the course either individually or in groups of two students. The number of required and bonus tasks, as well as the grading scheme will be different for individuals and the groups of two. In case of the group work, both students are expected to be intimately familiar with the entire solution to the given lab assignment and the entire lab report. This knowledge will be verified during the experiment demonstration and the same grade will be applied to the entire team.
Flexibility in the Second Part of the Semester Lab 4: VGA display(2 weeks) – 6 points Lab 5: DSP & FPGA Embedded Resources (2 weeks) – 6 points Lab 6: PicoBlaze & Serial Communication (3 weeks) – 6 points Lab 6a: Logic Analyzer (in class) – 2 points Lab 4: VGA display(3 weeks) – 6 points Lab 5: DSP & FPGA Embedded Resources (4 weeks) – 6 points Lab 6a: Logic Analyzer (in class) – 2 points Schedule A: Schedule B: Total: 20 points Total: 14 points
VGA Background
Video Graphic Array (VGA) Resolution: 640x480 Display: 16 colors (4 bits), 256 colors (8 bits) Refresh Rate: 25Hz, 30Hz, 60Hz (frames / second) RGB: Red, Green and Blue colors
Horizontal TraceHorizontal Flyback Vertical Flyback VGA Monitor
VGA Control Signal Timing Resolution 640x us us us 25.6 us 32 us us us 32 us us ms ms 16.8ms ms
VGA Control Signal Timing Resolution 640x us us us 640 clock cycles 32 us us 656 clock cycles 800 clock cycles 752 clock cycles 480 lines 490 lines 525 lines 492 lines Frequency 25Mhz
VGA 15 Pin
PINs on Board NET "HS" LOC = "J14" | DRIVE = 2 | PULLUP ; NET "VS" LOC = "K13" | DRIVE = 2 | PULLUP ; NET "OutRed " LOC = "F13" | DRIVE = 2 | PULLUP NET "OutRed " LOC = "D13" | DRIVE = 2 | PULLUP ; NET "OutRed " LOC = "C14" | DRIVE = 2 | PULLUP ; We do not use this pin. NET "OutGreen " LOC = "G14" | DRIVE = 2 | PULLUP; NET "OutGreen " LOC = "G13" | DRIVE = 2 | PULLUP ; NET "OutGreen " LOC = "F14" | DRIVE = 2 | PULLUP ; We do not use this pin. NET "OutBlue " LOC = "J13" | DRIVE = 2 | PULLUP ; NET "OutBlue " LOC = "H13" | DRIVE = 2 | PULLUP ;
Introduction to Lab 4
Task 1: Displaying the ball (2pts single person, 1.5pts teams) Draw a circle (ball) in the center of the screen
Task 1: Displaying the ball (2pts single person, 1.5pts teams) Circle Fill: implements equation [(X-X0) 2 +(Y-Y0) 2 < R 2 ] Color Generator: Selects colors for ball and background VGA Controller: Sync generator (may use Digilent) X0 Y0 X Y
Task 2: Moving the ball (2pts single person, 1.5pts teams) Move the ball using the buttons 0 = up1 = down 2 = left3 = right
Task 2: Moving the ball (2pts single person, 1.5pts teams) Manual Count: [NEXT = PREV +/- 4*(STEP+1)] Limit NEXT to within the screen boundary (use generic) X0 Y0 X Y
Task 3: Bouncing the ball (2pts single person, 1.5pts teams) When the center of the ball goes beyond the boundary, the step of an appropriate counter changes sign.
Task 3: Bouncing the ball (2pts single person, 1.5pts teams) Clock divider: 5ms per step, pulsed output (high for 1 clock) Automatic Count: limit out to within boundary (use generic) Duplicate for Y-axis (Clock Divider shared by X and Y-axis)
Task 4: Multiple Balls (2pts bonus single person, 1.5pts teams) Add a second ball Manual and automatic mode Different colors
Task 5: Change color (1.5pts bonus single person, 1 pt bonus teams) Change the color of the ball and the background when the ball bounces. The background color and the ball color must always be different
Task 6: Change Shape (1 pt bonus teams) Change the shape of the object every time it bounces. Circle-to-square and square-to-circle.
Switch Functions Switch[1:0] X Step Size –manual and automatic modes Switch[3:2] Y Step Size –manual and automatic modes Switch[5:4] X,Y Step Size –automatic mode only Switch[6] Ball select –Manual mode only Switch[7] Mode –0 = manual –1 = automatic
Button Functions Button[0] Up Button[1] Down Button[2] Left Button[3] Right