VGA Output From A PIC18

In the maker world, it’s the Arduino and ESP32 lines that get the lion’s share of attention. However, you can do fantastic things with PIC chips, too, if you put the dev time in—it’s just perhaps less likely another maker has done so before you. A great example is this VGA output project from [grecotron].

A PIC18F47K42 is perhaps not the first part you would reach for to pursue any sort of video-based project. However, with the right techniques, you can get the 8-bit microcontroller pumping out the pixels surprisingly well. [grecotron] was able to get the chip outputting to a VGA monitor at a resolution of 360 x 480 with up to 16 colors. It took some careful coding to ensure the chip could reliably meet the timing requirements for the standard and to get HSYNC, VSYNC, and the color signals all dancing in harmony. Aiding in this regard was that the chip was clocked with a 14.3182 MHz crystal to make it easy to divide down from all the internal timers as needed. Supporting hardware is light, too—primarily consisting of a VGA connector, a couple of multiplexers, and resistor ladder DACs for the color signals. Files are on Github for those interested in deeper detail on the work.

VGA output is possible to implement on all kinds of microcontrollers—and even a bunch of raw logic if you know what you’re doing. If you’re pursuing your own video output wizardry, be sure to let us know on the tipsline.

6 thoughts on “VGA Output From A PIC18

  1. Nice project. And with a very detailed project documentation! The image mode with the foreground and background color per 8×8 pixel cell is similar to how many 8-bit computers did high res color modes back in the day.

    Re Lewin’s statement that “it’s just perhaps less likely another maker has done so before you”: To the contrary!
    https://hackaday.com/2007/11/13/simple-vga-test-box/
    https://hackaday.com/2016/12/08/bitbanging-vga-fits-in-under-1-kb/
    https://hackaday.com/2017/02/19/pic-retrocomputer-boasts-vga-ps2-keyboard/

    1. Creating a stable VGA signal on an 8-bit mcu turned out to be the easy part.
      Pushing it all the way to a full 480 lines of vertical resolution… that took some real effort.
      Getting a real‑time interpreter to parse ESC commands over UART while rendering video on the fly… That was pure agony.

      cheers

  2. I cut my teeth on PIC chips about 20 years ago. Back then, Microchip would send out free samples of PIC chips to students and folks in the industry, so I have a dozen or more in a drawer here. Being a cheapskate, I always gravitated towards the one with an internal oscillator to reduce parts count (and thus cost).

    My first real project was to build my own weather station, using parts from a commercial unit that broke. I ran that weather station for nearly 10 years before moving on to another one.

  3. I’ve been working in a similar project, using by coincidence the very same microcontroller, but generating NTSC
    It is far from finished however. Congratulations, this is a very impressive project!

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.