The Incredible PicoVGA Project
Continuing my search for a way to implement an alphanumeric serial terminal with the Raspberry Pi Pico, I found the extraordinary PicoVGA project. It is a very complete library for generating video for VGA monitors, with incredible examples.
PicoVGA demo |
The first thing to comment on is the hardware. The official solution used by the SDK works with 16 bits per pixel, giving 32 levels (5 bits) for red, green and blue (um bit is not used) and generates separated horizontal and vertical sync signals. The PicoVGA project uses 8 bits per pixel (8 levels of red, 8 levels of green and 4 levels of blue) e a combined horizontal and vertical sync signal (CSYNC). This results in a very simple circuit, using less pins of the RP2040 (at the cost of less colors).
PicoVGA circuit - adapted from the official site |
This allowed me to build it using the RP2040 Zero (with enough remaining pins to connect a buzzer and a serial port). My assembly worked at first try with the balloon demo (but I had mixed up the red and blue signals).
My assembly |
The code supports many resolutions (even above 640x480) and many video formats (including 1/2/4/8 bits per pixel graphics and monochrome and color alphanumeric). This formats can even be combined in the same screen. There is also support for multiple planes with transparency and sprites. The video generation code runs in the RP2040's core 1, leaving the core 0 free for the application code. Overclock is automatically done if the resolution requires it.
The library can also generate SCART TV video and PWM sound (these features are not of my interest right now).
This capabilities are very above what I need to develop my serial terminal. There is a "Matrix Rain" demo that generates color alphanumeric video with 60 rows of 30 columns.
I am still learning how the library works. The generation of the bytes sent to the PIO to generate the video is done in assembly code!
A possible problem is that the library and examples is not compiled using the official SDK way. The code includes a subset of the SDK and uses makefiles (instead of CMake) to specify what has to be compiled. I will have to choose which way I will use in my project.
Note: This post is an adaptation of a post I wrote in January 3rd in my Portuguese blog. Since them my terminal project has advanced and is near its completion (as far as projects are ever complete). More or this in the next posts.
Comments
Post a Comment