Reputation: 213
I'm attempting to create a generic graphics controller for VGA monitors with an Altera FPGA via a VGA connector, but I cannot find any good online resources explaining the standard specification which monitors use. I've found all the pin descriptions and some resources which describe how to create a specific graphics controller, such as this 8 colour 480x640 controller, but no resources I've found describe the actual expected 'protocol' which monitors.
For example, nowhere have I found what the exact timings are supposed to be between different parts of the signal -- in the above, specific timings in µs are given but not why. Are all the sections supposed to be in these set proportions or is there some arbitrariness with regards to pause timings between rows, etc.... What would the pseudo-code look like if you were thinking of implementing it in code (and be able to change resolution / colour depth)?
Again, I'm looking for the expected 'protocol' for a generic controller -- similar to what an OS would use when no monitor type is specified. An pointers to the right direction would be appreciated.
Upvotes: 1
Views: 2257
Reputation: 5318
This site: http://server.oersted.dtu.dk/www/sn/31002/?Materials/vga/main.html
Has a pretty good discussion on VGA.
The key to what you're asking is answered with this clip from the site: http://web.mit.edu/6.111/www/s2004/NEWKIT/vga.shtml
"As with RS-232, the standard for VGA video is that there are lots of standards. Every manufacturer seems to list different timings in the manuals for their monitors. The values given in the table above are not particularly critical. On a CRT monitor, the lengths of the front and back porches control the position of the image on the display. If the image appears offset to the right or left, or up or down, try adjusting the front and back porch values for the corresponding direction (or use the image position adjustments on the monitor, which accomplish the same thing)."
The problem is backwards compatability doesn lend itself well to a simple equation to determine these values. There is a modern spreadsheet that will calculate values for monitors that use the most recent standards, but if your playing around with VGA the old analog monitors will let you do tricks that you can't do on an led type display.
Your resolution is limited to how fast the electronics can turn on and off the electron beam, but the horizonal placement is only limited by your clock and what ever phase adjustments are possible on your FPGA.
For instance you can setup 640x480 timing on your sync pulses and instead of clocking data at 25MHz you can use 100 or 200 MHz and simply require a min on time for each pixel. Effectively allowing you to smooth scroll 1/8th of the width of a pixel. You may be able to do simalar tweeking to the distance between scan line although I've never tried it.
Upvotes: 1
Reputation: 62096
I haven't done any lower level VGA stuff for years, but a book I used that that may be of some help is: Programmer's Guide to the EGA, VGA, and Super VGA Cards
The table of contents for the book is as follows:
- Introduction to the Programmer's Guide
- The EGA, VGA, and Super VGA Features
- Graphics Hardware and Software
- Types of Graphics Systems
- Principles of Computer Graphics
- Alphanumeric Processing
- Graphics Processing
- Color Palette and Color Registers
- Reading the State of the EGA and VGA
- The EGA/VGA Registers
- The EGA/VGA BIOS
- Programming Examples
- The Super VGA
- Graphics Coprocessors
- Super VGA Code Basics
- The Adapter Interface
- The 8514/A
- The XGA
- ATI Technologies
- Chips and Technologies
- Cirrus Logic
- The Video7 Super VGA Chip Set
- IIT
- NCR
- Oak
- S3 Incorporated
- The Trident Super VGA Chip Sets
- The Tseng Labs Super VGA Chips
- The Paradise Super VGA Chips
- Weitek
Upvotes: 3