The library is TFT_eSPI.
Before this config i was using esp32 c3 and st7789 and it was working fine. But now using ILI9341 2.2 240x320 tft screen and esp32 s3 (8mb flash and 2mb psram) it is showing black screen only. I checked and rechecked the wiring and it seems to be all fine.
To check the screen i am using default examples so it doesnt matter (commented fonts are not used i believe)
The code in user setup file is:
// TFT_eSPI setup.h file for ESP32-S3-DevKitC-1
// HiLetgo 240X320 Resolution 2.8" SPI TFT LCD Display Touch Panel ILI9341
#define USER_SETUP_INFO "User_Setup"
#define ILI9341_DRIVER
// For ST7735, ST7789 and ILI9341 ONLY, define the colour order IF the blue and red are swapped on your display
// Try ONE option at a time to find the correct colour order for your display
// #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
// #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
// For ST7789, ST7735, ILI9163 and GC9A01 ONLY, define the pixel width and height in portrait orientation
#define TFT_WIDTH 240 // ST7789 240 x 240 and 240 x 320
#define TFT_HEIGHT 320 // ST7789 240 x 320
// If colours are inverted (white shows as black) then uncomment one of the next
// 2 lines try both options, one of the options should correct the inversion.
// #define TFT_INVERSION_ON
// #define TFT_INVERSION_OFF
#define TFT_CS 10
#define TFT_MOSI MOSI
#define TFT_SCLK SCK
#define TFT_MISO MISO
#define TFT_DC 9
#define TFT_RST 3
#define LOAD_GLCD
#define LOAD_FONT2
#define LOAD_FONT4
#define LOAD_FONT6
#define LOAD_FONT7
#define LOAD_FONT8
#define LOAD_GFXFF
#define SMOOTH_FONT
#define SPI_FREQUENCY 10000000
#define SPI_TOUCH_FREQUENCY 2500000
defaults are usually defined for each device - e.g. try running
/*
Rui Santos
Complete project details at https://RandomNerdTutorials.com/esp32-spi-communication-arduino/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
*/
//Find the default SPI pins for your board
//Make sure you have the right board selected in Tools > Boards
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
delay(3000);
Serial.print("MOSI: ");
Serial.println(MOSI);
Serial.print("MISO: ");
Serial.println(MISO);
Serial.print("SCK: ");
Serial.println(SCK);
Serial.print("SS: ");
Serial.println(SS);
Serial.print("SDA: ");
Serial.println(SDA);
Serial.print("SCL: ");
Serial.println(SCL);
}
void loop() {
// put your main code here, to run repeatedly:
}
I my case, I have the following enabled in User_Setup.h to solve my issue:
// The ESP32 has 2 free SPI ports i.e. VSPI and HSPI, the VSPI is the default.
// If the VSPI port is in use and pins are not accessible (e.g. TTGO T-Beam)
// then uncomment the following line:
#define USE_HSPI_PORT // or USE_FSPI_PORT
You can find some issues related to TFT_eSPI, ESP32-S3 and ESP32 Espressif board package 3.x. For example:
I apologize for the lack of explanation. All i wanted to say is that i forgot to turn off usb cdc on boot so serial monitor couldnt show anything. And the entire issue with screen was solved, thanks to this person: