Print a text to a VGA display from pico

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
Citylights
Posts: 13
Joined: Sat Jul 10, 2021 7:31 pm

Print a text to a VGA display from pico

Post by Citylights » Sat Jul 10, 2021 7:35 pm

Hi

i want to print a text in white letters in a blue rectangle at the center of the screen
without using any external components (i.e resistors) only cabling.

how can i do that in MicroPython?

thank you.

Citylights
Posts: 13
Joined: Sat Jul 10, 2021 7:31 pm

Re: Print a text to a VGA display from pico

Post by Citylights » Sun Jul 11, 2021 10:12 am

can't be done in MicroPython?

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Print a text to a VGA display from pico

Post by jimmo » Sun Jul 11, 2021 2:44 pm

Citylights wrote:
Sat Jul 10, 2021 7:35 pm
without using any external components (i.e resistors) only cabling.
You mean wire the VGA cable directly to the pins of the Pico board?

I don't think this can be done in any language (because the resistors are necessary to build the DAC)? Do you have an example?

Although.... I guess maybe if you only want white and blue, then you only care about either 100% or 0% output on the channel, so you don't technically need the DAC. Is that what you mean?

Citylights
Posts: 13
Joined: Sat Jul 10, 2021 7:31 pm

Re: Print a text to a VGA display from pico

Post by Citylights » Sun Jul 11, 2021 2:53 pm

yes here you are

https://www.youtube.com/watch?v=qJ68fRff5_k

although it's in C and uses ESP32

i want to do similar thing in pico using MicroPython using resistors doesn't bother me much, although
if they are needed or not i think it depends what you're trying to do, the coding is the problem.

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: Print a text to a VGA display from pico

Post by scruss » Sun Jul 11, 2021 9:07 pm

It's already been fairly categorically stated on the other board that no code to do this currently exists in MicroPython for the Raspberry Pi Pico.

Citylights
Posts: 13
Joined: Sat Jul 10, 2021 7:31 pm

Re: Print a text to a VGA display from pico

Post by Citylights » Mon Jul 12, 2021 5:37 am

scruss wrote:
Sun Jul 11, 2021 9:07 pm
It's already been fairly categorically stated on the other board that no code to do this currently exists in MicroPython for the Raspberry Pi Pico.

as it actually stated by another member there in his last messages:

MicroPython is already capable of drawing coloured images and writing text to a screen. The limitation is that such a screen is a frame buffer in memory.

That can be printed out as numeric data on the console, shown on an LCD or OLED display, show on a LED matrix, saved as a .BMP or .GIF file on the Pico's file system, even sent to a Pi or other host to be displayed on whatever is attached to that, but there is currently no way of viewing a frame buffer on a monitor or TV attached directly to a Pico when using MicroPython.

What is lacking is a 'render this frame buffer as VGA / DVI (HDMI) / composite" code for MicroPython.

I am sure there are plenty who could help with that but they haven't come along yet to weave their magic.

so somebody here might have created a library for that, or can give some guidelines
as to how i can do simple graphics.

hippy
Posts: 130
Joined: Sat Feb 20, 2021 2:46 pm
Location: UK

Re: Print a text to a VGA display from pico

Post by hippy » Mon Jul 12, 2021 4:50 pm

Citylights wrote:
Mon Jul 12, 2021 5:37 am
What is lacking is a 'render this frame buffer as VGA / DVI (HDMI) / composite" code for MicroPython.

I am sure there are plenty who could help with that but they haven't come along yet to weave their magic.
so somebody here might have created a library for that, or can give some guidelines
as to how i can do simple graphics.
A posting on the Raspberry Pi "Pico General" forum may elicit more interest, be more likely to catch the eye of someone who has done it in C and would be willing to help with integration to MicroPython.

I have created the high-level MicroPython code for video output and have a C Extension Module which reduces the requirements to "here's the address of a frame buffer, here are the details of its geometry, these are the pins to use for the resistor DAC and syncs et al - Please supply code to render that frame buffer as Composite / VGA / DVI (HDMI)".

I haven't posted that myself because I am still checking there's nothing I have missed, am looking to see what I may be able to achieve without asking or needing help.

My starting requirement would be providing a QVGA 320 x 240 frame buffer using one byte per pixel with RGB332 encoding. To be rendered as VGA 640 x 480. If we can get code for that it should be good enough for now, and hopefully easy enough to update for other configurations.

Forget about the "no resistors" requirement, don't mention it. That's not relevant as it is going to be the resistor solution with resistors left out at the end of the proverbial day. The problems having no resistors can cause will only cloud discussions, get in the way of what needs to be done - as it already has here.

Citylights
Posts: 13
Joined: Sat Jul 10, 2021 7:31 pm

Re: Print a text to a VGA display from pico

Post by Citylights » Mon Jul 12, 2021 7:12 pm

hippy wrote:
Mon Jul 12, 2021 4:50 pm

I have created the high-level MicroPython code for video output and have a C Extension Module which reduces the requirements to "here's the address of a frame buffer, here are the details of its geometry, these are the pins to use for the resistor DAC and syncs et al - Please supply code to render that frame buffer as Composite / VGA / DVI (HDMI)".

I haven't posted that myself because I am still checking there's nothing I have missed, am looking to see what I may be able to achieve without asking or needing help.

My starting requirement would be providing a QVGA 320 x 240 frame buffer using one byte per pixel with RGB332 encoding. To be rendered as VGA 640 x 480. If we can get code for that it should be good enough for now, and hopefully easy enough to update for other configurations.

Forget about the "no resistors" requirement, don't mention it. That's not relevant as it is going to be the resistor solution with resistors left out at the end of the proverbial day. The problems having no resistors can cause will only cloud discussions, get in the way of what needs to be done - as it already has here.
that's great news! :D

and the resolution it's ok too as long as all this it can be done.

although maybe somebody from here can assist your try, as this function for pico using MicroPython
could be useful to many people.

Post Reply