Generating VGA Color Video - The "Official" Solution

Continuing my experiences with video generation, let's take a look what we got in the official documentation and repositories (notice that the software is marked as "worked in progress").


It works!


The VGA signals are simpler than the composite video we saw before, as each one carries a single information: horizontal sync, vertical sync, Red intensity, Green intensity and Blue intensity (there is also the option in most monitors of using a composite sync that combines horizontal and vertical sync, this is not directly supported in this solution).

The hardware for VGA video generation is described in the official "Hardware design with RP2040" document. Three "resistor ladders" are used to implement a DAC for each color (R, G, B). 5 bits are used per color, resulting in 32 levels per color and 32K different colors.

The figure bellow (adapted from the above document) has the necessary information for constructing the hardware. The DACs resistor should be 1% precision, the resistor at the sync signals can be regular 5% precision.

VGA generation circuit

I built my prototype in a breadboard, soldering would probably give a image with less interference. 

There are a few examples in the "pico playground" repository (under "scanvideo"). They require the C/C++ SDK and "pico-extras" (where the video routines are). I started with the "test-pattern" example, it generates the image shown in the photo at the top. I suggest you do so if you wanna try this solution. If nothing shows at the monitor, you probably messed something with the sync signals (also make sure that the VGA "analog" input is selected in your monitor). If the colors or intensity are wrong, check the DAC resistors connections to the Pi Pico and the VGA connector.

Most of the examples available are simple and (for now) the documentation for the software is in the source code.

Comments

Popular posts from this blog