How to wire a 1.77 inch TFT to a Feather board
To wire a 1.77 inch TFT to a Feather board, you need to connect the display’s 8-pin SPI interface to the Feather’s corresponding pins, typically using a 1.77 inch spi mcu rgb tft display module that operates at 3.3V logic. The TFT uses a 128x160 resolution, a ST7735S driver IC, and requires a 4-wire SPI bus (SCLK, MOSI, DC, CS) plus a reset pin and backlight control. On a Feather M0 or Feather ESP32, for example, you’d map the TFT’s pins: VCC to 3.3V, GND to GND, SCL to SCK (e.g., pin 13 on Feather M0), SDA to MOSI (pin 11), RES to a digital pin (e.g., pin 9), DC to another digital pin (e.g., pin 10), CS to a chip select pin (e.g., pin 8), and BL to a PWM-capable pin (e.g., pin 6) for brightness control. The display draws about 20-40 mA at 3.3V, so the Feather’s onboard regulator handles it easily. Always double-check the datasheet for your specific Feather variant—some use different SPI pin assignments—and ensure the TFT’s logic level matches the Feather’s 3.3V output to avoid damage. This setup works with Adafruit’s ST7735 library, which you can configure with the correct pin numbers in the initialization code.
Pin-by-pin wiring details
The 1.77 inch TFT module typically has 8 pins in a 2x4 header, labeled as follows: VCC, GND, SCL, SDA, RES, DC, CS, and BL. On a Feather board, the SPI pins are often dedicated but can be reassigned in software. For a Feather M0 (ATSAMD21G18), the SPI pins are: SCK on pin 13, MOSI on pin 11, and MISO on pin 12 (not used for TFT). Connect SCL to SCK, SDA to MOSI. For RES, use any free digital pin, like pin 9; for DC, use pin 10; for CS, use pin 8; for BL, use pin 6 (PWM-capable). The Feather’s 3.3V output supplies the TFT’s VCC, and GND connects to GND. If your Feather board uses a different pinout, such as the Feather ESP32 V2, SPI pins are on SCK (IO18), MOSI (IO23), and you can assign CS, DC, RES, and BL to any GPIOs (e.g., IO5, IO17, IO16, IO4). The backlight pin (BL) is often driven by a 100-ohm resistor in series to limit current, but the Feather’s 3.3V output can handle it directly—just note that the BL pin draws about 20 mA when fully on, so check the Feather’s total current budget (typically 200-500 mA for most models).
SPI communication specifics
The TFT uses a 4-wire SPI protocol (SCLK, MOSI, DC, CS) with a clock speed of up to 8 MHz on the ST7735S driver. The Feather’s SPI clock can be set to 4-8 MHz for reliable operation—faster than 8 MHz may cause glitches due to signal integrity over jumper wires. The display’s resolution is 128x160 pixels, and each pixel uses 16-bit color (RGB565), so a full frame buffer is 128 * 160 * 2 = 40,960 bytes. The Feather’s RAM (32 KB on M0) is insufficient for double buffering, so you’ll need to draw directly to the display using the library’s write-only commands. The initialization sequence for the ST7735S includes 12 commands: SWRESET (0x01), SLPOUT (0x11), COLMOD (0x3A) set to 0x05 for 16-bit color, DISPON (0x29), and others. The library handles this automatically, but you can tweak the MADCTL (0x36) register to set the display orientation—e.g., 0xC0 for portrait mode (default) or 0x60 for landscape. The refresh rate is about 60 Hz, but with SPI overhead, you’ll achieve around 15-20 fps for full-screen updates, depending on your code efficiency.
Power and current considerations
The TFT module’s typical current consumption is 20-40 mA at 3.3V, with the backlight contributing 15-20 mA when on. The Feather board’s 3.3V regulator (e.g., AP2112 on M0) can supply up to 600 mA, so you’re safe. However, if you’re powering the Feather via USB (500 mA limit), the total draw—including the TFT, Feather’s MCU (10-20 mA), and any peripherals—should stay under 400 mA to avoid brownouts. For battery-powered Feathers (e.g., LiPo at 3.7V), the TFT’s backlight can be a significant drain: at 20 mA, a 400 mAh battery lasts about 20 hours of continuous use. You can reduce power by turning off the backlight via the BL pin (set to LOW) or using PWM at 50% duty cycle, which cuts current to 10 mA while maintaining visibility. The TFT’s sleep mode (SLPIN command) drops current to under 1 mA, but you’ll need to reinitialize the display after waking—this takes about 120 ms.
Library and software setup
Adafruit’s ST7735 library (version 1.10.0) and Adafruit GFX library (version 1.11.5) are the standard choices for Arduino IDE. Install them via the Library Manager. In your code, include #include <Adafruit_ST7735.h> and #include <Adafruit_GFX.h>. Define the pins: #define TFT_CS 8, #define TFT_DC 10, #define TFT_RST 9. Then create the display object: Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);. In setup(), call tft.initR(INITR_BLACKTAB) for the 1.77 inch version (which uses a black tab on the ribbon cable). If you get garbled colors, try INITR_GREENTAB or INITR_REDTAB—the ST7735S has multiple variants. Set the SPI clock: tft.setSPISpeed(8000000). For the backlight, use pinMode(6, OUTPUT); analogWrite(6, 255); to turn it on fully. The library provides functions like tft.fillScreen(ST7735_BLACK), tft.drawPixel(x, y, color), and tft.print("Hello"). The GFX library supports fonts, bitmaps, and shapes—each fillRect() call takes about 0.5 ms for a 10x10 block at 8 MHz SPI.
Common wiring pitfalls and fixes
A frequent issue is using 5V logic on the TFT’s signal pins, which can damage the ST7735S (rated for 3.3V max). Feather boards are 3.3V, so this is safe, but if you’re using a 5V Arduino, you’d need level shifters. Another problem: long jumper wires (over 10 cm) can cause SPI signal degradation, leading to white screens or corrupted data. Keep wires under 5 cm, or use twisted pairs for SCL and SDA. If the display stays white, check the reset pin: it must be toggled LOW for 10 ms at startup. The library does this automatically, but if you’re using a shared reset line, ensure it’s not held HIGH by another device. Also, the CS pin must be pulled LOW during SPI transactions; the library handles this, but if you’re using multiple SPI devices, ensure the TFT’s CS is not left floating. The backlight pin (BL) should not be left unconnected—it may float HIGH, causing the backlight to stay on even in sleep mode. Tie it to GND via a 10k resistor if not used, or drive it with a PWM pin for control.
Performance benchmarks and data
At 8 MHz SPI, a full-screen fill (128x160 pixels) takes about 41 ms for a solid color, based on the 16-bit color data transfer: 40,960 bytes * 8 bits / 8 MHz = 40.96 ms, plus command overhead. Drawing a 10x10 pixel square takes 0.5 ms, and a single pixel takes 1.5 µs. The ST7735S’s response time is 15 ms (typical), so motion blur is minimal for basic animations. The display’s viewing angle is 120 degrees horizontal and 100 degrees vertical, with a contrast ratio of 400:1. The color depth is 262K colors (16-bit), but the human eye perceives about 16.7 million, so gradients may show slight banding. The operating temperature range is -20°C to 70°C, making it suitable for indoor projects. In terms of memory, the Feather M0 has 32 KB RAM, so storing a full frame buffer is impossible—you’ll need to use the library’s write-only mode, which sends data directly to the display without buffering. For complex graphics, consider using a Feather with more RAM, like the Feather ESP32 (520 KB).
Alternative wiring for different Feather models
Feather boards vary in pinout. For the Feather Huzzah ESP8266, SPI pins are on SCK (GPIO14) and MOSI (GPIO13), but the ESP8266 runs at 3.3V and has limited GPIOs—use GPIO5 for CS, GPIO4 for DC, GPIO0 for RES, and GPIO2 for BL. The ESP8266’s SPI clock is limited to 4 MHz due to Wi-Fi interference, so expect slower performance (full-screen fill in 82 ms). For the Feather nRF52840, SPI pins are on SCK (P0.17) and MOSI (P0.15), with 3.3V logic—use any digital pins for CS, DC, RES, BL. The nRF52840’s SPI can run at 8 MHz, but its power consumption is lower (10 mA active), so the TFT’s 20 mA draw is a significant portion of the budget. For the Feather STM32F405, SPI pins are on SCK (PA5) and MOSI (PA7), with 3.3V logic—this board can drive the TFT at 12 MHz SPI, reducing fill time to 27 ms. Always check the Feather’s schematic for pin functions—some boards use alternate SPI ports (e.g., SPI1 on the Feather M4 Express uses pins 24 and 25).
Physical mounting and connections
The 1.77 inch TFT module has a 2x4 pin header with 2.54 mm pitch, which fits directly into a breadboard or can be soldered to a female header. For a permanent setup, use a FeatherWing proto board to solder the TFT’s pins to the Feather’s corresponding holes. The TFT’s PCB is 35 mm x 28 mm, with a 2.5 mm mounting hole at each corner—use M2.5 screws to secure it to a project box. The ribbon cable is 20 mm long and fragile—avoid bending it more than 90 degrees. The display’s glass is 1.1 mm thick, with a 0.2 mm polarizer, so handle it with care. For wiring, use 26 AWG solid-core wire for breadboard connections, keeping the SPI lines as short as possible. If you’re using a Feather with a built-in battery charger (like the Feather M0 LiPo), connect the TFT’s VCC to the Feather’s 3.3V pin, not the battery pin (which is 3.7V unregulated). The TFT’s backlight can be driven by a transistor if you need to switch it with a higher current—but the Feather’s GPIO can handle 20 mA directly, so it’s unnecessary.
Troubleshooting specific error codes
If the display shows a white screen, the most common cause is a missing reset pulse—check that the RES pin is connected and not tied to VCC. If the display shows random pixels, the SPI clock speed is too high—reduce it to 4 MHz. If colors are inverted (e.g., red appears as blue), the MADCTL register is set wrong—try tft.setRotation(1) to swap the color order. If the display flickers, the backlight PWM frequency is too low—use a 1 kHz PWM frequency (e.g., analogWriteFrequency(6, 1000) on Feather M0). If the Feather crashes when initializing the TFT, the CS pin might be shared with another SPI device—ensure only one device is selected at a time. If the display is dim, the backlight pin’s PWM duty cycle is low—set it to 255. If the display shows a black screen with no backlight, the BL pin is not driven—measure voltage at the BL pin; it should be 3.3V when on. If the display shows a partial image, the SPI data lines are swapped—swap SDA and SCL on the TFT side. If the display shows a mirror image, the MADCTL register’s column address order is reversed—use tft.setRotation(2) to fix.
Data sheet references and specifications
The ST7735S driver supports a resolution of 132x162 pixels, but the 1.77 inch TFT uses a 128x160 active area. The pixel pitch is 0.18 mm, giving a density of 141 PPI. The display’s brightness is 250 cd/m² typical, with a 500:1 contrast ratio. The SPI interface operates at 1.8V to 3.3V logic, but the module includes a 3.3V regulator, so you can power it from 3.3V directly. The backlight uses 4 white LEDs in series, each with a forward voltage of 3.0V, so a 3.3V supply is sufficient. The TFT’s total power consumption is 0.1W at 3.3V (30 mA typical). The module’s dimensions are 34.5 mm x 27.5 mm x 3.5 mm, with a viewing area of 28.0 mm x 22.4 mm. The weight is 6.5 grams. The operating temperature range is -20°C to 70°C, and storage is -30°C to 80°C. The humidity range is 5% to 90% non-condensing. The display’s response time is 15 ms (rise) and 20 ms (fall). The ST7735S supports 16-bit (RGB565) and 18-bit (RGB666) color modes, but the 18-bit mode requires 3 bytes per pixel, which is slower—use 16-bit for best performance. The display’s gamma curve is set to 2.2 by default, which matches most image sources.
Advanced wiring techniques
For high-speed SPI, use a 10-ohm resistor in series with the SCL and SDA lines to dampen reflections, especially if wires are longer than 5 cm. Add a 0.1 µF capacitor between VCC and GND near the TFT to filter noise. If you’re using multiple TFTs, each needs its own CS pin, but they can share SCL, SDA, RES, and DC. For a Feather with hardware SPI, use the dedicated SPI pins (SCK and MOSI) for faster speeds—software SPI is slower and less reliable. The Feather’s SPI can be configured for 8-bit or 16-bit data transfers; the ST7735 library uses 8-bit commands followed by 16-bit data. For the backlight, use a MOSFET (e.g., 2N7002) if you need to switch higher current (over 40 mA), but the Feather’s GPIO is fine for the TFT’s 20 mA. If you’re using a battery, add a Schottky diode (e.g., 1N5817) in series with the TFT’s VCC to prevent reverse current when the Feather is powered off. The TFT’s reset pin should have a 10k pull-up resistor to VCC to ensure it stays HIGH during power-up—the library toggles it LOW, but a pull-up prevents floating. For the CS pin, add a 10k pull-up to VCC to avoid spurious SPI transactions when the Feather is booting.
Real-world project examples
A common use case is a weather station: wire the TFT to a Feather M0 with a DHT22 sensor. The TFT displays temperature and humidity at 1 fps, with a 10-second update interval. The Feather’s SPI at 8 MHz handles the text rendering in 2 ms per line. Another project is a game console: use a Feather ESP32 with a joystick and the TFT for a 128x160 pixel game. The ESP32’s dual core allows one core to handle SPI updates (15 fps) while the other runs game logic.