I built a VGA generator on a breadboard, with a design that borrows from the now-famous Ben Eater video.



I changed some things up. First I targeted a 320x240 resoltuion (derived from 640x480) instead of 200x150 (derived from 800x600). This required a slightly faster pixel clock (~12.5875mhz, derived from a 25.175mhz oscillator, instead of a 10mhz (derived from 40mhz) as used in the original video.) I also used CMOS chips instead of TTL ones. I found that the clock speed was too fast for my build, and had to reduced the horizontal resolution in half. I can use it to draw clean horizontal lines becouse they are derived from the vertical counter. It does not draw clean vertical lines becouse they are derived from the horizontal counter, which is running at 800 times the speed of the vertical one. I am happy I got a signal out of it, but am disappointed that I probably won't be able to draw bitmaps from it.

I original wanted to build a video card with acceleration for 2D bitmap graphics, however, it seems like it would require something like a CPLD and a custom PCB, and IDK if I want to invest more money into it.
Very cool! I recently watched Ben Eater's video and really liked it. I'm glad to see someone else modified it and came up with their own version Smile

How are you doing the colors; with resistors? It may be interesting to have a variable potentiometer / control logic to drive different RGB values. Could be more complex but heh.
I am not doing anything fancy for color right now. I just have the RED signal attached to the output of some counter bit. If I attach it to bit 1 of the Y counter, there will be a horizontal line every other pixel, bit 2 will cause a line every 2 pixels, bit 3 every 4 pixels, and so on. Connecting to the X counter should cause vertical lines instead of horizontal ones, but do to some problem, horizontal lines always end up fuzzy and messed up. (There's also some AND gates between the RED signal and the counter bit to make sure the signal only comes out during the ACTIVE part of the frame.) I am actually sending 5v down the signal line instead of 0.7, but my LCD doesn't really care.
Yeah your LCD probably has some impedance on the line, but that's still extremely risky... 5V is 7 times what it should be.
Oooh, very nice! I also watched that video, and was considering doing something similar too. I don't actually have much experience with that type of thing, so I'll probably just end up making a clock with 7-segment displays or something.

And I'm pretty sure that the voltage is supposed to be 0.7 after the built-in impedance, so yeah, you might want to turn that down.
I decided to revisit this project. In order to simplify the design, I used an EEPROM instead of NAND gates like last time. A pair of counters count through the bytes in the ROM, and the the ROM contains the HSYNC, VSYNC, visibility, counter reset, y counter increment signals, as well as A13 and A14 (the counters did not have enough bits to address the whole ROM, so I encoded the upper address bits in the rom itself. The ROM's output is latched every 16th clock cycle (VGA timing for 640x480 can be divided by 16 clocks). In order for the ROM's output to stay "in sync" with the actual counter address, the bytes in the ROM are shifted back by one address. Furthermore, in order for the reset signal to not permanently cause the counter to be stuck at zero, I need to use two counters - the first one is the one that does the divide-by-16 (and is used to latch the ROM output); this counter is not reset but falls to zero by itself. The second counter is reset by the reset signal. Finally there is one NAND IC to invert some stuff when needed and AND the visibility signal with the counter bits(to output the vertical lines).
I am waiting for more parts to be able to add a proper Y counter, as well as more latches to be able to properly sync the ROM output to the pixel data.

Circuit (Arduino for power):

Stable vertical lines, the last circuit couldn't do this.

When you leave a wire floating.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement