VGA out for ESP32-S3 - New feature to test

All about the VGA for the ESP32-S3
Post Reply
User avatar
cicciocb
Site Admin
Posts: 2056
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1354 times
Contact:

VGA out for ESP32-S3 - New feature to test

Post by cicciocb »

As discussed into another post, I'm introducing a new feature for the ESP32-S3.

The VGA out enables the use of an external VGA monitor as a graphic output for the module.

This works only under the following conditions :
1) The module must be an ESP32-S3 with PSRAM
2) The module must have the FLASH and the PSRAM with octal interface (opi / opi)
3) The modules with quad FLASH (qio) and octal PSRAM (opi) will work too but with some limitations on the resolution

The color depth has been defined at 8 bits for a max of 256 colors.
The scheme is 332 (3 bits for red, 3 bits for green, 2 bits for blue)

You'll find below a preliminary schematic for the wiring
image.png
For the initial test, the wiring can be done for achieving only 8 colors with this simplified wiring
image.png
For this initial testing, the colors are always defined as 16 bits (same as the TFT) but only the most significant bits will be used.

II'm still in the development so I'll continue in few minutes :D
You do not have the required permissions to view the files attached to this post.
User avatar
cicciocb
Site Admin
Posts: 2056
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1354 times
Contact:

Re: VGA out for ESP32-S3 - New feature to test

Post by cicciocb »

Please find here the following .bin

This is for ESP32-S3 with QIO FLASH and OPI PSRAM; any other combination will not work
Annex32S3.bin
I included also a little series of examples I'm using for the testing.
Not all work but can be a good baseline to understand
examples_VGA.zip
The very synthetic documentation :
image.png
image.png
Video modes table
image.png
Do not hesitate to ask, I'm still working on and this is just a very preliminary release
You do not have the required permissions to view the files attached to this post.
User avatar
Electroguard
Posts: 860
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 274 times
Been thanked: 322 times

Re: VGA out for ESP32-S3 - New feature to test

Post by Electroguard »

Firstly... wow Franc, thank you for all the huge work you keep putting in to Annex, I don't know how you find the time and energy.
I need to finish off the wiring of the multiple 0vs tomorrow before I can actually test the output, but I have upgraded the N16R8 to 1.50.5
A couple of feedback points...

The Multiplatform Toolkit Advanced Options defaults to 40Mhz, so I changed to 80Mhz cos I assumed that fastest is best.

toolkit.jpg


I flashed using the Green button, but anyone needing existing contents should save them first, cos the new LFS will overwrite.
The new LFS File Manager is great BTW, uploaded the vga examples zip no problems.

update2s.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
cicciocb
Site Admin
Posts: 2056
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1354 times
Contact:

Re: VGA out for ESP32-S3 - New feature to test

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Wed Jul 12, 2023 10:29 pm Firstly... wow Franc, thank you for all the huge work you keep putting in to Annex, I don't know how you find the time and energy.
I need to finish off the wiring of the multiple 0vs tomorrow before I can actually test the output, but I have upgraded the N16R8 to 1.50.5
A couple of feedback points...

The Multiplatform Toolkit Advanced Options defaults to 40Mhz, so I changed to 80Mhz cos I assumed that fastest is best.


toolkit.jpg



I flashed using the Green button, but anyone needing existing contents should save them first, cos the new LFS will overwrite.
The new LFS File Manager is great BTW, uploaded the vga examples zip no problems.


update2s.jpg
Hi Robin,
thanks for the feedback.

