Posts: 204
Joined: Thu Jan 28, 2021 8:13 pm
Contact: Website

Monochrome VGA?

Thu May 06, 2021 11:55 am

Hi folks

I've been thinking about using a Pico with VGA output. I see there are some commercial VGA expansion boards and a couple of circuit diagrams, but... I only need monochrome. I don't want to tie up all the GPIO pins when all I need (I think) are one colour and two sync lines.

What I'm wondering is whether the software examples provided could be made simpler, or to run more efficiently, with only monochrome output. On the face of it, it ought to be simpler and more efficient, because you're handling much less data. On the other hand, I really don't understand how any of the sample code works, how it interacts with DMA and PIO, and all that stuff. I could be completely wrong.

If I am completely wrong, I could just use the existing sample code, and just wire up only one colour pin to one GPIO pin. On the other hand, I'd rather do things efficiently if I can.

Does anybody have any thoughts on this? I confess that I do not find the sample VGA code at all easy to follow.


Posts: 16
Joined: Thu Feb 08, 2018 2:42 pm
Contact: Website Twitter

Re: Monochrome VGA?

Thu May 06, 2021 12:40 pm

FYI, Pa@ART implemented a composite video signal generator using PIO. It requires only two GPIO pins for generating monochrome video signal. ... 4892974080

Posts: 9974
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Monochrome VGA?

Thu May 06, 2021 1:55 pm

There's also "pico-mposite" - ... ry-pi-pico

I have done bit-banged PAL monochrome composite on a PIC16F77 at 4MHz using just two output pins and two resistors so 'it can be done on anything'.

Looking at some of the projects for various micros will be good background for what's being done, what clever tricks can be employed.

It is possible to bit-bang a colour burst which the PIO might be able to handle. It's a real shame the RP2040 doesn't have any DAC to make analogue output easier, using fewer GPIO pins.

Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 640
Joined: Fri Apr 12, 2019 11:00 am
Location: austin tx

Re: Monochrome VGA?

Thu May 06, 2021 2:03 pm

the pico_scanvideo code in pico_extras basically handles the timing, buffer management and pin outputs from scanline buffer data independently.

the buffer->pins is done by the "scanline" PIO program; the default one assumes 16bpp, but you can replace it with another one which uses greyscale or even 1bpp. (You set the pio program via the pio_program member of the vga_mode structure)

Return to “SDK”