ESP32 + HX8357d

Electronics

Going to back to basics (from this post), since I wasn’t able to go straight to getting my display working with the ESP32 and LVGL. This post documents the steps and pinout to integrate the ESP32 Devkitv1 (30-pin version) with the 3.5″Adafruit Display.

First up, the schematic:

Note that the IM2 pads (orange circle) are soldered together for SPI mode.

ESP32Display
3v33-5v
GNDGND
D2D/C
D4RST
D5CS
D18CLK
D19MISO
D23MOSI

A few points of confusion that I personally ran into were mapping the esp32 pins to the schematic, silk screen on the esp32 itself and the pinouts found online. You can see in the code below that the Dx number matches the pin #defines from the code.

Second, the simplified code:

#include "Adafruit_HX8357.h"

// TFT display and SD card will share the hardware SPI interface.
// Hardware SPI pins are specific to the Arduino board type and
// cannot be remapped to alternate pins.  For Arduino Uno,
// Duemilanove, etc., pin 11 = MOSI, pin 12 = MISO, pin 13 = SCK.

#define TFT_DC 2
#define TFT_CS 5
// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_HX8357 tft = Adafruit_HX8357(TFT_CS, TFT_DC);

void setup(void)
{
  tft.begin();
  tft.fillScreen(HX8357_RED);
}

void loop()
{

}

And the final, somewhat anticlimactic, outcome:

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top