Moving An FPGA Project From VGA To DVI-D

It’s fairly easy to create VGA with an FPGA using a simple R/2R DAC. As [Mike] points out, this requires a lot of IO pins, and many development boards only support 8 bit VGA. Analog VGA is being replaced with DVI-D and HDMI on many devices nowadays, so it would be nice to port projects from VGA to DVI-D.

To address this, he’s come up with a simple DVI-D implementation in VHDL. The result converts RGB and sync data for VGA into DIV-D. Since DVI-D and HDMI both use the same signals for video, this can be connected to either input on a monitor or TV.

This implementation is shown displaying a test pattern on the Pipistrello development board, which features a Spartan 6 LX45 FPGA, but the project was written to be portable to other vendor’s FPGAs. With the right connector and a fast enough clock speed, this project should help move a project from 8 bit VGA to glorious 32 bit color.

23 thoughts on “Moving An FPGA Project From VGA To DVI-D

  1. Also note that you’ll need TMDS outputs on your FPGA, simple I/O won’t cut it. Spartan-6’s and -3A’s are good to go, but a -3 or -3E can’t drive these signals without external circuitry.

    1. Small Spartan 3As and 6s start at $10 too, so if you’re using one, the hardware required is 1 connector. ;-)

      This is awesome work: nicely written and documented.

      It is possible to do lower resolution DVI with plain old LVDS pairs as found on old Spartan 3, Virtex 2, Cyclone II and Stratix II FPGAs. The levels are a bit out, but it does work ok.

    1. Nonsense. Listen to Steve C. HDMI has only prevailed due to a standard that supports CONTENT PROTECTION (Hollywood), litigation, audio in the TMDS stream, a small connector, and due to being common in TVs.

      DVI’s royalties are very reasonable. HDMI’s are not. DP++ is even better than both, plus it has a locking connector. But that’s going to die too because the HDMI group is threatening to sue manufacturers of cables that have HDMI and some other TMDS-single-link-supporting-format on the other side.

      Know your facts.

        1. Correct, HDCP is also present as an option for both DVI and HDMI.

          Since the HDCP royalties are/were more expensive for HDMI though, and DVI systems that are not PC don’t/didn’t even have to pay it (due to a bit of a loop hole in the original licensing, though that may have been closed up now) means in real terms HDCP royalties are a non-issue regarding the life of DVI.

          It is purely down to the connector, audio capabilities and backwards compatibility that DVI is going away.

          In actual fact it has not actually gone away in many cases since DVI support is mandated in the HDMI spec and many systems still output DVI (i.e. RGB color space, no audio, no other features etc…) but do so over a HDMI connector.

    1. I hear rumors that if you are using low pixel clocks you might just be able to get away using the LVD outputs on a Spartan 3E to drive the TMDS signals. If you want, I can flick my constraints over to using that I/O standard and see if it still hangs together…

      Then it will be down to which pins are used on the wings. If there 4 pairs on one wing it might be worth butchering an HDMI cable and seeing what happens!

  2. Hi,

    The board is pretty much a one-off. The Magnus Karlsson for his own project (maybe commercial?). Rather than starting from scratch he adapted the Papilio footprint and tools. He is able to assemble BGA parts in his basement (!) and gifted me one made from his left over PCBs.

    He doesn’t plan to sell the boards and doesn’t feel that Sparkfun or Seeed will be able to run with it as a product due to the cost of parts and BGA assembly costs.

    I feel very blessed to have such a nice board!

  3. Creating a HDMI/DVI board which can take up to 8 bits per color channel is trivial to do with something like the Texas Instruments TFP410.

    If you have fewer bits per color channel then simply duplicate the bits starting at the MSB since this maintains full output range whilst sacrificing a little in linearity.

    I have designed three or four boards like this for various processor EVM systems (E.g. TI OMAP3 EVM etc…)

    1. I’ve used TFP410 (and TFP403 for DVI input) a few times too, but they’re something like a $10 part which you have to find power and board space for.

      Analog Devices have a better range (for even more cash) and do HDCP – you add a SPI EEPROM to hold the keys.

      1. Agreed. A little costly but at least external transmitters are readily available, even some with embedded HDCP keys.

        Unless you can put up $5M+ in indemnity insurance you cannot get HDCP keys or receivers with embedded keys unfortunately.

        TI also has a DVI TX/RX which can use external EEPROM, but again actually getting keys is a major hassle.

        If you really need HDCP for transmit then you can easily get transmitters.

        HDCP receivers are a completely different issue and certainly outwith the realms of reality for any hobby project.

  4. Oh very nice,
    I’ve done the basic hobby project of displaying vga from an fpga, and my next project was to use an external memory so I can actually have a decent frame buffer. But I’m finding it hard to get enthusiasm because it seemed that VGA was a dying interface, and it all seemed a bit pointless.

    This has given me hope that even if vga goes away my project wouldn’t be pointless as one day I could convert it to hdmi once I know more.

    Does anyone know if an altera ep4ce22 on a de0-nano has suitable hardware to try out this kind of thing? I’m struggling to understand exactly what is needed. (I usually prefer my xilinx boards but I don’t have one with external memory…)

    Anyway, very nice project indeed, although I wish it was in verilog so I could understand it. Perhaps it gives me the push I need to finally learn vhdl as well as it seems silly not to know both.

    1. VGA will be around for a while I think, just like component video and even CVBS will be. There is simply too much existing hardware in circulation for it to go away any time soon.

      Having said this DVI/HDMI is now so common that adding it to a video project is certainly a good idea.

      As I mentioned earlier it is simple (if not necessarily as cheap) to do with DVI/HDMI what is being done with VGA R2R networks by adding external TX/RX. More board space and more cost, but not difficult or ‘too’ expensive. (HDCP aside!!)

      As more FPGAs appear with the high speed LVDS inputs/outputs it will become even less of an issue, and use less FPGA pins.

  5. Like Mike says, at the moment I have no plans to put this board in production due to the high setup cost. However, I do have lots of PCBs left over so if there is interest I could build a small set of boards (~10) in one batch. Interest can be directed to magnus at saanlima dot com

  6. HI Eric,
    nice and quite neat! but I have a query, how would a reverse process be like to convert back from DVI/HDMI to VGA? any thoughts? keeping apart the nuisance of why. My question is how?

  7. The link to the implementation does not work anymore?

    I am trying to output hdmi with a cheap cyclone 2 mini dev board and I am looking for a tmds example. The data sheet says, the cyc2 has some hardware shift registers to output some megabytes per second. But it seem hard to find examples for this.

Leave a Reply to Mike FieldCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.