jueves, 27 de julio de 2023

Usar 2.4" TFT LCD con ESP32 (conexión paralela)

 Si necesitamos utilizar la pantalla de 2.4" que tiene los siguientes pines LCD_RST, LCD_CS, LCD_RS, LCD_WR, LCD_RD, GND, 5V, 3V3, LCD_D0, LCD_D1, LCD_D2, LCD_D3, LCD_D4, LCD_D5, LCD_D6, LCD_D7 la conexión es de paralela. A continuación, dejo en enlace de una publicación donde se explica detalladamente como realizar la conexión con el ESP32 y que librería utilizar.

ILI9341 + ESP32 (Parallel) (pangodream.es)



Algunos de los puntos importantes son conectar bien los pines en TX2 y RX2 ya que podríamos confundirnos y tomar TX0 y RX0. Para que se vea bien la pantalla es mejor conectarla alimentación de 5V en lugar de la de 3.3V.

Podríamos tomar de ejemplo la siguiente conexión:



El archivo User_setup.h nos quedaría de la siguiente manera:

// See SetupX_Template.h for all options available

 

#define ESP32_PARALLEL

 #define ILI9341_DRIVER

 // ESP32 pins used for the parallel interface TFT

#define TFT_CS   27  // Chip select control pin

#define TFT_DC   14  // Data Command control pin - must use a pin in the range 0-31

#define TFT_RST  26  // Reset pin

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

#define TFT_RD   13

 #define TFT_D0   16  // Must use pins in the range 0-31 for the data bus

#define TFT_D1   4  // so a single register write sets/clears all bits

#define TFT_D2   23

//#define TFT_D3   22

#define TFT_D3   15

//#define TFT_D4   21

#define TFT_D4   5

#define TFT_D5   19

#define TFT_D6   18

#define TFT_D7   17

 #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

 

Enlaces útiles:

ESP32-DevKit.png (2292×967) (pangodream.es)

2.4inch Arduino Display - LCD wiki

No hay comentarios:

Publicar un comentario