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]

Comments

  1. SlurmMcKenzie says:

    i think it’s awesome

  2. ftorama says:

    These AVRs are definitely great…

    Great job also, even if it’s still far from Akesson’s version:

    http://www.linusakesson.net/scene/craft/

  3. Amos says:

    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: http://www.olsenhome.com/gif/

    5. Sorry for the long comment.

  4. jeff-o says:

    A fine accomplishment, but I’ll stick with my Propeller. ;)

  5. Greycode says:

    SPELL CHECK ON AISLE 4!

  6. dmcbeing says:

    @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!

  7. LazyMegaMan says:

    What was this project about again? I got distracted by the bouncing ball on EVERY FREAKING SCREEN.

  8. Travis says:

    So, sort of related, how does one run Linux on an ARM and output its video to a monitor?

  9. RadBrad says:

    “Canuck Robot” here…

    Thanks for posting my project.

    Cheers!
    Brad

  10. RadBrad says:

    @Amos…

    There is no “they” on LucidScience, just me, the robot. Ain’t never heard of a “Jif” file either, eh?

    Doh.

  11. Fallen says:

    Maybe it’s just a Canadian thing, but I always said it Gif, not Jif. Or I’m a noob. Or both. IDK. Either way this is an awesome project, kudos.

  12. lol I always said GIF too.

    In french we do pronounce int (integer) wrong. Well all my friend and teacher got it wrong, until I did a intern completely in English and learned the real pronunciation.

  13. 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…

  14. rj says:

    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”

  15. SteveO says:

    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.

  16. Phil says:

    Great, now do it with HDMI ;-)

  17. Daid says:

    It has been done before:

    http://avga.prometheus4.com/

    Which doesn’t need external RAM.

  18. Hoopstar says:

    Might try this on my Arduino..

  19. antonye says:

    Hard and Soft C/G? What about “soccer” and “finger” ? ;-)

  20. smoker_dave says:

    Only a soft G uses his finger.

  21. 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). ;-)

  22. SexieWASD says:

    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.

  23. Fallen says:

    @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.

  24. Jake says:

    This guy gets 1,000 of my best internets for being leet and wiring his own AVR vs. being a complete nub and using something that he nubbishly refers to as an “arduino”. HA!

  25. MrX says:

    @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.

  26. Hitek146 says:

    As stated before, Compuserve(the very people that *created* the GIF format) said it should be “jif”, and since it was their creation, they should know…

  27. Agent420 says:

    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.

  28. sneakypoo says:

    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?

  29. yuriks says:

    I’ve been looking around for a bit to no avail. How is sync on green done (what levels, etc) and is it required? And how do I derive new pixel clocks, timings and resolutions?

  30. rj says:

    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.

  31. Colin says:

    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?

  32. yuriks says:

    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).

  33. ENKI-][ says:

    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?

  34. at a point in comments section I was lost thinking if it was all about GIF pronunciation, anyway great job, your 16 page tutorial helped a lot. big thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,467 other followers