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: 2160
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 461 times
Been thanked: 1435 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]Sun Jul 16, 2023 3:47 pm Sorry to be a little off-topic but I noticed in the table that the SPI voltage for the two devices is only 1.8v. (presumably for the flash/ram chips)
Does that mean that neither of those devices will be capable of driving a TFT display and/or potentially many other SPI devices?
No, the voltage is referred to the SPI dedicated to the Flash and PSRAM.
The module continue to use 3.3V on all the pins (I have one of these modules)
User avatar
cicciocb
Site Admin
Posts: 2160
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 461 times
Been thanked: 1435 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]Sun Jul 16, 2023 10:44 am I use this:
image.png

I have modified the program and captured the result through the serial port:

Code: [Local Link Removed for Guests]

vgaout.delete

print "MODE 1"
vgaout.setup 12, 20, 64,320, 9,3,20,240,16000000 ' MODE 1 (image out of range)
gosub Test

print "MODE 2"
vgaout.setup 16, 96, 48,640,10,2,33,480,25175000 ' MODE 2 (image shifted right)
gosub Test

print "MODE 3"
vgaout.setup 16, 96, 48,640,10,2,33,480,26000000 ' MODE 3 (picture perfect fit)
gosub Test

print "MODE 4"
vgaout.setup 24, 40,128,640, 9,3,20,480,31500000 ' MODE 4 (image slightly shifted to the right)
gosub Test

print "MODE 5"
vgaout.setup 40,104, 48,640,10,2,33,480,26000000 ' MODE 5 (image shifted far to the right)
gosub Test

print "MODE 6"
vgaout.setup 40,128, 88,800, 1,4,23,600,40000000 ' MODE 6 (image skips continuously to the right)
gosub Test

END

' ------------------
Test:
  vgaout.fill black

  for bucle = 1 to 3
    r = rnd(256)
    g = rnd(256)
    b = rnd(256)

    for i = 0 to 240 step 4
      vgaout.rect i, i, 630-i*2, 480-i*2, TFT.RGB(r,g,b) 
      vgaout.show
      pause 25
    next i

    for i = 240 to 0 step -4
      vgaout.rect i, i, 630-i*2, 480-i*2, TFT.RGB(g,r,b)
      vgaout.show
      pause 25
    next i
  
  next bucle  

  vgaout.delete

return
log.txt

Tonight I will take a closer look at the rest of your message. Thank you.
Thanks Fernando but the log do not give any useful info.
You should try to set your monitor into its advanced parameters
User avatar
Fernando Perez
Posts: 378
Joined: Mon Feb 15, 2021 10:09 pm
Location: Santander (Spain)
Has thanked: 195 times
Been thanked: 267 times

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

Post by Fernando Perez »

That is a good question. I have TFT screens ILI9341, ILI9486, ST7796 and some others that I don't remember now.
The GPIOs available on the ESP32-S3-WROOM-1 N16R8 board differ from the "normal" ones in that they range from GPIO0 to GPIO21, GPIO39 to GPIO42, and GPIO45 to GPIO48.
How do we connect our screens and how do we configure the advanced setting of this board?
User avatar
cicciocb
Site Admin
Posts: 2160
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 461 times
Been thanked: 1435 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]Sun Jul 16, 2023 4:59 pm That is a good question. I have TFT screens ILI9341, ILI9486, ST7796 and some others that I don't remember now.
The GPIOs available on the ESP32-S3-WROOM-1 N16R8 board differ from the "normal" ones in that they range from GPIO0 to GPIO21, GPIO39 to GPIO42, and GPIO45 to GPIO48.
How do we connect our screens and how do we configure the advanced setting of this board?
You can use any pin, you are completely free to choose the ones you want.
Avoid just to use the pin dedicated to the USB
edit :

by default the pins are defined as below :

Code: [Local Link Removed for Guests]

		// set the pins in function of the module
