Home Elements Boards Recipes

LilyGO TTGO T-Display

The LilyGO TTGO T-Display board offer an integrated TFT color display and a USB-C type connector.

This board is not based on a ESP32 module but is using the ESP32-D0WD-Q6 processor directly.

TTGO T-Display

Arduino Board Configuration

The board can be used with the following Arduino settings:

Display ST7789

The display is a IPS type TFT display using the ST7789 driver chip on the SPI bus. It is supported by the GFX Library for Arduino.

The chip supports a maximal display resolution of 240*320 pixels in 262k colors but this display only supports 135*240 pixels with 64k colors in RGB565 addressing.

Therefore the display offsets must be specified in the configuration.

See configuration in env.json below.

External Connectors

Some power and GPIO pins are available for external components:

    +-------------+
    |   T T G O   |
G   | +---------+ | 3V
G   | |    D    | | 36
21  | |    I    | | 37
22  | |    S    | | 38
17  | |    P    | | 39
2   | |    L    | | 32
15  | |    A    | | 33
13  | |    Y    | | 25
12  | |         | | 26
G   | |         | | 27
G   | |         | |  G
3V  | |         | | 5V
    | +---------+ |
    |             B-RST
    | B-2     B-1 |
    +-----USB-----+

Internal GPIO usages

Name GPIO Remarks
TFT_MISO n/a
TFT_MOSI 19 usually MISO on Arduino Setups
TFT_SCLK 18 = Arduino Standard
TFT_CS 5
TFT_DC 16
TFT_RST 23
TFT_BL 4 TFT Backlight
ADC_IN 34 (Batt_ADC)
BUTTON1 35
BUTTON2 0
ADC Power 14

The TFT is not connected to the usual SPI pins. The data pin is attached to pin 19 that is usually used for SPI data input (MISO). As the SPI bus and all TFT connections are not available on the board pins so there will be no conflict.

The Backlight can be dimmed by using a GPIO 4 and can be used to adjust the brightness.

Example env.json Device Configuration

{
  "device": {
    "0": {
      "name": "tdisplay",
      "title": "T-Display",
      "description": "LilyGO TTGO T-Display",
      "safemode": "false",
      "button": 0,
      "homepage": "/index.htm"
    }
  },

  "ota": { "0": {} },

  "DisplayST7789": {
    "0": {
      "description": "ST7789 Display",
      "width": "135",
      "height": "240",

      "rotation": "180",
      "colOffset": "52",
      "rowOffset": "40",
      "ips": "true",

      "lightpin": "4",
 
      "spimosi": "19",
      "spiCLK": "18",
      "spics": "5",
      "spidc": "16",
    
      "spiRST": "23"
    }
  },

  "value": {
    "dim": {
      "title": "Display Backlight",
      "description": "Manual Backlight control",
      "min": "0",
      "max": "100",
      "value": "50",
      "onvalue": "DisplayST7789/0?brightness=$v"
    }
  }
}

See also

Tags

Board Wip