VGA Interfacing AVR Microcontrollers

[Lucidscience] is back again, this time showing us how to push data to a VGA monitor from your AVR project.  It turns out that it is pretty simple, requiring only n open port and a few resistors and diodes. Well, it is that simple for the most basic version which gives you 56×60 pixels. Of course he couldn’t live with that and had to expand. Version 2 outputs 240×240 resolution and has additional sram and a double buffer making animations smoother and flicker free. As usual, the project is quite well documented with photos of the entire build process and schematics for you to build your own. A video of version 1 and version 2 are available after the break.

[via HackedGadgets]

34 thoughts on “VGA Interfacing AVR Microcontrollers

  1. 1. Not exactly new, but really cool. Every time I see a microcontroller putting out crummy NTSC or PAL, I’m like “why not just use a far superior and easier to interface VGA monitor? You can get hundreds of them for free on craigslist if you don’t have one lying around, plus most newer TVs have a VGA port.” I want to see this adapted to YCRCB component output (which would really just involve changing the color space of the input data, and changing the timing/voltages to match RS170 [aka “NTSC before color was added”]).

    2. Where did they find a Canadian robot to do the voice-over?

    3. I’m not implying anything, but the circular, stylized “LC” logo toward the end of the second video looks just a tiny bit like the swastika wall-hangings from Wolfenstein…

    4. The robot pronounced “GIF” wrong. The “G” is pronounced like a “J”, like the popular (well, maybe not in Canada) peanut-butter brand-name. Source:

    5. Sorry for the long comment.

  2. @SlurmMcKenzie

    No its truly epic:

    Right now i have a project in my university.It is to write verilog code to display images to a vga display.We are using xilinx spartan 3 boards (~100$).The catch is that it can only display 8 colors.So this is truly epic since with some resistors and a 5$ chip you can output nicer grapics.Truly epic bravo to the creator!

  3. Back in bygone pre-internet days, I ordered a copied of the GIF spec from CompuServe. It said to pronounce GIF as “Jiff, like the peanut butter”, and I have had to defend that “official” pronunciation whenever people tried to miscorrect me to say it their hard-G way…

    I have seen similar projects to this that have detailed real-time procedural graphics and/or sprite-based graphics (sprites stored in FLASH or ROM), so no frame buffer needed…

  4. What a terrible DAC… 1- the diodes are completely unnecessary; 2- 72 out of the 256 colors are out-of-gamut (involve voltages higher than 0.7V so the color to be displayed is not well defined) because the resistors were badly chosen — they shouldn’t be 1K and 2K but closer to 1600 and 3200; 3- the smudginess is probably because of bad termination rather than anything else, which shows up with the nicer DAC he discarded… and last off, he wrote his own color quantizer rather than using one from somewhere else (e.g. gimp, pnmtools, there’s probably one in photoshop, &c) and then talked about writing “a proper image converter and offer[ing] it for download”

  5. yes, and Worcestershire is actually pronounced: wer-chest-er-shire, but popular opinion is worsh-te-sheer… so that’s what it is. If some long dead company said it was “jif” and people now choose to change it to “gif” – then “gif” it is.

    ALTHOUGH, “gif” in English would be pronounced with a soft “g”. rule:

    When c or g meets a, o, or u, its sound is hard.
    cap, cave, colt, comedy, curly, cuddle
    gas, gather, goblet, goddess, gum, gutter

    When c or g meets e, i, or y, its sound is soft.
    census, center, circle, citizen, cycle, cymbal
    gel, general, giant, ginger, gypsy, gyrate

    omg… I really should just go to bed… I am arguing spelling and pronunciation on the intarweb.

  6. Yes, AVGA uses sprites and tiles, which can be stored in Flash or ROM, to save precious RAM space. Sprite and Tile-based graphics only need to store a tiny ASCII-graphics style “frame buffer”, which contains characters that are used as an index into the tile tables. A tile is basically an icon. This is how backgrounds are built for games like Mario Bros.

    Notice how the AVGA website background is built from tiles (a tile looks like a repeating icon). ;-)

  7. Soft G’s upset me. Just use a j if you want it to sound like a j! That, and silent letters, wth?

    I do my very best to fix these problems with English by mispronunciating them every chance that I get.

  8. @Stevo:

    Get, Geek, Gear, Gecko, Geyser.
    Gimp, Gift, Giga-(Altho the jiga pronunciation is acceptable. 1.21 gigawatts :P), Gimmick, Girth, etc.

    My point is, the soft G if an i or e precedes it is not a hard and fast rule. There are many exceptions.

    IMO if the G in Graphics is hard, it should be hard in the acronym. But anywho this is kinda off topic and pointless.

  9. @Jake

    You are a moron. Not everyone wants to waste breadboards with stuff that development boards do well.

    Congrats, you just won today’s internet l4m3st comment.

    On topic: That DAC seems a little out of calibration – I wonder if the color palette is close enough to the basic 6-level RGB.

  10. I’m more of an avr guy than a Propeller guy, but video is certainly one area where the Propeller shines. You may consider using the prop for video even if you decide to use an avr for the main logic.

  11. I have a question. How is that this project is able to output images “instantly” to the screen but my simple PIC+phone LCD can’t do the same? It’s a 320×240 screen with a 16bit parallel interface. The PIC18f4550 is running at 48MHz. When printing out an image (stored in program memory) you can see it drawing it line by line. I figured the C-program was just slow so I tried sending a solid colour by setting the ports to represent Red and then just twiddled the clock pins in a for loop. And it’s still not “instant”.

    Is my current PIC simply too slow for the task?

  12. MrX: re DAC- see my previous comment, the DAC is AWFUL. The guy doesn’t seem to know/care about analog video.
    sneakypoo: No, that’s almost certainly the interface to the LCD that’s slowing you down.
    yuriks: Sync-on-Green is the same as RS170/NTSC just at different frequencies.

  13. I’m trying to interface a pic with my LCD monitor.
    But when I tested it out, the monitor would go black, give me the message “Out of range”, and then restart.

    Any ideas what the error message means, and/or what’s causing it? I’m thinking it might be a timing issue. I don’t think it has to do with my RGB values, as I tried removing the color connections and the same thing happened.

    After looking around, I’ve found that this also happens when you try to use a resolution not supported by the monitor. Is it possible that this monitor doesn’t support the original VGA?

  14. Colin: 99% sure your sync signals have the wrong timing. Assuming you’re using the code from this page, you’ll need to redo the nop’s acoording to the instruction timing on the PIC (applying the signal clock x uC clock ratio).

  15. You don’t seem to be using too many of the pins on your micro (presumably at least some of them are digital out); would you be able to run multiple monitors off this, or are you maxxing out your ram?

Leave a 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.