lvgl / lvgl_esp32_drivers

Drivers for ESP32 to be used with LVGL
MIT License
338 stars 284 forks source link

After updating drivers white screen on ILI9488 display, etc. #135

Open SinglWolf opened 3 years ago

SinglWolf commented 3 years ago

Error in file lvgl_esp32_drivers\lvgl_tft\ili9488.h:

/*********************
 *      DEFINES
 *********************/
#define ILI9488_DC      CONFIG_LV_DISP_PIN_DC
#define ILI9488_RST     CONFIG_LV_DISP_PIN_RST
#define ILI9488_USE_RST CONFIG_LV_DISP_USE_RSTS

/*******************
 * ILI9488 REGS
*********************/

Should be:

/*********************
 *      DEFINES
 *********************/
#define ILI9488_DC      CONFIG_LV_DISP_PIN_DC
#define ILI9488_RST     CONFIG_LV_DISP_PIN_RST
#define ILI9488_USE_RST CONFIG_LV_DISP_USE_RST

/*******************
 * ILI9488 REGS
*********************/

If there is no hard reset, no software reset is applied to the display. The result is a white screen. Therefore, I propose to do this for all displays, of course (see below.). I also suggest removing the extra line for setting the display orientation from the initialization array, because the orientation is set in any case at the end of the display initialization code (in XXXXX_set_orientation(CONFIG_LV_DISPLAY_ORIENTATION)). For eg, lvgl_esp32_drivers\lvgl_tft\ili9488.c:

void ili9488_init(void)
{
    lcd_init_cmd_t ili_init_cmds[]={

#ifndef ILI9488_USE_RST
        {ILI9488_CMD_SOFTWARE_RESET, {0x00}, 0x80},
#endif

                {ILI9488_CMD_SLEEP_OUT, {0x00}, 0x80},
        {ILI9488_CMD_POSITIVE_GAMMA_CORRECTION, {0x00, 0x03, 0x09, 0x08, 0x16, 0x0A, 0x3F, 0x78, 0x4C, 0x09, 0x0A, 0x08, 0x16, 0x1A, 0x0F}, 15},
        {ILI9488_CMD_NEGATIVE_GAMMA_CORRECTION, {0x00, 0x16, 0x19, 0x03, 0x0F, 0x05, 0x32, 0x45, 0x46, 0x04, 0x0E, 0x0D, 0x35, 0x37, 0x0F}, 15},
        {ILI9488_CMD_POWER_CONTROL_1, {0x17, 0x15}, 2},
        {ILI9488_CMD_POWER_CONTROL_2, {0x41}, 1},
        {ILI9488_CMD_VCOM_CONTROL_1, {0x00, 0x12, 0x80}, 3},
        {ILI9488_CMD_MEMORY_ACCESS_CONTROL, {(0x20 | 0x08)}, 1}, // <-- suggest removing for all displays
        {ILI9488_CMD_COLMOD_PIXEL_FORMAT_SET, {0x66}, 1},
        {ILI9488_CMD_INTERFACE_MODE_CONTROL, {0x00}, 1},
        {ILI9488_CMD_FRAME_RATE_CONTROL_NORMAL, {0xA0}, 1},
        {ILI9488_CMD_DISPLAY_INVERSION_CONTROL, {0x02}, 1},
        {ILI9488_CMD_DISPLAY_FUNCTION_CONTROL, {0x02, 0x02}, 2},
        {ILI9488_CMD_SET_IMAGE_FUNCTION, {0x00}, 1},
        {ILI9488_CMD_WRITE_CTRL_DISPLAY, {0x28}, 1},
        {ILI9488_CMD_WRITE_DISPLAY_BRIGHTNESS, {0x7F}, 1},
        {ILI9488_CMD_ADJUST_CONTROL_3, {0xA9, 0x51, 0x2C, 0x02}, 4},
        {ILI9488_CMD_DISPLAY_ON, {0x00}, 0x80},
        {0, {0}, 0xff},
    };

    // cut code

}
DatanoiseTV commented 2 years ago

I have the same issue, but adding your #ifndef doesn't fix the white screen for me.

SinglWolf commented 2 years ago

A white screen may also be due to the fact that the frequency of the SPI bus is too high. I already have 2 displays that did not start at 40 MHz. At 26 MHz, they work fine.

wenjingz commented 2 years ago

This have resolved my problem, thanks! And it is obviously an issue to be corrected in the repository.