What is the pinout of a 3.2 inch 240x320 TFT display?
The pinout of a 3.2 inch 240x320 TFT display typically follows a 16-pin or 18-pin configuration, depending on the specific driver IC and interface type (usually SPI or parallel). For the most common variant, the 3.2 inch 240x320 tft display module with an ILI9341 or similar driver, the standard pinout includes: VCC (3.3V or 5V input), GND, CS (chip select), RESET, DC (data/command), SDI (MOSI), SCK (clock), LED (backlight control), and optional MISO for read operations. Some modules also include touch controller pins (T_IRQ, T_DO, T_DIN, T_CS, T_CLK) if they integrate a resistive touch layer. The exact pin mapping varies by manufacturer, so always verify with the datasheet—but I’ll break down the most widely used layout below.
Core Power and Ground Pins
VCC is the main power input. Most 3.2-inch TFT panels operate at 3.3V logic, but many breakout boards include an onboard voltage regulator allowing 5V input—check the module’s specs. For example, the ILI9341 driver itself runs at 2.8V to 3.6V, so feeding 5V directly into VCC without regulation can fry the chip. GND is straightforward: connect to common ground. The backlight LED pin is often separate—some modules tie it to VCC via a resistor, but dedicated LED pins let you control brightness with PWM. Typical forward current for the backlight is 20-40mA at 3.3V, so a 100-150 ohm series resistor is common if you’re driving it directly from a microcontroller pin.
SPI Interface Pins (4-Wire Mode)
CS (chip select) is active low—you pull it low to enable communication with the display. RESET pin resets the driver; many modules have an internal pull-up, but it’s safer to connect it to a GPIO and toggle it low for 10ms at startup. DC (data/command) distinguishes between command bytes (DC low) and pixel data (DC high). This is critical: sending a command like 0x36 (Memory Access Control) requires DC low, while pixel colors need DC high. SCK (serial clock) typically runs up to 10-20MHz on SPI, but with long wires, you might need to slow it to 1-2MHz to avoid signal integrity issues. SDI (MOSI) carries data from your microcontroller to the display. Some modules include SDO (MISO) for reading register values—useful for initialization checks but not mandatory for basic drawing.
Touch Controller Pins (If Present)
Many 3.2-inch TFTs come with a resistive touch overlay using an XPT2046 or ADS7843 controller. The touch interface adds 5 pins: T_IRQ (touch interrupt, active low), T_DO (MISO for touch data), T_DIN (MOSI for commands), T_CS (chip select for touch), and T_CLK (clock). The touch controller operates at 2.7V to 5.25V, so it’s more forgiving with 5V logic. Communication is SPI-like, but the protocol is different—you send 8-bit commands (e.g., 0x90 for Y-position) and read 12-bit ADC values. The touch resolution is 4096 steps, but the actual accuracy is around 10-12 bits due to noise. Calibration is required because the touch panel’s physical coordinates don’t map linearly to the display’s 240x320 pixels—expect a 2-3% error without calibration.
Common Pinout Table for 16-Pin ILI9341 Module
Here’s a typical pinout for a 16-pin 3.2-inch TFT with SPI and touch. Note that pin numbers are physical positions on the header, not GPIO numbers on your microcontroller.
| Pin Number | Pin Name | Function | Voltage/Logic |
|---|---|---|---|
| 1 | VCC | Power (3.3V or 5V) | 3.3V typical, 5V tolerant with regulator |
| 2 | GND | Ground | 0V |
| 3 | CS | Chip Select (SPI) | Active low, 3.3V logic |
| 4 | RESET | Reset display driver | Active low, internal pull-up |
| 5 | DC | Data/Command control | Low=command, High=data |
| 6 | SDI (MOSI) | SPI data input | 3.3V logic |
| 7 | SCK | SPI clock | Up to 20MHz |
| 8 | LED | Backlight control | 3.3V or PWM, 20-40mA |
| 9 | SDO (MISO) | SPI data output (optional) | 3.3V logic |
| 10 | T_CS | Touch chip select | Active low |
| 11 | T_CLK | Touch SPI clock | Up to 10MHz |
| 12 | T_DIN | Touch SPI MOSI | 3.3V/5V logic |
| 13 | T_DO | Touch SPI MISO | 3.3V/5V logic |
| 14 | T_IRQ | Touch interrupt | Active low, open-drain |
| 15 | NC | Not connected | - |
| 16 | GND | Ground | 0V |
Alternative Pinout for 8-Bit Parallel Interface
Some older or cheaper 3.2-inch TFTs use an 8-bit parallel interface (e.g., with ILI9341 in 8080 mode). This requires 8 data pins (D0-D7), plus WR (write), RD (read), CS, RESET, DC, and backlight. That’s 14+ pins minimum, which eats up GPIOs fast—hence SPI is more popular with modern microcontrollers like ESP32 or STM32. The parallel interface offers faster refresh rates (up to 60fps for 240x320) compared to SPI’s typical 20-30fps, but for most UI applications, SPI is sufficient. If you’re using an Arduino Uno, forget parallel mode—you don’t have enough pins. The parallel pinout varies wildly, so always check the module’s silkscreen or datasheet.
Voltage Level Shifting Is Not Optional
A common mistake is connecting a 5V microcontroller (like classic Arduino) directly to a 3.3V TFT. The ILI9341’s absolute maximum for logic pins is 3.6V—anything above can damage the driver. Use a level shifter (e.g., 74LVC245 or resistor divider) for CS, RESET, DC, MOSI, and SCK. The backlight LED pin is more forgiving; many modules include a transistor that can handle 5V logic. For the touch controller, it’s 5V-tolerant, but mixing voltages on the same SPI bus can cause cross-conduction. I’ve seen modules with built-in level shifters on the breakout board—check for a 3.3V regulator and a few transistors near the header. If your module has a jumper to select 3.3V or 5V, use 3.3V for logic and 5V only for backlight power.
Backlight Control Details
The LED pin typically expects a PWM signal at 1-10kHz to adjust brightness. Driving it with a constant 3.3V gives full brightness (around 300-500 cd/m² for these panels). But if you connect it to a GPIO without a resistor, you risk drawing too much current—many modules have a built-in resistor, but not all. Measure the voltage across the backlight pins with a multimeter; if it’s directly connected to the LED string (forward voltage ~3.2V for white LEDs), you need a current-limiting resistor. A 100-ohm resistor in series with a 3.3V supply yields about 10mA, which is dim but safe. For full brightness, aim for 20mA per LED—these panels typically have 4-6 LEDs in parallel, so total backlight current is 80-120mA. Don’t draw that from a microcontroller pin; use a transistor or MOSFET.
Initialization Sequence and Pin Timing
After wiring, you must initialize the display driver with a specific sequence. For ILI9341, the typical startup involves: power on VCC, wait 10ms, toggle RESET low for 10ms then high, wait 120ms, then send commands like 0x11 (Sleep Out), wait 150ms, then 0x29 (Display On). The DC pin must be low during command writes and high for data. SPI clock polarity (CPOL=0) and phase (CPHA=0) are standard—data is sampled on the rising edge. If your module uses a different driver (e.g., ST7789 or HX8357), the pinout is similar but the initialization commands differ. For example, ST7789 requires a different memory access control command (0x36) and often a shorter delay after reset. Always cross-reference the driver IC part number on the module’s PCB—common ones include ILI9341, ILI9488 (for 480x320), and ST7789 (for 240x240). The 3.2-inch 240x320 size almost exclusively uses ILI9341 or its clones like the ILI9340.
Real-World Wiring Examples
If you’re using an ESP32, typical connections: VCC to 3.3V, GND to GND, CS to GPIO5, RESET to GPIO17, DC to GPIO16, MOSI to GPIO23, SCK to GPIO18, LED to GPIO4 (PWM-capable). For an Arduino Uno, you’d use digital pins 10 (CS), 9 (RESET), 8 (DC), 11 (MOSI), 13 (SCK), and 6 (LED). But the Uno’s 5V logic means you need level shifters—a simple voltage divider (1k ohm and 2k ohm) on each signal line works for low-speed SPI (under 1MHz). At higher speeds, the divider adds capacitance and distorts the signal, so use a dedicated level shifter like the TXB0104. I’ve seen people skip level shifting and the display works for a few hours before the driver IC fails—not worth the risk.
Touch Calibration Data
If your module includes touch, the raw ADC values for X and Y range from 0 to 4095. To map to 240x320 pixels, you need two-point calibration: touch two known points (e.g., top-left and bottom-right), read the ADC values, then calculate scaling factors. For example, if top-left reads (200, 3800) and bottom-right reads (3800, 200), the X scale factor is (240-0) / (3800-200) = 0.0667, and Y scale factor is (320-0) / (200-3800) = -0.0889 (note the negative sign due to inverted axis). Then for any touch point, pixel X = (adcX - 200) * 0.0667, pixel Y = (adcY - 3800) * -0.0889. This is linear approximation—real touch panels have some nonlinearity, especially near edges. Expect 5-10 pixel error without advanced calibration algorithms. The T_IRQ pin goes low when a touch is detected; you can use it to trigger an interrupt, but debounce with a 50ms delay to avoid false triggers.
Power Consumption Figures
A 3.2-inch TFT with backlight at full brightness draws about 150-250mA at 3.3V (0.5-0.8W). The display driver itself consumes 10-20mA, and the touch controller adds another 1-2mA. If you’re battery-powered, consider dimming the backlight to 50% (drops current to 80-120mA) or using a sleep mode. The ILI9341 supports a sleep command (0x10) that cuts power to the display panel but keeps the interface alive—current drops to under 50µA. Waking it up takes 5ms from sleep, so it’s viable for intermittent updates. For continuous use, the backlight dominates power—use a high-efficiency LED driver if you need low power.
Common Pitfalls with Pinout
One frequent issue is swapping MOSI and MISO—some modules label them as SDI and SDO, but not consistently. If your display doesn’t respond, swap these two pins. Another problem: the RESET pin is sometimes tied to VCC via a capacitor on the module, so you don’t need to connect it—but if you do, don’t drive it high, just leave it floating or connect to a GPIO set to input with pull-up. I’ve also seen modules where the LED pin is actually the backlight anode, not a control pin—connecting it to 3.3V directly lights the backlight, but a GPIO can’t sink enough current to turn it off. In that case, use a P-channel MOSFET to switch the backlight. Lastly, the touch pins are sometimes not broken out on cheaper modules—they’re just labeled NC. If you need touch, buy a module that explicitly states “with touch controller” and verify the pinout in the datasheet.
Interface Speed and Performance
SPI clock speed directly affects frame rate. At 10MHz, a 240x320 16-bit color frame (153,600 bytes) takes about 15ms to send over SPI, plus command overhead, yielding roughly 30fps. At 20MHz, it’s 15fps due to overhead? No—actually 20MHz halves the transfer time to 7.5ms, so you can hit 60fps if your microcontroller can generate the data fast enough. But the ILI9341’s internal RAM access time limits the actual refresh to around 50fps. For animations, 30fps is smooth enough. If you need higher speed, use parallel interface (8-bit or 16-bit), which can push 100fps, but you’ll need a microcontroller with enough GPIOs and a fast memory bus. The ESP32’s SPI peripheral can run at 40MHz with DMA, achieving 40fps for full-screen updates—good enough for most GUI libraries like LVGL or TFT_eSPI.
Physical Dimensions and Connector
The 3.2-inch TFT module itself measures about 57mm x 85mm x 3mm (without touch overlay) and weighs roughly 20g. The pin header is usually 2.54mm pitch, single row, with 16 or 18 pins. Some modules use a 0.5mm FPC connector instead—those are harder to breadboard and require a custom PCB. The touch overlay adds 1mm thickness and 5g weight. The viewing angle is typically 6 o’clock (IPS panels have better angles, but these are often TN with 60-degree horizontal and 40-degree vertical viewing cone). Color depth is 262K (18-bit) or 65K (16-bit) depending on how you configure the driver—16-bit is faster and uses less memory, but gradients show banding. The ILI9341 supports 18-bit color internally, but over SPI you usually send 16-bit (RGB565) to save bandwidth.
2026 Edition