ESP32- 4.3inch Display configuration
Hi, I have issues for some time now with finding the correct display config for my esp32 4.3inch display. I wasted lots of time and thought it's the board so I got a new board but still nothing happen when I compile the code. The board schematic and datasheet do not match. Pleese help.
I have board - ESP32 Display-4.3 Inch SKU:DIS06043H
The last code I tried is the Training Youtube tutorial 2, 4.3inch. I tried all possible configurations but the screen remain dead. I even set the BL to on to test the correct BL pin which it was bot the rest is not.
Config code.
define LGFX_USE_V1
include <LovyanGFX.hpp>
include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp>
include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp>
include <driver/i2c.h>
include <driver/gpio.h>
define CrowPanel_43
define screenWidth 480
define screenHeight 272
class LGFX : public lgfx::LGFX_Device
{
public:
lgfx::Bus_RGB _bus_instance;
lgfx::Panel_RGB _panel_instance;
lgfx::Light_PWM _light_instance;
lgfx::Touch_XPT2046 _touch_instance;
LGFX(void)
{
{
auto cfg = _panel_instance.config();
cfg.memory_width = screenWidth;
cfg.memory_height = screenHeight;
cfg.panel_width = screenWidth;
cfg.panel_height = screenHeight;
cfg.offset_x = 0;
cfg.offset_y = 0;
_panel_instance.config(cfg);
}
{
auto cfg = _bus_instance.config();
cfg.panel = &_panel_instance;
cfg.pin_d0 = GPIO_NUM_15; // B0
cfg.pin_d1 = GPIO_NUM_7; // B1
cfg.pin_d2 = GPIO_NUM_6; // B2
cfg.pin_d3 = GPIO_NUM_5; // B3
cfg.pin_d4 = GPIO_NUM_4; // B4
cfg.pin_d5 = GPIO_NUM_9; // G0
cfg.pin_d6 = GPIO_NUM_46; // G1
cfg.pin_d7 = GPIO_NUM_3; // G2
cfg.pin_d8 = GPIO_NUM_8; // G3
cfg.pin_d9 = GPIO_NUM_16; // G4
cfg.pin_d10 = GPIO_NUM_1; // G5
cfg.pin_d11 = GPIO_NUM_14; // R0
cfg.pin_d12 = GPIO_NUM_21; // R1
cfg.pin_d13 = GPIO_NUM_47; // R2
cfg.pin_d14 = GPIO_NUM_48; // R3
cfg.pin_d15 = GPIO_NUM_45; // R4
cfg.pin_henable = GPIO_NUM_41;
cfg.pin_vsync = GPIO_NUM_40;
cfg.pin_hsync = GPIO_NUM_39;
cfg.pin_pclk = GPIO_NUM_0;
cfg.freq_write = 8000000;
cfg.hsync_polarity = 0;
cfg.hsync_front_porch = 8;
cfg.hsync_pulse_width = 4;
cfg.hsync_back_porch = 43;
cfg.vsync_polarity = 0;
cfg.vsync_front_porch = 8;
cfg.vsync_pulse_width = 4;
cfg.vsync_back_porch = 12;
cfg.pclk_active_neg = 1;
cfg.de_idle_high = 0;
cfg.pclk_idle_high = 0;
_bus_instance.config(cfg);
_panel_instance.setBus(&_bus_instance);
}
{
auto cfg = _light_instance.config();
cfg.pin_bl = GPIO_NUM_2;
_light_instance.config(cfg);
_panel_instance.light(&_light_instance);
}
/* // Set the backlight pin high
gpio_set_direction(GPIO_NUM_2, GPIO_MODE_OUTPUT);
gpio_set_level(GPIO_NUM_2, 1); // Set the backlight pin to high */
{
auto touch_cfg = _touch_instance.config();
touch_cfg.x_min = 100; // Minimum X value from touchscreen
touch_cfg.x_max = 4000; // Maximum X value from touchscreen
touch_cfg.y_min = 100; // Minimum Y value from touchscreen
touch_cfg.y_max = 4000; // Maximum Y value from touchscreen
touch_cfg.pin_int = GPIO_NUM_36; // INT pin number
touch_cfg.bus_shared = true; // True if shared bus with screen
touch_cfg.offset_rotation = 0; // Adjust if touch and display orientation mismatch
// SPI connection settings
touch_cfg.spi_host = SPI2_HOST; // SPI host selection
touch_cfg.freq = 1000000; // SPI clock frequency
touch_cfg.pin_sclk = GPIO_NUM_12; // SCLK pin number
touch_cfg.pin_mosi = GPIO_NUM_11; // MOSI pin number
touch_cfg.pin_miso = GPIO_NUM_13; // MISO pin number
touch_cfg.pin_cs = GPIO_NUM_10; // CS pin number
_touch_instance.config(touch_cfg);
_panel_instance.setTouch(&_touch_instance); // Set touchscreen to panel
}
setPanel(&_panel_instance);
}
};
LGFX tft;
Comments
We have tested that the uploaded code can be compiled and run normally. Please look at both lesson1 and lesson2 again to confirm whether any steps have been missed. https://www.youtube.com/playlist?list=PLwh4PlcPx2Ge-h-Pfsa7juFeWMgXmv8lc
Hi I went through your lessons again and all is as it should be, or what I can see. In the lesson you only completed a 50inch not a 4.3 inch. I have two boards not coming on and both new. What else do I need to check.
If you're using the 4.3-inch display, you need to modify the gfx_conf.h:
command out the #define CrowPanel_50, and enable the #define CrowPanel_43
Before compiling the code, you need to change the setting of the board.
![](https://forum.elecrow.com/uploads/editor/8w/hyrwpombwn0r.png)
![](https://forum.elecrow.com/uploads/editor/hw/bki1x1yssih0.png)
Everything you show on top was done as you are showing it. My question is, was the 4,3-inch display ever been tested to see if its drive control IC is compatible with your setup. The reason I ask is every-ware somebody say they will demonstrate the 4,3-inch display, they ended up with a 50-inch display not a 4.3-inch. What is the setup pin locations? on the web I found a couple different configurations and tried them all with no luck. Of cause the Display or controller can be faulty, but I ordered a new and it still don't show anything. I then ordered a 3.5-inch although the touch part isn't working yet is do display my Squareline image.
Hello @jdebruyn ,
May I kindly ask what version of the esp32 package you installed? If it is v3.0.0, please change it into an earlier version.
I do use an earlier version of ESP32. I however ordered a 5 Inch board and it do load all the examples on your videos. However when I upload my image from Squareline the image load in a 90deg angle. I tried all settings in Squareline as well as UI file and GFX but it only get worse if I change the rotation, what is the proper way to rotate. If I rotate the image it only show on halve the Elegrow board. When I change it back it showing over the entire board but in a 90der angle.
I manage to get it going - Thanks
@Elecrow
This is nuts, the Documentation and Wiki for the 4.3 Variant has several missing Download Links to pdf and zip files. The Explanation video is shown for 5.0 Variant, leaving no clue what to change for the 4.3. My Display says WIZEE on the back wich i can´t find on any Elecrow website only by looking at the pictures i have the sligth guess you renamed it to CrowPanel. I was searching and trying for almost two days now and gave up. I left a proper one star review on one of your selling channels for the mess you got in your wiki.
Hello @roquestrongo ,
1. For the silkscreen issue, please refer to this updated record: https://forum.elecrow.com/discussion/672/esp32-display-update-history#latest
2. Due to server migration, some links are broken. We apologize for the inconvenience. We are checking hundreds of wiki pages and have not updated the wiki for 4.3-inch HMI in time. Thank you for your feedback and we will modify it as soon as possible.
3. The video and its corresponding course apply to 6 screen sizes. The video explains what modifications need to be made for screens of different sizes.
OK so i had a look at the Course Lessons on Youtube that you mentioned above. I followed the second example. My Board is the Wizee-ESP32 WZ4827R043 marked Board, with Board Layout 1.0. So i setup the Board like mentioned in the course two, installed the libraries and configured gfx_conf.h and the example script .
Example.ino
/**************************CrowPanel ESP32 HMI Display Example Code************************
Version : 1.0
Suitable for: CrowPanel ESP32 HMI Display
Product link: https://www.elecrow.com/esp32-display-series-hmi-touch-screen.html
Code link: https://github.com/Elecrow-RD/CrowPanel-ESP32-Display-Course-File
Lesson link: https://www.xoutube.com/watch?v=WHfPH-Kr9XU
Description : The code is currently available based on the course on YouTube,
if you have any questions, please refer to the course video: Introduction
to ask questions or feedback.
**************************************************************/
include <Wire.h>
include <SPI.h>
/*******************************************************************************
Config the display panel and touch panel in gfx_conf.h
******************************************************************************/
include "gfx_conf.h"
void setup()
{
Serial.begin(9600);
//Display Prepare
tft.begin();
tft.fillScreen(TFT_BLACK);
tft.setTextSize(3);
delay(100);
tft.fillScreen(TFT_BLUE);
delay(1000);
tft.fillScreen(TFT_YELLOW);
delay(1000);
tft.fillScreen(TFT_GREEN);
delay(1000);
tft.fillScreen(TFT_WHITE);
delay(1000);
tft.fillScreen(TFT_BLACK);
tft.fillCircle ( 100, 100 , 50, TFT_YELLOW);
tft.setCursor(200, 240);
tft.print("Hello, Elecrow");
Serial.println( "Hello, my Display" );
}
void loop()
{
delay(5);
}
gfx_conf.h
define LGFX_USE_V1
include <LovyanGFX.hpp>
include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp>
include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp>
include <driver/i2c.h>
/*******************************************************************************
* Please define the corresponding macros based on the board you have purchased.
* CrowPanel_43 means CrowPanel 4.3inch Board
* CrowPanel_50 means CrowPanel 5.0inch Board
* CrowPanel_70 means CrowPanel 7.0inch Board
******************************************************************************/
// #define CrowPanel_70
#define CrowPanel_43
// #define CrowPanel_43
if defined (CrowPanel_70)
define screenWidth 800
define screenHeight 600
class LGFX : public lgfx::LGFX_Device
{
public:
lgfx::Bus_RGB _bus_instance;
lgfx::Panel_RGB _panel_instance;
lgfx::Light_PWM _light_instance;
lgfx::Touch_GT911 _touch_instance;
LGFX(void)
{
{
auto cfg = _panel_instance.config();
cfg.memory_width = screenWidth;
cfg.memory_height = screenHeight;
cfg.panel_width = screenWidth;
cfg.panel_height = screenHeight;
cfg.offset_x = 0;
cfg.offset_y = 0;
_panel_instance.config(cfg);
}
};
elif defined (CrowPanel_50)
define screenWidth 800
define screenHeight 480
class LGFX : public lgfx::LGFX_Device
{
public:
lgfx::Bus_RGB _bus_instance;
lgfx::Panel_RGB _panel_instance;
lgfx::Light_PWM _light_instance;
lgfx::Touch_GT911 _touch_instance;
LGFX(void)
{
{
auto cfg = _panel_instance.config();
cfg.memory_width = screenWidth;
cfg.memory_height = screenHeight;
cfg.panel_width = screenWidth;
cfg.panel_height = screenHeight;
cfg.offset_x = 0;
cfg.offset_y = 0;
_panel_instance.config(cfg);
}
};
elif defined (CrowPanel_43)
define screenWidth 480
define screenHeight 272
class LGFX : public lgfx::LGFX_Device
{
public:
lgfx::Bus_RGB _bus_instance;
lgfx::Panel_RGB _panel_instance;
lgfx::Light_PWM _light_instance;
lgfx::Touch_XPT2046 _touch_instance;
LGFX(void)
{
{
auto cfg = _panel_instance.config();
cfg.memory_width = screenWidth;
cfg.memory_height = screenHeight;
cfg.panel_width = screenWidth;
cfg.panel_height = screenHeight;
cfg.offset_x = 0;
cfg.offset_y = 0;
_panel_instance.config(cfg);
}
};
endif
LGFX tft;
The script will compile fine however it will throw an error on uploading:
So i will set the Board in Download mode manually by holding "BOOT" and press "RESET" and try again uploaading.
Seems like everything is ok, but the Serial Log shows this:
So.... is the example wrong? Does my brandnew board is missing PSRAM or is it just broken?