espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.76k stars 7.3k forks source link

rgb lcd panel wrong colors (IDFGH-12944) #13901

Closed Emile1154 closed 5 months ago

Emile1154 commented 5 months ago

Answers checklist.

IDF version.

espidf v3.50201.240515 (5.2.1)

Espressif SoC revision.

ESP32-S3

Operating System used.

Windows

How did you build your project?

VS Code IDE

If you are using Windows, please specify command line type.

None

Development Kit.

WT32-S3-WROVER, ZX7D00CE01S

Power Supply used.

USB

What is the expected behavior?

normal color gradient for R and G channel (RGB565): image

What is the actual behavior?

problem with displaying red and green colors. image

Steps to reproduce.

display driver configuration

#define WIDTH 800 
#define HEIGH 480

#define LCD_VSYNC_GPIO      (38)   //vertical sync
#define LCD_HSYNC_GPIO      (5)    //horizontal sync
#define LCD_DE_GPIO         (39)   //input data ena control
#define LCD_PCLK_GPIO       (9)    //clk 
#define LCD_D0_GPIO         (17)    // B0
#define LCD_D1_GPIO         (16)    // B1
#define LCD_D2_GPIO         (15)    // B2
#define LCD_D3_GPIO         (7)     // B3
#define LCD_D4_GPIO         (6)     // B4
#define LCD_D5_GPIO         (21)    // G0
#define LCD_D6_GPIO         (0)     // G1
#define LCD_D7_GPIO         (46)    // G2
#define LCD_D8_GPIO         (3)     // G3
#define LCD_D9_GPIO         (8)     // G4
#define LCD_D10_GPIO        (18)    // G5
#define LCD_D11_GPIO        (10)    // R0
#define LCD_D12_GPIO        (11)    // R1
#define LCD_D13_GPIO        (12)    // R2
#define LCD_D14_GPIO        (13)    // R3
#define LCD_D15_GPIO        (14)    // R4
#define LCD_DISP_EN_GPIO    (-1)

#define LCD_PIN_RST          -1
#define LCD_PIN_BK_LIGHT     45

#define LCD_BK_LIGHT_ON_LEVEL  1
#define LCD_BK_LIGHT_OFF_LEVEL !LCD_BK_LIGHT_ON_LEVEL

const esp_lcd_rgb_panel_config_t panel_config = {
        .clk_src = LCD_CLK_SRC_PLL240M,  // 240M
        .timings = {
            .pclk_hz = 16000000,        //16M 
            .h_res = WIDTH,
            .v_res = HEIGH,
            .hsync_pulse_width  =  70,    //70
            .hsync_back_porch   =  40,    //40
            .hsync_front_porch  =  0,    //0
            .vsync_pulse_width  =  22,     //22
            .vsync_back_porch   =  13,    //13
            .vsync_front_porch  =  0,    //0
        },
        .data_width = 16,
        .psram_trans_align = 64,  //64
        .hsync_gpio_num = LCD_HSYNC_GPIO,
        .vsync_gpio_num = LCD_VSYNC_GPIO,
        .de_gpio_num = LCD_DE_GPIO,
        .pclk_gpio_num = LCD_PCLK_GPIO,
        .disp_gpio_num = LCD_DISP_EN_GPIO,
        .data_gpio_nums = {
            LCD_D0_GPIO,  //B0
            LCD_D1_GPIO,  //B1
            LCD_D2_GPIO,  //B2
            LCD_D3_GPIO,  //B3
            LCD_D4_GPIO,  //B4
            LCD_D5_GPIO,  //G0
            LCD_D6_GPIO,  //G1
            LCD_D7_GPIO,  //G2
            LCD_D8_GPIO,  //G3
            LCD_D9_GPIO,  //G4
            LCD_D10_GPIO, //G5
            LCD_D11_GPIO, //R0
            LCD_D12_GPIO, //R1
            LCD_D13_GPIO, //R2
            LCD_D14_GPIO, //R3
            LCD_D15_GPIO, //R4
        },
        .flags ={ 
            .refresh_on_demand = false,
            .fb_in_psram = true,
            .double_fb   = false,
        },
    };
    ESP_ERROR_CHECK(esp_lcd_new_rgb_panel(&panel_config, &g_panel_handle));
    ESP_ERROR_CHECK(esp_lcd_panel_reset(g_panel_handle));
    ESP_ERROR_CHECK(esp_lcd_panel_init(g_panel_handle));

RGB565 for RGB888 display connection (ZX7D00CE01S) : image

Debug Logs.

No response

More Information.

On esp-idf v4.4.6 color display is ok on esp-idf v5.2.1 color set 65535 is correct white color

Emile1154 commented 5 months ago

sorry, this happened due to ADC pin in configuration coincided with RGB pins. Close this issue.