Barebone VGA driver
tonyp12
Posts: 1,951
I used timings info from here:
http://www.javiervalcarce.eu/wiki/VGA_Video_Signal_Format_and_Timing_Specifications
http://tinyvga.com/vga-timing/640x480@60Hz
Tried on old crt and new lcd and it works, the LCD needed that I leave hpin low during V front porch (standard?)
I should update it so the code runs the same way visualy as: pixles,frontp,sync,backp. [DONE see second post]
This raw driver does not use waitvid, so you could add that later and get 8bit RrrGggBb
Display two colors on either half side of the screen
*** First version Deleted, get the one in second post instead ***
http://www.javiervalcarce.eu/wiki/VGA_Video_Signal_Format_and_Timing_Specifications
http://tinyvga.com/vga-timing/640x480@60Hz
Tried on old crt and new lcd and it works, the LCD needed that I leave hpin low during V front porch (standard?)
I should update it so the code runs the same way visualy as: pixles,frontp,sync,backp. [DONE see second post]
This raw driver does not use waitvid, so you could add that later and get 8bit RrrGggBb
Display two colors on either half side of the screen
*** First version Deleted, get the one in second post instead ***
Comments
It does not use separate v sync timer, instead it waits two horizontal lines for the v-sync low state.
Just to show what is involved with vga timing and learn from it (though using the whole 8bit for color in waitvid is now possible)
Special version attached, Do Not Adjust Your Set everything is OK.
For fun/learning, I modified your "blue-green screen of death" to be a "blue-green-red screen of death" (like a tricolor flag) by defining pixlngt to be 2024/3 instead of 2024/2 and adding the code for red "bar" into your (visible) pixels code.
I'm new to this, but I think I read somewhere that some drivers take a "dot-clock" approach to the timing, whereas you've got fixed-length waits for the horizontal porches and synch (which seems fine and is ultimately probably pretty similar). The second link that you provided (which I came across before somewhere) shows the timing both in terms of clock time and dot-clocks (pixels), which is convenient (for comparison). Thanks for providing this instructive example and the links. --Jim