Posts | Comments

Planet Arduino

Archive for the ‘640×480’ Category

Jun
11

How to Produce 640×480 Color VGA Video From an 8-Bit Arduino

640x480, 8-bit, arduino, VGA Comments Off on How to Produce 640×480 Color VGA Video From an 8-Bit Arduino 

PK @ dqydj.net writes:

Let me set this up for you: most 8-bit AVRs in the wild (I happened to use an Arduino Nano for this project) are running at 16 MHz. That’s 16,000,000 calculations per second… a very respectable number for most embedded applications.

The VGA industry standard, which is pretty much the default case “we-can-always-fallback-to-this” video standard (640 pixels wide by 480 pixels tall by 60 frames per second), requires pixels to be clocked out at 25.175 MHz:

25,175,000 > 16,000,000.

And that was just one of the barriers to pulling off this silly project. And, yes, with the hack I told you about last time (Please see my notes below), more is possible without overclocking the Arduino – roughly 800 or so pixels wide in 4 bit color should be doable with a 16MHz part, and, probably 1024 pixels in 4 bit color are in reach for 20 MHz clocked parts. (If you’re willing to drop to 2 or 1 bit color and spend a ton on ICs that can handle even faster clocks, you can hit HD resolutions – but I think you’ll run into financial constraints before you max out on the technical side)

How to Produce 640×480 Color VGA Video From an 8-Bit Arduino - [Link]

Jun
11

VGAThere are dozens, if not hundreds of examples around the Intertubes of an Arduino generating a VGA video output. The Arduino isn’t the fastest chip by far, and so far, all of these VGA generation techniques have peaked out at lower resolutions if you want to control individual pixels.[PK] has an interesting technique to generate 640×480 VGA at 60 frames per second without overclocking. It’s hacky, it’s ugly, but surprisingly, it actually works.

The VGA standard of 640×480 @ 60 fps requires pixels to be clocked out at 25.175 MHz, and the ATMega chips found in Arduinos top out at 20 MHz. [PK] wanted to generate VGA signals without overclocking, He did this by doubling the clock frequency with digital logic. The ATMega generates a clock, an inverter delays that clock so it is 90 degrees out of phase, and the two clocks are XORed, doubling clock output of the micro. It produces a very ugly square wave at 32 MHz – an error of 27% compared to the VGA spec. Somehow it still works.

With a hilariously out of spec clock, the rest of the project was pulled together from [Nick Gammon]‘s VGA library, a 16×16 font set, and a project from [lft]. Video below.


Filed under: Arduino Hacks


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook