Module ESP32-8048S070C

If doesn't fit into any other category ....
User avatar
cicciocb
Site Admin
Posts: 2058
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1358 times
Contact:

Re: Module ESP32-8048S070C

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat Jan 06, 2024 1:04 pm Having a good play now that I've got the idea about TFTGUI syntax :)
A few more questions.
Please explain the different INIT modes. Tried 10,11 & 12 but did not observe any difference.

Playing with some VERY large fonts eg 50pt and getting some flicker during update.
Obviously the micro has a lot of data to move at this size, but the flicker comes and goes over time, suggesting that there might be a 'good time' or 'bad time' to do an update. Is there any way of syncronising the update with a 'good time'?

Observation: Many user errors such as syntax or undeclared variables results in total crash and screen whipeout without ever reporting the error. Often requires hard reset or even power cycle.

Anything in particular you want tested?
The modes 10, 11 and 12 simply change the refresh frequency, the image should be more stable at 12 but it use more resources (the refresh is at 14MHz i.o. 12.5Mhz for the other modes).

To avoid the flicker, you must use a double buffer technique ... I'll show you how to do with some examples.

You can use the VGA examples already published on the forum as the commands are the same, except for the initial setup
BeanieBots
Posts: 345
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 183 times
Been thanked: 112 times

Re: Module ESP32-8048S070C

Post by BeanieBots »

Thanks, other than the wishy-washy red, not a bad display for the money.
I'll try out some of the VGA examples and then have a go at porting some existing TFT projects.
User avatar
cicciocb
Site Admin
Posts: 2058
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1358 times
Contact:

Re: Module ESP32-8048S070C

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat Jan 06, 2024 2:10 pm Thanks, other than the wishy-washy red, not a bad display for the money.
I'll try out some of the VGA examples and then have a go at porting some existing TFT projects.
Yes, globally is much cheaper than an M5stack module but is much much better.
BeanieBots
Posts: 345
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 183 times
Been thanked: 112 times

Re: Module ESP32-8048S070C

Post by BeanieBots »

Started to port over my analogue code.
A few TFT commands not available for VGA but those can be worked around.
The bigger problem is that circles are not round :shock:
I guess that might be because the pixels are probably not square, but is there anything that can be done about it?
User avatar
cicciocb
Site Admin
Posts: 2058
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1358 times
Contact:

Re: Module ESP32-8048S070C

Post by cicciocb »

Are you sure about the circles not round ?

What are the command missing ?
BeanieBots
Posts: 345
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 183 times
Been thanked: 112 times

Re: Module ESP32-8048S070C

Post by BeanieBots »

Could not get VGA.LINE to work. Therefore cannot draw lines!
VGA.PRINT does not appear to exist.
Nor does VGA.TEXT.POS

All I did initially to port the old code was to do a find and replace of "TFT." with "VGA."
That got me most of the way but I had quite a few TFT.TEXT.POS commands.
The workaround was to use VGA.TEXT.DRAW with x & y specified at the time of 'drawing' rathing than setting up the position before hand.

The line "vga.circle 400, 240 , 238,white,0" draws a circle with dimensions 89mm in x and 82mm in y.
Similarly, "VGA.RECT 10, 10, 460, 460, white ,1" draws a box 92mm * 85mm

Measuring the active area of the display, I get 154mm * 86mm +/- 1mm
The resolution of 800*480 gives a pixel size of around 0.1925 * 0.179 which might explain things.
Nothing like as bad as the [official 7" raspberryPi screen] but it is noticeable on large circles.
BeanieBots
Posts: 345
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 183 times
Been thanked: 112 times

Re: Module ESP32-8048S070C

Post by BeanieBots »

Had a few "odd" things happen so did a re-flash including Erase Flash and things are back to normal.
The VGA.LINE now also works as expected. Thanks for giving it a thickness parameter :D
Got the SD working too, which as you said, avoids the slightly annoying screen shift when doing file saves.
Can now get on and do something useful!

Can slots 1,2,3 & 4 be used for fonts as mentioned in the help?
I only appear to be able to use 10-13.

Will post some examples in case anybody else has this screen and might find them useful.
I agree that the capacitive touch is very nice too.
User avatar
cicciocb
Site Admin
Posts: 2058
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1358 times
Contact:

Re: Module ESP32-8048S070C

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Jan 12, 2024 7:13 pm Had a few "odd" things happen so did a re-flash including Erase Flash and things are back to normal.
The VGA.LINE now also works as expected. Thanks for giving it a thickness parameter :D
Got the SD working too, which as you said, avoids the slightly annoying screen shift when doing file saves.
Can now get on and do something useful!

Can slots 1,2,3 & 4 be used for fonts as mentioned in the help?
I only appear to be able to use 10-13.

Will post some examples in case anybody else has this screen and might find them useful.
I agree that the capacitive touch is very nice too.
No, only the fonts 10 to 13 are accessible but you can load any external font.
BeanieBots
Posts: 345
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 183 times
Been thanked: 112 times

Re: Module ESP32-8048S070C

Post by BeanieBots »

VGA.TEXT.PADDING works OK but is not syntax highlighted in the editor.
BeanieBots
Posts: 345
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 183 times
Been thanked: 112 times

Re: Module ESP32-8048S070C

Post by BeanieBots »

Just a quick example of how to draw a gauge the hard way!

Code: [Local Link Removed for Guests]

'******************************************************************************
'*                                                                            *
'*  A simple gauge the hard way !                                             *
'*                                                                            *
'******************************************************************************

Gosub InitLCD
'tft.loadfont "/fonts/FreeMono9pt7b.bin", 10
tft.loadfont "/fonts/FreeSans12pt7b.bin", 11
'tft.loadfont "/fonts/FreeSans18pt7b.bin", 12
'tft.loadfont "/fonts/FreeSans24pt7b.bin", 13

vga.circle 400,240,200,black,1
gosub draw
do
  gosub rotate
loop

wait
'###################################################################################
Draw:
 For N = 0 to 359 step 30 'Draw the large ticks
    A=2*Pi*n/360
    B=A+(Pi*n/360)
    C=A-(Pi*n/360)   
    X1=cos(a) * 220+400
    Y1=sin(a) * 220+240  
    H$=str$(n)    
    vga.text.align 4
    vga.text.color green   
    vga.text.draw H$, X1,Y1 ,11       
  Next N
  vga.show
Return
'###################################################################################
Rotate:
angle=0
gosub Arrow
For Angle = -0.001 to 360 step 0.5
  VGA.LINE x4, y4, CLx, CLy, black,11
  VGA.LINE x5, y5, CLx, CLy, black,11
  VGA.CIRCLE x6, y6, 35, black ,1
  VGA.TRIANGLE x1, y1, x2, y2, x3, y3, black ,1
  gosub Arrow  
pause 120
next angle
Return
'###################################################################################
Arrow:
  Inner=140
  Outer=200
  CLx=400
  CLy=240
  D=9                          'Angular width of triangle
  TW=D*2*Pi*1/360
  Rad=Angle*2*Pi*1/360
  A=Rad
  B=Rad+TW
  C=Rad-TW    
  X1=cos(a) * Outer+CLx
  Y1=sin(a) * Outer+CLy      
  X2=cos(b) * Inner+CLx
  Y2=sin(b) * Inner+CLy      
  X3=cos(c) * Inner+CLx
  Y3=sin(c) * Inner+CLy     
  X4=cos(a) * (Outer-20)+CLx 
  Y4=sin(a) * (Outer-20)+CLy    
  X5=cos(a) * (-Outer+80)+CLx 
  Y5=sin(a) * (-Outer+80)+CLy     
  X6=cos(a) * (-Outer+80)+CLx 
  Y6=sin(a) * (-Outer+80)+CLy     
  X7=cos(a) * (-Outer+50)+CLx 
  Y7=sin(a) * (-Outer+50)+CLy     
  VGA.LINE x4, y4, CLx, CLy, white,11
  VGA.LINE x5, y5, CLx, CLy, white,11
  VGA.CIRCLE x6, y6, 35, white ,1
  VGA.CIRCLE x7, y7, 40, black ,1
  VGA.TRIANGLE x1, y1, x2, y2, x3, y3, white ,1
  VGA.CIRCLE CLx, Cly, 11, white ,0
  VGA.CIRCLE CLx, Cly, 9, black ,1    
  vga.show
Return
'###################################################################################
InitLCD:
'Note: Config options module must be set to custom - No TFT
'SPI Pins: MOSI=11, MISO=13, SCLK=12
'TFT pins all set to -1 SDcard CS=10
'I2S pins BCLK=0, WSEL=18, DOUT=17
  vga.pinout 14, 21, 47, 48, 45, 9, 46, 3, 8, 16, 1, 15, 7, 6, 5, 4, 39, 40, 41, 42
  vga.delete 'Reclaim memory
  option.touch 1 'setup capacitive touch
  i2c.setup 19, 20
  touch.init 'initialise the capacitive touch
  vga.init 12, 2
  'pin.mode 2, output  ' backlight
  'pin(2) = 1          'is on pin 2
  pwm.setup 2, 7, 128   'set backlight brightness 0-255
  vgagui.init 50, tft.rgb(32,32,64)
Return
You do not have the required permissions to view the files attached to this post.
Post Reply