Problems with spi_lcd_touch_example

ManelCS.
Posts: 9
Joined: Thu Mar 27, 2025 8:58 am

Problems with spi_lcd_touch_example

Postby ManelCS. » Wed Apr 02, 2025 11:52 am

I'm trying to follow this example
https://github.com/espressif/esp-idf/tr ... _lcd_touch
with a ESP32-s3 and the display NHD-2.4-240320AF-CSXP but I only see the backlight on the screen. The connection is:
Image

Code: Untitled.c Select all

#define EXAMPLE_LCD_PIXEL_CLOCK_HZ     (15 * 1000 * 1000)
#define EXAMPLE_LCD_BK_LIGHT_ON_LEVEL 1
#define EXAMPLE_LCD_BK_LIGHT_OFF_LEVEL !EXAMPLE_LCD_BK_LIGHT_ON_LEVEL
#define EXAMPLE_PIN_NUM_SCLK 14 // tft dcx
#define EXAMPLE_PIN_NUM_MOSI 47 // tft sda
#define EXAMPLE_PIN_NUM_MISO 38 // tft sdo
#define EXAMPLE_PIN_NUM_LCD_DC 11
#define EXAMPLE_PIN_NUM_LCD_RST 12 // tft resx
#define EXAMPLE_PIN_NUM_LCD_CS 45 // tft csx
#define EXAMPLE_PIN_NUM_BK_LIGHT 4
#define EXAMPLE_PIN_NUM_TOUCH_CS -1
i change the line

Code: Untitled.c Select all

ESP_ERROR_CHECK(esp_lcd_new_panel_ili9341(io_handle, &panel_config, &panel_handle));
for

Code: Untitled.c Select all

ESP_ERROR_CHECK(esp_lcd_new_panel_st7789(io_handle, &panel_config, &panel_handle));

ahsrabrifat
Posts: 201
Joined: Sat Jan 18, 2025 2:31 pm

Re: Problems with spi_lcd_touch_example

Postby ahsrabrifat » Wed Apr 02, 2025 3:04 pm

Check if your wiring matches the pin definitions in your code:
SCLK → GPIO 14 (TFT DCX)
MOSI → GPIO 47 (TFT SDA)
MISO → GPIO 38 (TFT SDO)
CS → GPIO 45 (TFT CSX)
RST → GPIO 12 (TFT RESX)
DC → GPIO 11
BKLT → GPIO 4

ManelCS.
Posts: 9
Joined: Thu Mar 27, 2025 8:58 am

Re: Problems with spi_lcd_touch_example

Postby ManelCS. » Thu Apr 03, 2025 9:30 am

Check if your wiring matches the pin definitions in your code:
SCLK → GPIO 14 (TFT DCX)
MOSI → GPIO 47 (TFT SDA)
MISO → GPIO 38 (TFT SDO)
CS → GPIO 45 (TFT CSX)
RST → GPIO 12 (TFT RESX)
DC → GPIO 11
BKLT → GPIO 4
Yes, the wiring matches with the pin definitions.

The screen that I use is that:
https://newhavendisplay.com/content/spe ... F-CSXP.pdf

Who is online

Users browsing this forum: No registered users and 1 guest