ESP32S3-4827S043 Quick reference #587
Replies: 2 comments 4 replies
-
@ColinGarySmith This is very helpful. Do you have any examples of migrating from the bundled code (zip files on the product page, meant for old versions of Arduino GFX Library, LVGL and ESP32 2.x) to modern versions of these? What versions of these three were you able to use? Thanks! I am unable to get this code to work with the latest ESP32 boards (v3.1.3) + latest Arduino GFX Library (v1.5.3). Here is the code from above plus some graphics testing code: #include <Arduino_GFX_Library.h>
#define TFT_BL 2
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 */, 1 /* hsync_front_porch */, 1 /* hsync_pulse_width */, 43 /* hsync_back_porch */,
0 /* vsync_polarity */, 3 /* vsync_front_porch */, 1 /* vsync_pulse_width */, 12 /* vsync_back_porch */,
1 /* pclk_active_neg */, 8000000 /* prefer_speed */);
Arduino_RGB_Display *gfx = new Arduino_RGB_Display(
480 /* width */, 272 /* height */, rgbpanel, 0 /* rotation */, false /* auto_flush */);
/*******************************************************************************
* End of Arduino_GFX setting
******************************************************************************/
void setup(void)
{
Serial.begin(115200);
// Serial.setDebugOutput(true);
// while(!Serial);
Serial.println("Arduino_GFX Hello World example");
// Init Display
if (!gfx->begin())
{
Serial.println("gfx->begin() failed!");
}
gfx->fillScreen(RGB565_BLACK);
#ifdef TFT_BL
pinMode(TFT_BL, OUTPUT);
digitalWrite(TFT_BL, HIGH);
#endif
gfx->setCursor(10, 10);
gfx->setTextColor(RGB565_RED);
gfx->println("Hello World!");
delay(5000); // 5 seconds
}
void loop()
{
gfx->setCursor(random(gfx->width()), random(gfx->height()));
gfx->setTextColor(random(0xffff), random(0xffff));
gfx->setTextSize(random(6) /* x scale */, random(6) /* y scale */, random(2) /* pixel_margin */);
gfx->println("Hello World!");
delay(1000); // 1 second
} At runtime, I see:
Opened #628 about this |
Beta Was this translation helpful? Give feedback.
-
Additionally, the partition scheme option suggested in the original post didn't work for me on this board:
Default 4MB with spiffs (first option) works fine, and also this works for arduino-cli: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Picked up one of these boards affectionally known as CYB (chinese yellow board) displays from aliexpress. (also available on ebay).
https://www.aliexpress.com/item/1005004788147691.html
it was at first very hard to get running, but after some research the following tips and tricks will help you get this board working (and fast).
ESP 32 settings. Use the ESP32S3 Dev Module as the board in Arduino IDE or VScode.
Board settings:
Board: “ESP323 Dev Module”
USB CDC On Boot: “Disabled”
CPU Frequency: “240MHz (WiFi)”
Core Debug Level: “None”
USB DFU On Boot: “Disabled”
Erase All Flash Before Sketch Upload: “Disabled”
Events Run On: “Core 0”
Flash Mode: “QI0 80MHz”
Flash Size: “16MB (128Mb)”
JTAG Adapter: “Disabled”
Arduino Runs On: “Core 1”
USB Firmware MSC On Boot: “Disabled”
Partition Scheme: “8M with spiffs (3MB APP/1.5MB SPIFFS)”
PSRAM: “Disabled”
Upload Mode: “UARTO / Hardware CDC”
Upload Speed: “921600”
USB Mode: “Hardware CDC and JAG”
Definition to get the display working:
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 /, 1 / hsync_front_porch /, 1 / hsync_pulse_width /, 43 / hsync_back_porch /,
0 / vsync_polarity /, 3 / vsync_front_porch /, 1 / vsync_pulse_width /, 12 / vsync_back_porch /,
1 / pclk_active_neg /, 8000000 / prefer_speed */);
Arduino_RGB_Display gfx = new Arduino_RGB_Display(
480 / width /, 272 / height /, rgbpanel, 0 / rotation /, false / auto_flush */);
not sure why but the autoflash being true or false didn't seem to change much, however setting it to false gained some speed.
Speed set to 8000000. Faster this goes, the quicker the refresh happens, but you lose performance with the drawing operations.
Touch screen (this is for the resistive touch screen) these settings are in touch.h from the example files.
#define TOUCH_XPT2046
#define TOUCH_XPT2046_SCK 12
#define TOUCH_XPT2046_MISO 13
#define TOUCH_XPT2046_MOSI 11
#define TOUCH_XPT2046_CS 38
#define TOUCH_XPT2046_INT 18
#define TOUCH_XPT2046_ROTATION 0
#define TOUCH_XPT2046_SAMPLES 50
Download the libs mentioned in touch.h to get the touch working.
Backlight pin is pin 2. It IS dimmable.
pinMode(2, OUTPUT);
analogWrite(2, brightness);
The usuable range is from about 10 to 130. non-linear.
If i have any other tips i will put them here.
Beta Was this translation helpful? Give feedback.
All reactions