testing homebrew vga controller - Page 1
Forum section: electronics / projects

author: Dan Moos
author_rank: Frequent Contributor
timestamp: January 22, 2018, 05:39:31 am
content: As mentioned in previous posts, I am building a VGA controller. I have my Hsync and Vsync pulses working with correct timings for 640x480 at 60hz.I am trying to do a simple test. I'm using an LCD monitor (Dell 1702fp if it matters).I have my sync pulses, and ground connections as they should be. I was hoping if I sent a full .7 volt signal to say, the red channel, I should get a solid red screen, right? That is what I've tried. I have a measured .7 volts on the red channel''s pin, and the other two are grounded. The monitor briefly reports an analog signal, and goes into 640x480 59hz (says so when I hit the settings menu on the front panel) Not sure why its goes into 59 hz, and not 60, but maybe that's a clue. My pulse timing and pulse widths measure perfectly for the standard.Anyway, instead of my desired red screen, I get faint grey vertical lines.Do I HAVE to blank at during each vertical retrace? right nlow, since I'm just holding the color channel constant, nothing is turned off during the vertical pulses, or the front and back porches. I'd hoped for this simple test that that wouldn't be needed.Grounding all three channels gives me the same faint vertical lines, not a blank screen as I'd hoped. Nothing I do with the color channels seems to matter actually.My Hsync and Vsync pulses are 5 volts, active low (the deafult state is 5 volts, and the pulses go to 0)Hsync pulses are 31.8 us apart. pulse is 3.8 us wide.Vsync pulses are about 1.7 ms apart. Pulse is 64 us wide.Any thoughts?EDIT:follow up question. I initally had used a voltage divider to get .7 volts, but when I hooked up the cable, that turned into .3 or so. This makes me think that there is about 75 ohms or so of a load on my signal when I send it in (plus no doubt a clamping diode). What is the proper way to present the signal to the monitor? Lets say one bit per channel, coming from 5 volt logic. By my math, if the input to the monitor is a 75 ohm load, if i send it 5 volts in series with a 470 ohm resistor, that should get me a full .7 volts. Is this what I want to do?

author: hamster_nz
author_rank: Super Contributor
timestamp: January 22, 2018, 07:50:47 am
content: Monitors usually require the R/G/B signals to be black outside of the active picture area.The seem to use this as a black level reference

author: Someone
author_rank: Super Contributor
timestamp: January 22, 2018, 09:25:18 am
content: Quote from: Dan Moos on January 22, 2018, 05:39:31 amDue to the possibly long cable and fast edges of the video signal its a 75 ohm system with controlled impedance to avoid reflections. Your source impedance needs to be 75 ohms so any resistive divider needs to present that output impedance.

author: John Heath
author_rank: Frequent Contributor
timestamp: January 22, 2018, 02:13:11 pm
content: You could use a computer with vga out and set the video mode in dos to 640 x 480 plugged into your monitor. This way you can snoop the lines to look for a difference between the computer vga and your vga. RBG lines are terminated with resistors in the monitor much like a coax cable is terminated to stop data from bouncing back and forth.

author: rstofer
author_rank: Super Contributor
timestamp: January 22, 2018, 03:31:40 pm
content: It may turn out that the vertical and horizontal blanking intervals actually have to be blanked. These are what those retrace intervals are actually called.If you check out the code here, near bottom of page, you will see that R,G & B are only emitted when the 'beam' is in the active area:http://www.fpga4fun.com/PongGame.htmlCode:reg vga_R, vga_G, vga_B;always @(posedge clk)beginvga_R <= R & inDisplayArea;vga_G <= G & inDisplayArea;vga_B <= B & inDisplayArea;end

author: rstofer
author_rank: Super Contributor
timestamp: January 22, 2018, 04:52:59 pm
content: http://www.xess.com/static/media/uploads/blog/devbisme/2011-06-11/app001_2.pngThis is a little better timing diagram. It comes from an FPGA projecthttp://www.xess.com/blog/vga-the-rest-of-the-story/

