Ultimate ESP32 board?

Working prototype, waiting for PCB…

Over time, the TTGO T4 has become my favorite ESP32 board for tinkering with TFT displays. A widely supported ili9341 display, 8 MB PSRAM (needed for double buffering) and an SD card reader connected to the fast SD_MMC bus, all in one convenient module! But (there’s always a but), it ‘only’ has 320×240 (SPI controlled) pixels and no touchscreen. So I wrote down the requirements for my ultimate ESP32 & TFT board:

  • Plugable ESP32 WROVER (for its PSRAM)
  • Plugable TFT display with 480×320 resolution
  • Touchscreen (controlled over I2C by a plugable STMPE610 touch controller)
  • 8-bit TFT interface (SPI is rather slow for a 480×320 display)
  • SD card reader
  • I2C and SPI pins broken out
  • Battery holder + charging circuit
  • On/Off switch

Then I tried to prototype such a board, using the following parts in my ‘lab’:

  • TTGO T-Energy ESP32 with 8MB PSRAM, 18650 battery holder and power switch
  • Adafruit 3.5″ 480×320 TFT breakout board with touch screen and SD slot
  • STMPE610 touch controller (I2C & SPI)

Previous projects had already shown that the TFT_eSPI library can drive the HX8357D display in 8-bit mode, but the challenge here was to find a working pin selection that didn’t use standard I2C and SPI pins for the 8-bit TFT interface This inevitably required the use of some of ESP32’s tricky bootstrap pins (GPIO 0 and GPIO 12 in particular) but, after a couple of trials and errors, the following pin #defines in the library’s user setup file finally made the prototype work as intended:

 

All that’s left to do now is solder some headers and lots of wires on a two-sided PCB that I’ve ordered. With the TFT, ESP32 and STMPE610 plugged in, it will be a compact and powerful module that meets all above requirements. Multiple I2C moduls can use the hardware I2C bus and pins 18, 19, 23 and 32 are available for one 4-wire SPI device.

As for the ‘but’ of this ‘dream board’: there’s not enough pins left for an SD reader to use the SD_MMC hardware bus (which is over 2 times faster than SPI). Also, the SD reader of the display cannot be used because 8-bit mode disables its SPI interface. So I’ll have to use the remaining SPI pins for plugging in an external SD card reader, blocking any further use of SPI devices if SD functionality is required.