

The ST7789 TFT is a compact, full-color display driver designed for TFT LCD screens. It is widely used in embedded systems and portable devices due to its small size, vibrant color reproduction, and efficient communication interface. The ST7789 supports a resolution of 240x240 pixels, making it ideal for applications requiring high-quality visuals in a compact form factor. Its SPI (Serial Peripheral Interface) communication ensures compatibility with a wide range of microcontrollers, including popular development boards like the Arduino UNO.








Below are the key technical details of the ST7789 TFT:
| Parameter | Value |
|---|---|
| Resolution | 240x240 pixels |
| Interface | SPI (4-wire or 3-wire) |
| Operating Voltage | 2.8V to 3.3V |
| Logic Level | 3.3V (5V-tolerant with level shifter) |
| Display Colors | 65K (16-bit color) |
| Backlight Voltage | 3.0V to 3.3V |
| Backlight Current | ~20mA |
| Operating Temperature | -30°C to 85°C |
| Dimensions | Varies by module (e.g., 1.3", 1.54") |
The ST7789 TFT module typically has the following pin configuration:
| Pin Name | Description |
|---|---|
| VCC | Power supply input (2.8V to 3.3V) |
| GND | Ground connection |
| SCL (CLK) | SPI clock signal |
| SDA (MOSI) | SPI data input (Master Out Slave In) |
| RES (RST) | Reset pin (active low) |
| DC (A0) | Data/Command control pin (High = Data, Low = Command) |
| CS | Chip Select (active low) |
| BLK (LED) | Backlight control (connect to 3.3V or PWM pin) |
Note: Some modules may have additional or fewer pins depending on the manufacturer. Always refer to the specific module's datasheet for exact details.
Below is an example of how to use the ST7789 TFT with an Arduino UNO:
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7789.h> // ST7789 driver library
#include <SPI.h> // SPI library
// Define pins for the ST7789
#define TFT_CS 10 // Chip Select pin
#define TFT_RST 9 // Reset pin
#define TFT_DC 8 // Data/Command pin
// Create an instance of the ST7789 display
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);
void setup() {
// Initialize the serial monitor
Serial.begin(9600);
Serial.println("ST7789 TFT Test");
// Initialize the display
tft.init(240, 240); // Initialize with 240x240 resolution
tft.setRotation(1); // Set display orientation (0-3)
// Fill the screen with a color
tft.fillScreen(ST77XX_BLACK);
// Draw some text
tft.setTextColor(ST77XX_WHITE);
tft.setTextSize(2);
tft.setCursor(10, 10);
tft.println("Hello, ST7789!");
}
void loop() {
// Add your code here to update the display
}
Note: Install the Adafruit_GFX and Adafruit_ST7789 libraries via the Arduino Library Manager before running the code.
No Display Output:
Flickering or Unstable Display:
Incorrect Colors or Artifacts:
Backlight Not Working:
Q: Can I use the ST7789 with a 5V microcontroller?
A: Yes, but you must use level shifters to convert the 5V logic signals to 3.3V to avoid damaging the display.
Q: What is the maximum SPI clock speed supported by the ST7789?
A: The ST7789 typically supports SPI clock speeds up to 15-20 MHz. Check the datasheet for exact details.
Q: Can I use the ST7789 without a library?
A: Yes, but you will need to manually implement the initialization sequence and commands as specified in the datasheet. Using a library simplifies the process.
Q: How do I adjust the brightness of the backlight?
A: Connect the BLK pin to a PWM-capable pin on your microcontroller and use PWM to control the brightness.
By following this documentation, you can effectively integrate the ST7789 TFT into your projects and troubleshoot common issues with ease.