Yes, you can select 80MHz even, if I understood correctly, this do not matter as this concerns only the speed of the bootloader and then the real speed is defined inside the .bin (I'm not really sure about that :D ).

I confirm that the new LFS file system delete all the existing files if the module was in FFAT format but you'll notice that now is much faster than before; I think that you noticed how fast you can import the files from the zip package.

Enjoy the testing, I have some other demo program that I'll try to send you later today, just to show the possibilities of the VGA output.

What I can say is that is very stable but, on the modules with QIO Flash (the one that you have), the resolution is limited at 640 x 480 that is a very good result considering that all is done without any interface.
It seems a little bit complicated the way I'm actually using to define the video modes (using a lot of parameters) but this is mainly because I'm exploring the different combinations with different VGA monitors.
The reason is because the actual frequency selection do not permit to have the exact frequencies required to comply with the VGA standard so some monitors works and other don't but all works when selecting the parameters within their own tolerances.
I'll obviously simplify the whole at the end with an unique "mode" parameter.
Another big advantage is that, as the DMA process use the PSRAM that is 8MB :o , it is possible to have several buffers and manage them to have different layers to have transparent texts, sprites, etc.

Another advantage is that, as all relies on an H/W module contained inside the ESP32-S3, there is practically no impact on the CPU performances
User avatar
Electroguard
Posts: 860
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 274 times
Been thanked: 322 times

Re: VGA out for ESP32-S3 - New feature to test

Post by Electroguard »

Perhaps may help others also...

vgabothc.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Electroguard
Posts: 860
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 274 times
Been thanked: 322 times

Re: VGA out for ESP32-S3 - New feature to test

Post by Electroguard »

Should newfile11.bas be expected to work on my simple setup ?
I didn't see an example of vgaout.pinout being used, so to make sure the configuration matched with the single R,G,B plus H and V sync pins which I connected as per the picture, I added vgaout.pinout 8, -1, -1, 14, -1, -1, 21, -1, 1, 2 line as per instructions.
The only other change was to add wlog r to confirm script was running, cos not seen anything on the vga monitor when running any of the examples.

The Dell monitor was in use with a 2nd computer until I swapped in a vga extension cable from the N16R8 connections, and its screen-saver is moving.
I can butcher another vga cable if necessary, but want to check whether the script configuration might be wrong first (or perhaps my N16R8 is not suitable).

newfile11b.jpg

monitor2.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
cicciocb
Site Admin
Posts: 2056
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1354 times
Contact:

Re: VGA out for ESP32-S3 - New feature to test

Post by cicciocb »

The hardest part is starting ....

- Do not change the setting for the pinout, you can even suppress the line as, by default, is configured as per the schematics.

- If you want use it, the correct command is vgaout.pinout -1, -1, 8, -1, -1,14, -1, 21, 1, 2

- Do not use the examples where the vgaout.init is present, try the others. As I said not all the examples work.

- use the command vgaout.delete each time you change the mode otherwise the mode will not be taken into account
User avatar
cicciocb
Site Admin
Posts: 2056
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1354 times
Contact:

Re: VGA out for ESP32-S3 - New feature to test

Post by cicciocb »

Some images shown directly on a VGA monitor at 256 colors.
The result is nicer than I was expecting ...

User avatar
Electroguard
Posts: 860
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 274 times
Been thanked: 322 times

Re: VGA out for ESP32-S3 - New feature to test

Post by Electroguard »

The picture looks great, shouldn't you put the top down on your car though in case it rains!

I went through all the vga examples, and tried everything without vgaout.setup, but my monitor has never even winked at me once, just a permanent scowl. I need a basic vga example that would make any vga monitor give an encouraging wink as-is.

I'll try to find a different vga cable, but all the kvm ones I have found are like tow ropes.

I also should try some different resistor values ... which were all neatly sorted out into drawers according to range (100R+, 1K+, 10K+, 100K+ etc), but the glue on the useless tape across the ends has dried out in the heat, so now each drawer just contains a prickly unreadable tangled 1/8W mess.
Need to be ordering a range of 1/2W resistors that don't need tweezers and microscope, but my resistor tolerance is pretty low at the moment.

(that is a very impressive and encouraging 640 x 480 picture demo, BTW)
User avatar
cicciocb
Site Admin
Posts: 2056
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1354 times
Contact:

Re: VGA out for ESP32-S3 - New feature to test

Post by cicciocb »

The value for the resistors is not really important, in particular for simple 1 bit RGB, you could even connect directly without them, you'll just have an over-saturated image.

The classic questions :
- have you checked the wiring?
- have you tried with another monitor?

Sometime the monitor is not able to catch the format but could show a message like "out of sync" ; this is a good sign.

The minimal example is very very simple :

Code: [Local Link Removed for Guests]

vgaout.delete
vgaout.setup 12, 20, 64, 320, 9, 3, 20, 240, 16000000, 0, 0, 2
This is for 320x240

then you can try these for 640x480

Code: [Local Link Removed for Guests]

vgaout.delete
vgaout.setup 16,	96,	48,	640,	10,	2,	33,	480,	25175000
or

Code: [Local Link Removed for Guests]

vgaout.delete
vgaout.setup 16,	96,	48,	640,	10,	2,	33,	480,	26000000
or

Code: [Local Link Removed for Guests]

vgaout.delete
vgaout.setup 24,	40,	128,	640,	9,	3,	20,	480,	31500000
or

Code: [Local Link Removed for Guests]

vgaout.delete
vgaout.setup 40,	104,	48,	640,	10,	2,	33,	480,	25000000




you should have a red square and a cyan circle shown on the screen
Post Reply