VGA interface - Page 1
Forum section: electronics / general

author: mn
author_rank: Contributor
timestamp: April 15, 2017, 03:23:13 pm
content: Hi, I want to know how can I work with the VGA interface of a Spartan-6 board? Is there an IP core for that or it is simply usable by connecting it to a monitor and view the output of the VHDL code which uses report statement

author: james_s
author_rank: Super Contributor
timestamp: April 15, 2017, 03:46:46 pm
content: You have to write VHDL that generates the correct timing signals and pixel data, there are a bunch of examples floating around out there. There's no simple direct way to do it, you have to describe the hardware of a VGA interface in HDL.

author: mn
author_rank: Contributor
timestamp: April 15, 2017, 05:21:18 pm
content: So that means "specific device" code. Isn't that? If you know a good starting point, please let me know. I searched for that but don't know which one is good for beginners.

author: Bruce Abbott
author_rank: Frequent Contributor
timestamp: April 15, 2017, 06:15:01 pm
content: Quote from: mn on April 15, 2017, 03:23:13 pmThe VGA port on your board is provided in case you want to create logic inside the FPGA that produces VGA output. You can put some IP in the FPGA to do it, but you won't see anything on the screen unless you also put in something to produce an image.The Report statement is used to print diagnostic messages on your PC whensimulatingVHDL code. It is notsynthesizableie. does not create any logic inside the FPGA. While it might bepossibleto put such diagnostics in the FPGA, this is not generally done because it wouldn't detect all design errors, and uses up gates unnecessarily (a VGA display with all the stuff required to print out error messages would use a lot!).

author: rstofer
author_rank: Super Contributor
timestamp: April 15, 2017, 08:33:09 pm
content: Maybe Digilent has an answer:https://reference.digilentinc.com/learn/programmable-logic/tutorials/vga-display-congroller/start

author: james_s
author_rank: Super Contributor
timestamp: April 16, 2017, 04:11:22 pm
content: It would also help to know which Spartan6 board you have. Some feed the VGA connector directly through a crude resistor DAC, others have a real DAC chip. There are a lot of projects out there that use VGA from an FPGA board, I have a number of classic arcade games that were originally released on fpgaarcade.com that I've ported to various other FPGA platforms.If you want to display debug information you'll have to create a text terminal in VHDL, it's very possible but it's not trivial and not what I'd consider a beginner project unless you already have a good understanding of how raster scan displays and text displays work.

author: rstofer
author_rank: Super Contributor
timestamp: April 17, 2017, 04:17:38 pm
content: I see my link to Digilent doesn't immediately turn to code. I also chased down the original Spartan 3 code but, for me, the .zip file is corrupt. I tried a couple of times.So, attached is the code I used to create an 80x25 VGA display using some code from a fellow in Australia and modified to work in my project. Four files: the main VGA stuff, the char buffer, the char rom (makes the dots), and the attribute ram (change colors).I worked on this 10 years ago and haven't looked at it since; I am hardly in a position to support the code. You may also find better examples on OpenCores.orgETA: The code was written for a Spartan 3 but I suspect it doesn't matter very much. There may be some issues with the exact component definition for a Spartan 6 but it should be pretty easy to resolve. At the end of the day, it's about using up some BlockRAM for the 3 memory files. The rest is just code.

author: Wiljan
author_rank: Regular Contributor
timestamp: April 17, 2017, 04:33:26 pm
content: Have a look here it's pretty good explained to make you own VGA logichttp://www.fpga4fun.com/GraphicLCDpanel.html

author: rstofer
author_rank: Super Contributor
timestamp: April 17, 2017, 04:42:08 pm
content: Although the Spartan 6 page I linked about didn't immediately present code, there is an older Spartan 3 page that does have code. I initially had a problem with the .zip files but it was user error.https://reference.digilentinc.com/spartan-3/spartan-3?s[]=spartan&s[]=3&s[]=vga

author: james_s
author_rank: Super Contributor
timestamp: April 17, 2017, 06:40:59 pm
content: Spartan3 and Spartan6 is generally easy to port from one to the other. It's a bit more hassle if someone has directly instantiated primitives in the code but if they used the wizard then it's a matter of running the wizard again to generate memory devices and clock managers and whatnot for the specific FPGA you are using. I do recall running into a few things where the compiler for the Spartan6 is more picky and something that works on the Spartan3 fails to synthesize for the 6 without additional changes but that has been fairly rare. For the most part ISE works almost like magic to implement the code on whatever device family you are using.