Page 1 of 1

How to get the display module working?

Posted: Tue Jan 06, 2026 9:25 am
by ujurmsde
I have a Unihiker-K10 board that has ILI9341 display on it. I am at the moment not able to get the display work.

I have followed some online tutorials for this display and official IDF-Component but seems that it is not working properly. The configuration that this display has is as follows in the code

https://circuitlabs.net/lcd-oled-displa ... h-esp-idf/

Also the reset is connected to 3v3 via resistor and other side to capacitor to GND. There is no specific pin for Reset.

Code: Select all


static void display_init() {

    spi_bus_config_t spi_bus = {
        .sclk_io_num = LCD_SCLK,
        .mosi_io_num = LCD_MOSI,
        .miso_io_num = -1,
        .quadwp_io_num = -1,
        .quadhd_io_num = -1,
        .max_transfer_sz = 240 * 80 * sizeof(uint16_t),
        
    };
    ESP_ERROR_CHECK(spi_bus_initialize(LCD_HOST, &spi_bus, SPI_DMA_CH_AUTO));

    esp_lcd_panel_io_spi_config_t io_config = {
        .dc_gpio_num = LCD_DC,
        .cs_gpio_num = LCD_CS,
        .pclk_hz = 40*1000*1000,
        .lcd_cmd_bits = LCD_CMD_BITS,
        .lcd_param_bits = LCD_PARAM_BITS,
        .spi_mode = 0,
        .trans_queue_depth = 10,
        .on_color_trans_done = NULL,
        .user_ctx = NULL,
    };
    esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)LCD_HOST, &io_config, &io_handle);

    esp_lcd_panel_dev_config_t panel_config = {
    .reset_gpio_num = -1,
    .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR,
    .bits_per_pixel = 16,
    };
    // Create LCD panel handle for ILI9341, with the SPI IO device handle
    ESP_ERROR_CHECK(esp_lcd_new_panel_ili9341(io_handle, &panel_config, &panel_handle));

    esp_lcd_panel_reset(panel_handle);
    esp_lcd_panel_init(panel_handle);
    esp_lcd_panel_disp_on_off(panel_handle, true);
}
Anyone has an idea how to get this display to work?

Re: How to get the display module working?

Posted: Thu Jan 08, 2026 10:59 pm
by real_mon2
Hi. I would suggest for you to incorporate the Arduino support of your ESP32 module and respectively install the Arduino IDE onto your host pc box. Then follow one of the many examples that target your display. Tons of good videos on YT and libraries available with sample widgets that should assist you to get up and running quickly.

There are some code samples that are based on a tighter code run so you will have a higher refresh rate (ie. be able to switch graphics pages, etc. faster). Perhaps this is what you are after. Regardless, give that angle a run and post back if stuck. I know that we reviewed quite a few ideas but the use of your display should be well documented.