Introduction to Experiment 5 VGA Signal Generator ECE 448 Spring 2009
Video Graphic Array (VGA) Resolution: 640x480 Display: 16 colors (4 bits), 256 colors (8 bits) Refresh Rate: 25Hz, 30Hz (frames / second) RGB: Red, Green and Blue colors Monitor technology: Cathode Ray Tube (CRT)
Horizontal TraceHorizontal Flyback Vertical Flyback VGA Monitor
6-bit digital color code for a single pixel Analog RGB output D/A VGA Monitor Interface FPGA output 64 colors board output
Use these 2 higher bits RC-10 Monitor Interface
VGA Control Signal Timing Resolution 640x480
VGA 15 Pin
VGA Control Signal Timing for f CLK = 48 MHz 1208 clock cycles 1253 clock cycles 1434 clock cycles 1525 clock cycles 480 lines 494 lines 496 lines 528 lines
VHDL Timing for 48MHz Please verify that you generate correct synchronization signals using 1.Functional simulation 2.Timing simulation 3.Oscilloscope before you connect your VGA output to a CRT monitor.
Pseudocode x = 0; y = 0; repeat forever { if x == 1207 then hblank = 0; if x == 1252 then { hsync = 0; if y == 479 then vblank = 0; if y == 493 then vsync = 0; if y == 495 then vsync = 1; if y == 527 then vblank = 1; if y == 527 then y = 0; else y++; } if x == 1433 then hsync = 1; if x == 1524 then hblank = 1; if x == 1524 then x = 0; else x++; if ( hblank == 0) OR (vblank == 0) then RGB = 0; else RGB = color_generator(x, y, external control); }
Pseudocode Your datapath should reflect the following pseudocode. The pseudocode is composed of sequential statements, but your circuit should perform as many independent operations in parallel as possible. x and y signals should change only at the rising edge of the clock.
Color Generator external control x y RGB_color_code 6 2 bits for Red component 2 bits for Green component 2 bits for Blue component Color Generator Output can be generated on the fly, or read from a precomputed look-up table (stored in BRAM)
RC-10 Board FPGA-VGA Pins
Task 1: Displaying 4 Rectangular Blocks with Different Colors Joystick left – cycle through each rectangle and background (1=>2=>3=>4=>5) Joystick right – cycle through 16 different colors of the currently active area Enter – reset to initial state
Task 2 : Expansion and shrinking of variable color rectangles Joystick left – cycle through each rectangle and background (1=>2=>3=>4=>5) Joystick right – cycle through 16 different colors of the currently active area Joystick up – increase the speed of expansion/shrinking of the rectangles Joystick down – decrease the speed of expansion/shrinking of the rectangles Enter – reset to initial state
Task 3 : Ellipse in the Middle of the Screen Joystick left – cycle between the ellipse and the background Joystick right – cycle through 16 different colors of the currently active area Enter – reset to initial state Ellipse equation:
Task 4 : Expanding and Shrinking Ellipse Joystick left – cycle between the ellipse and the background Joystick right – cycle through 16 different colors of the currently active area Joystick up – increase the speed of expansion/shrinking of the ellipse Joystick down – decrease the speed of expansion/shrinking of the ellipse Enter – reset to initial state Ellipse equation:
Task 5 : Bouncing Ellipse Joystick left – cycle between the ellipse and the background Joystick right – cycle through 16 different colors of the currently active area Joystick up – cycle through 4 bouncing speeds Joystick down – cycle through 5 modes of operation (stop, horizontal, vertical, right diagonal, left diagonal) Enter – reset to initial state