author: David Hess
author_rank: Super Contributor
timestamp: January 22, 2018, 11:35:57 pm
content: The signals are parallel terminated into 75 ohms at the monitor so if you use series termination at your driver, signal levels are halved.As I recall, the green channel contains the sync pulses as well and can be used with TV sync triggering on an oscilloscope or to drive a monochrome display in place of a composite signal but I am just going by memory. You might take a look at the output of a VGA card using an oscilloscope to verify what is suppose to be happening.

author: james_s
author_rank: Super Contributor
timestamp: January 22, 2018, 11:46:38 pm
content: Try connecting the color signals to something other than a DC voltage. If you're doing this with an FPGA it's trivial to "wire" up a counter or some such to feed a square wave to any of the color signals. You'll end up with vertical lines, checkerboard or other various patterns depending on what you do.

author: Dan Moos
author_rank: Frequent Contributor
timestamp: January 23, 2018, 01:12:32 am
content: Ok, instead of a DC signal, I sent the output from various counters in my pulse circuitry. Now I get some vertical lines of various spacing/width commensurate with the the speed and width of the pulse.The image is always stable, perfectly vertical lines of the proper color.I consider this progress of a sort, although I'm still not clear why a continuous DC signal would fail.I'm next going to set up the proper flip-flops to have the signal only be active at the appropriate time. When I sent the pulses at the full 25.175 MHz, I still don't have a perfectly solid color displayed, but vertical stripes.I have compared my sync signals to other VGA outputs, and it compares favorably. My scope measurements say my numbers are pretty much spot on.I'll keep you guys posted!Sent from my E6830 using Tapatalk

author: helius
author_rank: Super Contributor
timestamp: January 23, 2018, 01:40:59 am
content: Quote from: Dan Moos on January 23, 2018, 01:12:32 amBecause if the monitor responded to signals down to DC, it would couple line-frequency interference (since that is within the passband that goes all the way down to DC). That would mess up the picture. So the video signals are high-pass filtered, and their DC component is "restored" to 0 by the DC Restorer circuit. You can even put capacitors inline on video cables to make them appear brighter (in effect, further high-pass filtering them).

author: Dan Moos
author_rank: Frequent Contributor
timestamp: January 23, 2018, 02:04:00 am
content: Quote from: helius on January 23, 2018, 01:40:59 amOk, that makes perfect sense!The thing is, I have found suprisingly little info on how to to any of this. I've found the timing standards, and the VGA pinouts online, but nothing on the analog aspects of the color channels.What is really like to find is a good block diagram of what the analog circuitry on the monitor end looks like where the signals are sent.Sent from my E6830 using Tapatalk

author: amyk
author_rank: Super Contributor
timestamp: January 23, 2018, 02:53:45 am
content: You can find a VGA monitor schematic if you're interesting in that.I may also recommend, for VGA fun, having a look athttps://www.linusakesson.net/scene/craft/

author: rstofer
author_rank: Super Contributor
timestamp: January 23, 2018, 04:15:44 am
content: Quote from: Dan Moos on January 23, 2018, 02:04:00 amAll you need to know is that the voltage should be 0V (blank) .. 0.7V (full on) for the color channels and 0V .. 3.3V (up to 5V) for the synch channels and the monitor input is terminated with 75 Ohms to ground.That implies you want to be in the region of 75 Ohms of driver impedance for the color channels and whatever for the sync channels.http://forums.parallax.com/discussion/167581/sanity-check-on-r-2r-vga-dac-- see the right hand 'correct impedance' circuit.http://www.javiervalcarce.eu/html/vga-signal-format-timming-specs-en.htmlThe sanity-check page is all about a 6 bit color but you can find all types of VGA DACs on the Internet.

author: nali
author_rank: Frequent Contributor
timestamp: January 23, 2018, 01:07:47 pm
content: Quote from: Dan Moos on January 23, 2018, 02:04:00 amLook for "DC Clamping". If you Google "Video DC clamping" you'll get a bunch of app notes from a few of the major semiconductor manufacturers.