Drive 320x240 ILI9341 SPI TFT using ESP32-S3 (NodeMCU ESP-S3-12K-Kit) using TFT_eSPI library, in Arduino Framework.

Drive 2.4 inch 320x240 ILI9341 SPI TFT on Ai-Thinker NodeMCU ESP-S3-12K-Kit using TFT_eSPI library, in Arduino Framework.


The steps same as in my former post "Drive ILI9341 (8-bit parallel) using ESP32-S3 (ESP32-S3-DevKitC-1)", with custom user setup for SPI ILI9341 driver.

The custom user setup I modify from is Setup70b_ESP32_S3_ILI9341.h (inside your local installed library folder or here), copy it to the new created "TFT_eSPI_Setups" folder, rename as mySetup70b_ESP32_S3_ILI9341.h.

For SPI connection, I follow the original assignment.

For DC and RST pins, the original assigned pins (GPIO 7 and 6) are connected to LEDs in NodeMCU ESP-S3-12K-Kit (ref: ESP-S3-12K-Kit Schematic), so I re-assign to GPIO 16 and 15).

mySetup70b_ESP32_S3_ILI9341.h

// Setup for the ESP32 S3 with ILI9341 display
// Note SPI DMA with ESP32 S3 is not currently supported
#define USER_SETUP_ID 70
// See SetupX_Template.h for all options available
#define ILI9341_DRIVER

                    // Typical board default pins - change to match your board
#define TFT_CS   34 //     10 or 34 (FSPI CS0) 
#define TFT_MOSI 35 //     11 or 35 (FSPI D)
#define TFT_SCLK 36 //     12 or 36 (FSPI CLK)
#define TFT_MISO 37 //     13 or 37 (FSPI Q)

/*
 * in NodeMCU ESP-S3-12K-Kit, GPIO 6 and 7 are connected to LEDs,
 * so re-allocate to GPIO 15 and 16.
 */
// Use pins in range 0-31
#define TFT_DC    16     //7
#define TFT_RST   15     //6

//#define TOUCH_CS 16 // Optional for touch screen

#define LOAD_GLCD
#define LOAD_FONT2
#define LOAD_FONT4
#define LOAD_FONT6
#define LOAD_FONT7
#define LOAD_FONT8
#define LOAD_GFXFF

#define SMOOTH_FONT

// FSPI port (SPI2) used unless following defined. HSPI port (SPI3) NOT TESTED YET
//#define USE_HSPI_PORT

//#define SPI_FREQUENCY  27000000
#define SPI_FREQUENCY  40000000   // Maximum for ILI9341

#define SPI_READ_FREQUENCY  6000000 // 6 MHz is the maximum SPI read speed for the ST7789V

#define SPI_TOUCH_FREQUENCY 2500000


Edit the User_Setup_Select.h file to point to the custom setup file.

//#include <User_Setup.h>           // Default setup is root library folder
#include <../TFT_eSPI_Setups/mySetup70b_ESP32_S3_ILI9341.h>


Connection:
Connection between NodeMCU ESP-S3-12K-Kit and ILI9341 SPI TFT

Pins               NodeMCU ESP-S3-12K-Kit
1 	VCC        3V3
2 	GND        GND
3 	CS         34
4 	RESET      15
5 	DC/RS      16
6 	SDI(MOSI)  35
7 	SCK        36
8 	LED        3V3
9 	SDO(MISO)
10 	T_CLK
11 	T_CS
12 	T_DIN
13 	T_DO
14 	T_IRQ


Next:


Compare with Drive ILI9341 (8-bit parallel) using ESP32-S3 (ESP32-S3-DevKitC-1)

ILI9341 8-bit parallel vs SPI on ESP32-S3, TST_eSPI Benchmark test

Comments

Popular posts from this blog

480x320 TFT/ILI9488 SPI wih EP32C3 (arduino-esp32) using Arduino_GFX Library

my dev.tools - FNIRSI 2C23T 3-in-1 Dual Channel Oscilloscope/Multimeter/Signal Generator