Author Topic: impedance matching on custom VGA DAC  (Read 2068 times)

0 Members and 1 Guest are viewing this topic.

Offline aussie_laser_dudeTopic starter

  • Contributor
  • Posts: 46
  • Country: au
impedance matching on custom VGA DAC
« on: April 17, 2020, 12:49:29 pm »
Hey guys,
I'm designing a fpga -> VGA 21 bit RGB DAC driver for displaying fpga images to a LCD monitor. Similar example circuits are linked below.

I've read about impedance matching and electrical reflections and have read that VGA monitors need to be impedance matched, my intuition says it doesn't make much difference, but electronics guys on the net are clever so I'm trying to improve my understanding.

1. Say the VGA cable is 1m long, poor impedance matching (lets just connect the fpga i/o pins -> resistors -> vga RGB pins. No resistor to ground to dampen electrical echoes). Reflections should have a ~3 ns travel time, and should be gone within 5 reflections (i think???). That's 15ns or about 60MHz, which is pretty close to the time interval between two pixels (50MHz). Does this mean each pixel 1 position to the right will receive part of an unwanted signal that was meant for the pixel on the left?

I want to somewhat quantify this understanding, how much electricity is lost on each "reflection", how much signal remains by the time the next pixel passes?

Here is an example showing no impedance matching -
Here is an example showing impedance matching -

This stuffs pretty interesting, wish I'd studied it more in the past.
Thanks for any help  :-+
« Last Edit: April 17, 2020, 12:54:55 pm by aussie_laser_dude »
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21688
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: impedance matching on custom VGA DAC
« Reply #1 on: April 17, 2020, 02:06:38 pm »
Yes, so it looks like a ripply drop shadow to the right of graphics.

I had this with my previous configuration, a CRT monitor (now RIP) connected to DVI via adapter cable.  Either DVI impedance is wrong, or the adapter cable is terrible (despite not being very long, electrically), because I always had reflections, most noticeable after sharp vertical transitions (black to white / white to black).

The display itself should be properly terminated so that source termination doesn't matter (no wave is reflected from the monitor, to reflect off your source mismatch and hence return to the monitor), but if that assumption isn't true, you will see echoes.

You may also want a buffer, as FPGA pins tend to be quite weak and not specified for DC current flow.  A few 74LVC17s will do.

But also, if you're planning on more than just a few bits, please, just get a proper DAC.  You can't match discrete resistors nearly well enough to give that kind of color depth, and DACs are cheap, even quite fast ones like for VGA.

As for reflections themselves, the ratio between characteristic impedance and termination impedance gives the reflection coefficient (of a sort).  So a 1V step into a 60 ohm terminated 50 ohm line (20% mismatch) will reflect 0.2V, and so on.

More exactly, these terms are defined like so: https://en.wikipedia.org/wiki/Reflection_coefficient

The textbook approach to calculating transient transmission line voltages, is to draw two vertical lines, and a diagonal line bouncing between them.  Each touch is an event, and labeled with its corresponding change.  The vertical axis represents time, and the horizontal axis represents position on the line, so that the diagonal slope is the speed of light in the line (characteristic velocity).  The first event is a stimulus, a wavefront, e.g. a step voltage change; the amplitude of that event is reduced by the reflection coefficient on every bounce, and so eventually decays to negligible levels as you go down (unless of course you have a coefficient greater than 1, which is possible with negative resistance elements -- amplifiers).  Each stimulus event launches a diagonal line, so you can calculate what the sum effect of, say, multiple square wave pulses or steps is.

Of course this is less convenient for continuously changing signals like sine waves (or gradient graphics), in which case you break out some calculus, and the length and reflection will be expressed as vector quantities (magnitude and angle), and so trig functions pop up.

Tim
« Last Edit: April 17, 2020, 02:15:24 pm by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: Simon_RL, aussie_laser_dude

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: impedance matching on custom VGA DAC
« Reply #2 on: April 17, 2020, 05:27:19 pm »
In practice the simple resistor DACs work fine for basic stuff.

If you want high res or high color depth definitely just go with the DAC though. I've used the ADV7123 in a few projects and it works well, it's specifically designed for driving VGA monitors.
 
The following users thanked this post: aussie_laser_dude

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16621
  • Country: us
  • DavidH
Re: impedance matching on custom VGA DAC
« Reply #3 on: April 17, 2020, 09:33:54 pm »
1. Say the VGA cable is 1m long, poor impedance matching (lets just connect the fpga i/o pins -> resistors -> vga RGB pins. No resistor to ground to dampen electrical echoes). Reflections should have a ~3 ns travel time, and should be gone within 5 reflections (i think???). That's 15ns or about 60MHz, which is pretty close to the time interval between two pixels (50MHz). Does this mean each pixel 1 position to the right will receive part of an unwanted signal that was meant for the pixel on the left?

The sharpness of the edge between pixels depends on the transition time so the bandwidth is much higher than the pixel clock.  A VGA output is actually a good impromptu signal source for transient response calibrations of probes and oscilloscopes at 100 MHz and below because the typical VGA edge transition is less than 1 nanosecond and is pretty clean.

Note that the impedance of the VGA signal lines is 75 ohms and not 50 ohms.  High quality cables use 75 ohm RG-179 and not 50 ohm RG-178.
 
The following users thanked this post: aussie_laser_dude

Offline aussie_laser_dudeTopic starter

  • Contributor
  • Posts: 46
  • Country: au
Re: impedance matching on custom VGA DAC
« Reply #4 on: April 18, 2020, 06:14:56 am »
I'm pretty amazed at the quality and knowledge in these posts! Learning quite a bit here. Thanks guys.

Buying a part is a nice idea, the 74LVC17 is exactly what I'm looking for when I get past a simple prototype design and into something a bit better, I want to construct one myself to ensure I understand the fundamental principals, I'm doing this mainly to learn and improve (and have fun  :D).

I think T3sl4co1l is right about the monitor being terminated, I've attached photo's of the screens pixels up close with a sharp transition (light to dark) for a long and short cable both with no impedance matching, the long cable did just fine, the short cable for some reason did pretty poorly (and I have no idea why?)
See the transition edge of the short cable case in the photo to see the weird phenomena.

Thanks james_s, tried a 7 bit red DAC that didn't even have the right resistors in some slots (resistor packs are in the mail), colour depth is actually pretty smooth so can confirm basic resistor DACs are pretty good and easy to make. A quick pen and paper calculation suggests 0.01% precision resistors should work on a 10 bit per channel DAC.  I've linked a quick video, it's good transitioning from low to high red intensity except for a few minor hiccups when the dodgy resistors are used lol.

Thanks David, you taught me something interesting, new VGA cables (XGA / SVGA) are multi-coax cables, the cheap chinese vga I have is the old style with just wires in insulation. Maybe that's why I'm noticing some noise on the screen with low intensities?

Two things for me to learn:
1. Figure out why the short cable does poorly on sharp transitions (both short and long cables have no impedance matching on the homemade VGA DAC source)?
2. Transmission line type stuff: I'll need to do some of my own research on this one, I want to be able to calculate how voltages change over time in nanoseconds / picoseconds, wanting to actually understand and predict what will happen for different cases like single wires, dual lines, coax cables, pcb traces etc.

Cheers guys, going to get back to learning stuff.


« Last Edit: April 18, 2020, 10:03:50 am by aussie_laser_dude »
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16621
  • Country: us
  • DavidH
Re: impedance matching on custom VGA DAC
« Reply #5 on: April 18, 2020, 11:56:56 pm »
Thanks David, you taught me something interesting, new VGA cables (XGA / SVGA) are multi-coax cables, the cheap chinese vga I have is the old style with just wires in insulation. Maybe that's why I'm noticing some noise on the screen with low intensities?

My last two CRT monitors had BNC inputs and using them with a 15-pin VGA to BNC cable that is a bundle of RG-179 coaxial cables made a considerable improvement in image quality at 1600 x 1200 and higher.  Typical VGA cables use twisted pairs which is adequate at lower resolutions.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf