Drive ILI9341 (8-bit parallel) using ESP32-S3 (ESP32-S3-DevKitC-1) in Arduino Framework

This post show how to driver 2.8" 320x240 ILI9341 TFT with 8-bit parallel interface using Espressif ESP32-S3-DevKitC-1, in Arduino framework, using TFT_eSPI library.

Connection: 

For my 2.8 inch 320x240 ili9341 TFT with 8/16BIT parallel interface, it's set in 16-bit data bus mode by default.

To make it in 8-bit mode:
Solder R4 with 0Ω resistor or short circuit directly,
and disconnect R5.
In 8-bit data bus mode, use DB8~DB15 data pin.


Connection between Espressif ESP32-S3-DevKitC-1 and
2.8" 320x240 ili9341 TFT in 8-bit parallel interface:

    ESP32-S3 GPIO
    |                  |
    V	               V
	+------------+
	| CLK	T_CS |	
	| F_CS	PEN  |
	| MOSI	MISO |
	| NC	GND  | GND
    GND	| GND	VDD  | 3V3
    3V3	| VDD	BL   | 3V3
	| SDCS	DB15 | 3
    14	| DB14	DB13 | 8
    13	| DB12	DB11 | 18
    12  | DB10	DB9  | 17
    11	| DB8	DB7  |
	| DB6	DB5  |
	| DB4	DB3  |
	| DB2	DB1  |
	| DB0	RST  | 46
    10  | RD	WR   | 16
    9	| RS	CS   | 15
	+------------+
	ILI9341 TFT (parallel i/f)

Library:

Install TFT_eSPI in Arduino IDE's Library Manager.

Prepare user setup file, refer to Tips section in TFT_eSPI page:

If you load a new copy of TFT_eSPI then it will overwrite your setups if they are kept within the TFT_eSPI folder. One way around this is to create a new folder in your Arduino library folder called "TFT_eSPI_Setups". You then place your custom setup.h files in there. After an upgrade simply edit the User_Setup_Select.h file to point to your custom setup file.

mySetup14_ILI9341_Parallel.h, my custom setup.h file in new created "TFT_eSPI_Setups" folder.
// See SetupX_Template.h for all options available
#define USER_SETUP_ID 14

#define TFT_PARALLEL_8_BIT


#define ILI9341_DRIVER

/*
// ESP32 pins used for the parallel interface TFT
#define TFT_CS   33  // Chip select control pin
#define TFT_DC   15  // Data Command control pin - must use a pin in the range 0-31
#define TFT_RST  32  // Reset pin

#define TFT_WR    4  // Write strobe control pin - must use a pin in the range 0-31
#define TFT_RD    2

#define TFT_D0   12  // Must use pins in the range 0-31 for the data bus
#define TFT_D1   13  // so a single register write sets/clears all bits
#define TFT_D2   26
#define TFT_D3   25
#define TFT_D4   17
#define TFT_D5   16
#define TFT_D6   27
#define TFT_D7   14
*/
// ESP32 pins used for the parallel interface TFT
#define TFT_CS   15  // Chip select control pin
#define TFT_DC   9   // Data Command control pin - must use a pin in the range 0-31
#define TFT_RST  46  // Reset pin

#define TFT_WR   16  // Write strobe control pin - must use a pin in the range 0-31
#define TFT_RD   10

#define TFT_D0   11  // Must use pins in the range 0-31 for the data bus
#define TFT_D1   17  // so a single register write sets/clears all bits
#define TFT_D2   12
#define TFT_D3   18
#define TFT_D4   13
#define TFT_D5   8
#define TFT_D6   14
#define TFT_D7   3

#define LOAD_GLCD   // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2  // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4  // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6  // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7  // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8  // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF  // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts

#define SMOOTH_FONT


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

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

Then you can run TFT_eSPI examples.


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


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