ESP32 RGB Interface Display

What do you want to achieve?

I would like to use a display conected direct to the ESP32-S3 trought the RGB interface. I have an Evaluation Board bought at Aliexpress, witch has a 7" display with no controler like ILI9341_DRIVER

What have you tried so far?

I had some success with others displays that uses SPI interface or parallel (8 bit) interfaces, both using arduino IDE. I do not found any documentation about using arduino and RGB interface directly, nether a README file. I saw that on squareline studio, we have an Expressif project that uses an evaluation board ESP32-S3-LCD-EV-Board. This EV has the capability of comunicating direct by RGB interface, but, once again, I do not found any documentation about how to change the libs (defines, pins, …) to match with my board. I tried to adapt the file “esp32_s3_lcd_ev_board.h” to mach with the pinout and parameters of my display board, but it was not enough!

this is the link to the board I bought:

https://es.aliexpress.com/item/1005004952726089.html?spm=a2g0o.order_list.order_list_main.5.21ef194d2vFigv&gatewayAdapt=glo2esp

Screenshot or video

Others

  • **SquareLine Studio version: 1.2.1
  • **Operating system: windows.
  • **Target hardware: ESP32-S3

I have similor or maybe same board. Please try example from my repo.

Hi, dronecz. Thank you for the answer!
I was looking into your files and I compare your “.ino” file with mine.

In my case, the SquaLine Studio did not insert this lib on my code:
#include <Arduino_GFX_Library.h>”

nether this part of code:

#define TFT_BL 2

Arduino_ESP32RGBPanel bus = new Arduino_ESP32RGBPanel(
GFX_NOT_DEFINED /
CS /, GFX_NOT_DEFINED / SCK /, GFX_NOT_DEFINED / SDA /,
41 /
DE /, 40 / VSYNC /, 39 / HSYNC /, 42 / PCLK /,
14 /
R0 /, 21 / R1 /, 47 / R2 /, 48 / R3 /, 45 / R4 /,
9 /
G0 /, 46 / G1 /, 3 / G2 /, 8 / G3 /, 16 / G4 /, 1 / G5 /,
15 /
B0 /, 7 / B1 /, 6 / B2 /, 5 / B3 /, 4 / B4 /
);
// option 1:
// 7寸 50PIN 800
480
Arduino_RPi_DPI_RGBPanel gfx = new Arduino_RPi_DPI_RGBPanel(
bus,
// 800 /
width /, 0 / hsync_polarity /, 8/ hsync_front_porch /, 2 / hsync_pulse_width /, 43/ hsync_back_porch /,
// 480 /
height /, 0 / vsync_polarity /, 8 / vsync_front_porch /, 2/ vsync_pulse_width /, 12 / vsync_back_porch /,
// 1 /
pclk_active_neg /, 16000000 / prefer_speed /, true / auto_flush */);

800 /* width /, 0 / hsync_polarity /, 210 / hsync_front_porch /, 30 / hsync_pulse_width /, 16 / hsync_back_porch /,
480 /
height /, 0 / vsync_polarity /, 22 / vsync_front_porch /, 13 / vsync_pulse_width /, 10 / vsync_back_porch /,
1 /
pclk_active_neg /, 16000000 / prefer_speed /, true / auto_flush */);

So, I opened the “Simple_buton.spj” file direct on SquareLine Studio, to see the Project Settings. At this point, there was no diference for my projetc!

So, I have some questions for you. Did you just clicked on “Export/Create Template Project” and then, clicked on “Export/Export UI Files” and after that the files was created exactly as they are on you repo? (Excluding the PWM parts)

where did you read about the parts of code I mentioned above? Is there any README or user guide that helps me to do as you did?

Thank you again!! I am almost there!! Thanks to you!

dronecz - your version will not compile with the latest version of the Ardunio GFX libs. For some reason I do not understand they removed the RPI panel - fix is now on the Wiki - Dev Device Declaration · moononournation/Arduino_GFX Wiki · GitHub

Hi, HowardAtHome.
Thank you for the answer.
This repo has a lot of new information that I dind’t know!
Do you know where can I find some info about how to integrate this library with the SquareLine Studio? Do you know if is there a way to export UI files already containing this lib? Or I need to adapt it after export the UI files?