#if defined(CONFIG_IDF_TARGET_ESP32S2) 
	TFT_MOSI_pin = 11;
	TFT_MISO_pin = 13;
	TFT_SCLK_pin = 12;
	TFT_CS_pin = 10;
	TFT_DC_pin = 9;
	TFT_RST_pin = 14;
	TFT_BL_pin = 15;  // backlight
	TFT_TOUCH_pin = 16;
	TFT_SPI_frequency = 40000000; // this is overridden into Annex32_Init.h giving the right speed for each display
	SDCARD_CS_pin = 17;
	// pins used for the I2S port (sound)
	I2S_BCLK_pin = 39;
	I2S_WSEL_pin = 40;
	I2S_DOUT_pin = 41;
#elif defined(CONFIG_IDF_TARGET_ESP32S3) 
	TFT_MOSI_pin = 11;
	TFT_MISO_pin = 13;
	TFT_SCLK_pin = 12;
	TFT_CS_pin = 10;
	TFT_DC_pin = 9;
	TFT_RST_pin = 14;
	TFT_BL_pin = 15;  // backlight
	TFT_TOUCH_pin = 16;
	TFT_SPI_frequency = 40000000; // this is overridden into Annex32_Init.h giving the right speed for each display
	SDCARD_CS_pin = 17;
	// pins used for the I2S port (sound)
	I2S_BCLK_pin = 39;
	I2S_WSEL_pin = 40;
	I2S_DOUT_pin = 41;
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
	TFT_MOSI_pin = 6;
	TFT_MISO_pin = 5;
	TFT_SCLK_pin = 4;
	TFT_CS_pin = 7;
	TFT_DC_pin = 8;
	TFT_RST_pin = 3;
	TFT_BL_pin = -1;  // backlight
	TFT_TOUCH_pin = -1;
	TFT_SPI_frequency = 40000000; // this is overridden into Annex32_Init.h giving the right speed for each display
	SDCARD_CS_pin = 10;
	// pins used for the I2S port (sound)
	I2S_BCLK_pin = -1;
	I2S_WSEL_pin = -1;
	I2S_DOUT_pin = -1;
#else
	TFT_MOSI_pin = 23;  // can be 14 if the SDCARD is wired on the bus SPI2
	TFT_MISO_pin = 19;  // can be 2  if the SDCARD is wired on the bus SPI2 
	TFT_SCLK_pin = 18;  // can be 15 if the SDCARD is wired on the bus SPI2
	TFT_CS_pin = 14;  // can be 12 if the SDCARD is wired on the bus SPI2
	TFT_DC_pin = 27;
	TFT_RST_pin = 33;
	TFT_BL_pin = 32;  // backlight
	TFT_TOUCH_pin = 0;
	TFT_SPI_frequency = 40000000; // this is overridden into Annex32_Init.h giving the right speed for each display
	SDCARD_CS_pin = 4;
	// pins used for the I2S port (sound)
	I2S_BCLK_pin = 5;
	I2S_WSEL_pin = 26;
	I2S_DOUT_pin = 2;
#endif
User avatar
cicciocb
Site Admin
Posts: 2160
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 461 times
Been thanked: 1435 times
Contact:

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

Post by cicciocb »

Fernando, for the 320x240 try to use this setup

vgaout.setup 4,48,28,320,10,2,33,240,12587500, 0,0,2
User avatar
Fernando Perez
Posts: 378
Joined: Mon Feb 15, 2021 10:09 pm
Location: Santander (Spain)
Has thanked: 195 times
Been thanked: 267 times

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

Post by Fernando Perez »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sun Jul 16, 2023 5:58 pm Fernando, for the 320x240 try to use this setup

vgaout.setup 4,48,28,320,10,2,33,240,12587500, 0,0,2
A correct and totally stable image appears.
Good!

Code: [Local Link Removed for Guests]

' ------------------
Test320:
  vgaout.delete
  vgaout.setup 4,48,28,320,10,2,33,240,12587500,0,0,2
  vgaout.fill black
  for i = 0 to 120 step 4
    vgaout.rect i, i, 315-i*2, 240-i*2, white
    vgaout.show
    pause 25
  next i
  pause 5000
return 
User avatar
cicciocb
Site Admin
Posts: 2160
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 461 times
Been thanked: 1435 times
Contact:

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

Post by cicciocb »

Another feature under test : the sprites :mrgreen:

User avatar
Fernando Perez
Posts: 378
Joined: Mon Feb 15, 2021 10:09 pm
Location: Santander (Spain)
Has thanked: 195 times
Been thanked: 267 times

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

Post by Fernando Perez »

A font appears in your video that looks quite acceptable. Which is it?
I've written a program to check all the FreeFonts you suggest, but none of them look that good. (Some downright ugly.)
https://youtu.be/Rxa6lwb-bcA

For my convenience, I have shortened the name of the fonts, so I am attaching the zip file.
fonts.zip

Code: [Local Link Removed for Guests]

' TEST FONTS VGA 640x480
dim fontName$(3) = "", "Mono", "Sans", "Serif"
dim fontSize$(4) = "", "9", "12", "18", "24"
dim fontEmpha$(4) = "", "", "B", "I", "IB"

dim yPos(4) = 0, 20, 110, 210, 345
dim inter(4) = 0, 18, 20, 28, 35
x = 20 : y = 20

vgaout.delete
vgaout.setup 16, 96, 48, 640, 10, 2, 33, 480, 26000000 ' MODE 3 (best fit 640x480)
vgaout.text.color yellow, black
vgaout.text.size 1
  
while 1
  vgaout.fill black
  for Name = 1 to 3
    for Size = 1 to 4
      y = yPos(Size)
      for Empha = 1 to 4
        gosub Test
        y = y + inter(Size)
      next Empha
    next Size
    pause 15000
    vgaout.fill black
  next Name
wend

Test:
  font$ = fontName$(Name) + fontSize$(Size) + fontEmpha$(Empha)
  if left$(font$, 4) <> "Mono" then y = y + 2
  mess$  = "ANNEX RDS in " + font$
  font$  = "/fonts/" + font$ + ".bin"
  tft.loadfont font$
  vgaout.text.font 10
  vgaout.text.pos x, y
  vgaout.print mess$ 
  vgaout.show
return
In the synthetic documentation of your first message, vgaout.text.print appears, which gives me an error. It works fine with vgaout.print.
You do not have the required permissions to view the files attached to this post.
User avatar
cicciocb
Site Admin
Posts: 2160
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 461 times
Been thanked: 1435 times
Contact:

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

Post by cicciocb »

Fernando,
all the fonts are in the examples .zip I attached in the previous posts.

You can freely define your font using the online font editor available here
[Local Link Removed for Guests]

You can take any font in Adafruit GFX format and export for annex
User avatar
Electroguard
Posts: 921
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 302 times
Been thanked: 339 times

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

Post by Electroguard »

Francesco, the colour names don't seem to be recognised as global numeric or string$ variables, so it only seems possible to refer to them specifically and individually as a component parameter which recognises them.
is there a way to use them globally, such as a selection of pre-defined colours to pick from eg: in a listbox$ ?

Shouldn't be a problem if not, cos I have defined my own global list of colour names in the past, but no point in re-inventing the wheel if not necessary.

red=tft.rgb(255,0,0):green=tft.rgb(0,255,0):blue=tft.rgb(0,0,255)
darkred=tft.rgb(150, 0, 0):darkgreen=tft.rgb(0,150,0):darkblue=tft.rgb(0,0,150)
cyan=tft.rgb(0,255,255):pink=tft.rgb(255,0,255):orange=tft.rgb(255,165,0):yellow=tft.rgb(255,255,5)
black=0:white=tft.rgb(255,255,255):lightgrey=tft.rgb(200,200,200):darkgrey=tft.rgb(128,128,128)
Post Reply