Back To Video Basics With An ESP32 VGA Display

In a world where standards come and go with alarming speed, there’s something comforting about VGA. It’s the least common denominator of video standards, and seeing that chunky DB15 connector on the back of a computer means that no matter what, you’ll be able to get something from it, if you can just find a VGA cable in your junk bin.

But that’s the PC world; what about microcontrollers? Can you coax VGA video from them? Yes, you can, with an ESP32, a handful of resistors, and a little bit of clever programming. At least that’s what [bitluni] has managed to do in his continuing quest to push the ESP32 to output all the signals. For this project, [bitluni] needed to generate three separate signals – red, green, and blue – but with only two DACs on board, he had to try something else. He built external DACs the old way using R/2R voltage divider networks and addressed them with the I2S bus in LCD mode. He needed to make some compromises to fit the three color signals and the horizontal and vertical sync pulses into the 24 available bits, and there were a few false starts, but the video below shows that he was able to produce a 320×240 signal, and eventually goosed that up to a non-native 460×480.

It’s a pretty impressive hack, and we learned a lot about both the ESP32 and the VGA standard by watching the video. He’s previously used the ESP32 to build an AM radio station and to output composite PAL video, and even turned his oscilloscope into a vector display with it. They’re all great learning projects too.

Thanks to [anacierdem] for picking this one up for us.

11 thoughts on “Back To Video Basics With An ESP32 VGA Display

  1. Given that an ATtiny @20MHz can bit-bang an NTSC colour signal, this from a single core 8 bit CPU, then a twin core 32 bit processor @90MHz only managing 460 x 480 is a little disappointing.

    1. The big difference is in what you can output within this time. By having a framebuffer, you have a lot more freedom and power than when you’re racing the beam. And ESP32 is @ 80 to 240 MHz depending on settings.

      1. I agree with both views, the ESP32 has lots of RAM and a ‘parallel I2S’ officially featuring a documented “LCD mode”, code example was provided, and this is not that different, requiring a similar kind of ‘signals packets’ buffering. (I’m even kind of convinced that this extended I2S multi-channel functionnality would probably not exist without your many unexpected (ab)uses of this serial peripheral on ESP8266 for difficult-to-drive led strips, Ethernet, or analog TV transmission!)

        From an educational perspective, it is always interesting to show how you can do such thing with a simple resistor DAC, and how the ESP32 facilitates the process with this powerful peripheral, and Bitluni makes a good job at explaining how he proceeded to implement another well-known trick rather quickly despite some quirks or limitations.

        Many tinkerers will be glad to have a ready and practical VGA output library for these cheap boards, with enough memory for a framebuffer with a high color/resolution ratio, but from a ‘hack’ point of view, this is not that impressive or stunning compared to previous clever implementations on commodity chips far more unsuspected of such a capability.

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.