It is really easy to integrate with the Arduino IDE (I am a beginner here too). First you do not need to do anything clever with the libraries. I just use the standard process in the IDE to get the LVGL and Arduino_GFX libs. Create a new project, use the example .INO you have with the modified Panel. Change the line at the end of the setup() from LV_demo () to ui_init(); the add #include “ui.h” at the top.

Next from Squareline Export UI to the same directory as the .INO - Arduino only compiles files in either the top directory or the /src. I prefer the same directory as you get to see the files in the IDE.

Should now just work - no edits to UI files needed, it is all very easy. You do not need to use the Create Template Project.

I’ll try to get my board uploaded somewhere (time I started using GITHUB) and will share.

3 Likes

HowardAtHome, thank you so much for your help! Now I am finally able to create my own screens on SquareLine Studio and show it on my RGB display!! dronecz, thank you too for providing the source standart code, that I will use as a start to implement my project!

1 Like

Been trying for days to get the screen to output. These are the modifications I have made to the code. I deleted the original,
Arduino_ESP32RGBPanel *rgbpanel = new Arduino_ESP32RGBPanel, and
Arduino_RPi_DPI_RGBPanel *gfx = new Arduino_RPi_DPI_RGBPanel code and added code from the link to ESP32-8048S070.

#include <lvgl.h>
#include <Arduino_GFX_Library.h> // GitHub - moononournation/Arduino_GFX: Arduino GFX developing for various color displays and various data bus interfaces
#include “ui.h”
#include “ui_helpers.h”

// setting PWM properties
const int freq = 5000;
const int ledChannel = 0;
const int resolution = 8;
int dutyCycle = 255;
byte dimmedDutyCycle = 15;

bool printTouchData = 1;
unsigned long touchedTime = 0;
bool lcdTouched = 1;
unsigned long dimmingInterval = 10000;

#define TFT_BL 2

// Copied from Dev Device Declaration · moononournation/Arduino_GFX Wiki · GitHub
#define GFX_BL 2
Arduino_ESP32RGBPanel rgbpanel = new Arduino_ESP32RGBPanel(
41 /
DE /, 40 / VSYNC /, 39 / HSYNC /, 42 / PCLK /,
14 /
R0 /, 21 / R1 /, 47 / R2 /, 48 / R3 /, 45 / R4 /,
9 /
G0 /, 46 / G1 /, 3 / G2 /, 8 / G3 /, 16 / G4 /, 1 / G5 /,
15 /
B0 /, 7 / B1 /, 6 / B2 /, 5 / B3 /, 4 / B4 /,
0 /
hsync_polarity /, 180 / hsync_front_porch /, 30 / hsync_pulse_width /, 16 / hsync_back_porch /,
0 /
vsync_polarity /, 12 / vsync_front_porch /, 13 / vsync_pulse_width /, 10 / vsync_back_porch */);
Arduino_RGB_Display gfx = new Arduino_RGB_Display(
800 /
width /, 480 / height */, rgbpanel);

#include “touch.h”

/* Change to your screen resolution */

Then the rest is the original Simple_button code. It compiles and loads but no screen output. Any ideas please?

These changes here caused some instability in the display, but it did show an image:

Arduino_ESP32RGBPanel rgbpanel = new Arduino_ESP32RGBPanel(
40 /
DE /, 41 / VSYNC /, 39 / HSYNC /, 42 / PCLK /,
45 /
R0 /, 48 / R1 /, 47 / R2 /, 21 / R3 /, 14 / R4 /,
5 /
G0 /, 6 / G1 /, 7 / G2 /, 15 / G3 /, 16 / G4 /, 4 / G5 /,
8 /
B0 /, 3 / B1 /, 46 / B2 /, 9 / B3 /, 1 / B4 /,
0 /
hsync_polarity /, 8 / hsync_front_porch /, 4 / hsync_pulse_width /, 8 / hsync_back_porch /,
0 /
vsync_polarity /, 8 / vsync_front_porch /, 4 / vsync_pulse_width /, 8 / vsync_back_porch /,
1 /
pclk_active_neg /, 16000000 / prefer_speed */);

Arduino_RGB_Display gfx = new Arduino_RGB_Display(
800 /
width /, 480 / height */, rgbpanel);

#endif /* !defined(DISPLAY_DEV_KIT) /
/
******************************************************************************

  • End of Arduino_GFX setting
    ******************************************************************************/

/*******************************************************************************

  • Please config the touch panel in touch.h
    ******************************************************************************/
    #include “touch.h”