Author Topic: VGA interface  (Read 3186 times)

0 Members and 1 Guest are viewing this topic.

Offline mnTopic starter

  • Contributor
  • Posts: 16
  • Country: ca
VGA interface
« on: April 15, 2017, 03:23:13 pm »
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
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: VGA interface
« Reply #1 on: April 15, 2017, 03:46:46 pm »
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.
 
The following users thanked this post: Kilrah

Offline mnTopic starter

  • Contributor
  • Posts: 16
  • Country: ca
Re: VGA interface
« Reply #2 on: April 15, 2017, 05:21:18 pm »
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.
 

Offline Bruce Abbott

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: nz
    • Bruce Abbott's R/C Models and Electronics
Re: VGA interface
« Reply #3 on: April 15, 2017, 06:15:01 pm »
...view the output of the VHDL code which uses report statement
The 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 when simulating VHDL code. It is not synthesizable ie. does not create any logic inside the FPGA. While it might be possible to 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!).   

 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: us
Re: VGA interface
« Reply #4 on: April 15, 2017, 08:33:09 pm »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: VGA interface
« Reply #5 on: April 16, 2017, 04:11:22 pm »
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.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: us
Re: VGA interface
« Reply #6 on: April 17, 2017, 04:17:38 pm »
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.org

ETA: 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.
« Last Edit: April 17, 2017, 04:33:22 pm by rstofer »
 
The following users thanked this post: helius

Offline Wiljan

  • Regular Contributor
  • *
  • Posts: 225
  • Country: dk
Re: VGA interface
« Reply #7 on: April 17, 2017, 04:33:26 pm »
Have a look here it's pretty good explained to make you own VGA logic
http://www.fpga4fun.com/GraphicLCDpanel.html
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: us
Re: VGA interface
« Reply #8 on: April 17, 2017, 04:42:08 pm »
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
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: VGA interface
« Reply #9 on: April 17, 2017, 06:40:59 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf