One Day Builds — FPGA Pong

Since I hardly ever post anything to this website I’ve decided to submit a few projects in a slightly different format. At the moment every time I have a day free to do some electronics the thought of fully documenting the project and posting it on here puts me off!

Instead, from now on, I’m going to do a series of one day builds where I have a singe day (or less) to make a specific project. I’ll use this website like a lab book, documenting my progress as I go along. The notes will be rough but there should be enough detail to follow what I’ve done. I hope someone finds them useful/interesting.

10:45 Research VGA interface and timing specifications

There are 5 main signals for VGA: * 3 Analogue signals for the Red, Blue, and Green pixel intensities. * 2 Digital signals: Horizontal sync and Vertical sync.

H sync and V sync tell the monitor where the horizontal and vertical lines begin and end. See diagram below for details:

11:30 Work out timings for my monitor

The timings of VGA signals depends on the desired resolution and refresh rate.

My monitor has a native resolution of 1680 x 1050 resolution and supports a 60Hz refresh rate. VGA timings can be a bit awkward to calculate so it is often easier just to look them up online.

I used this site which has a large selection of common resolutions.

The horizontal width in pixels = “Front porch” width + “Sync pulse” width + “Back porch” width + monitor width. For my chosen resolution is 104 + 184 + 288 + 1680 = 2256.

The vertical width in pixels is = “Front porch” width + “Sync pulse” width + “Back porch” width + monitor width. For my chosen resolution is 1 + 3 + 33 + 1050 = 1087.

The h_sync line should be normally high, and then pulsed low for 184 pixels to trigger the h_sync. The v_sync line should be normally low, and then pulsed high for 3 pixels to trigger the v_sync.

To get a refresh rate of 60Hz I need a pixel clock of 147.14MHz. This is calculated from: h_width * v_width * refresh rate = 2256 * 1087 * 60 = 147136320Hz Read More