Source: https://mokxi.com/parts/ili9341
Updated: 2026-11-10

Part

# TFT display, 240x320

A 2.4 inch color TFT over SPI, for games and gauges.

See every part

- 9 pins
- In 5 projects
- In 1 lesson

Drawn live by the editor's own code, at the size you see it.

At a glance

## The TFT display, 240x320 in brief

What it is, and where it sits on the bench.

The ILI9341 drives the common 2.4 and 2.8 inch 240x320 color TFT breakouts, red boards with nine pins: VCC, GND, CS, RST, DC, SCK, MOSI, MISO and LED. It is SPI plus a DC line marking each byte command or data. On an Uno, SCK goes to 13, MOSI to 11 and MISO to 12, with CS and DC on any pins; on an ESP32 DevKit the SPI pins are 18, 23 and 19. VCC takes 5 V through a regulator, but the logic is 3.3 V, so a real module on a 5 V Uno wants a level shifter; an ESP32 drives it directly. Mokxi models the MIPI command set: CASET and PASET set a window, RAMWR streams RGB565 pixels into it, and the MV, MX and MY bits of MADCTL are all there is to setRotation(). The glass is the whole memory, so unlike the ST7735 and ST7789 there is no offset to get wrong. LED left low keeps the panel dark over a correct picture. Nothing is read back on MISO, the power and gamma tables are ignored, the 120 ms after SLPOUT is not enforced and there is no scrolling or backlight dimming.

Family

Displays

Pins

9

A circuit built around it, running and explained: the TFT display simulator.

Pins

## 9 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

Role

What it does

VCC

Input or output

Supply.

GND

Input or output

Ground.

CS

Input

Chip select, active low.

RST

Input

Reset.

DC

Input

Low for a command byte, high for its data or for pixels.

SCK

Input

SPI clock.

MOSI

Input

SPI data in.

MISO

Output

Present on the header, never driven; this model answers no register reads.

LED

Input or output

The backlight; pulling it low blanks the panel.

How to use it

## How to use the ILI9341 2.4 inch TFT with an Arduino

Four signal wires and two straps, as in the Snake game beside this: CS to pin 10, DC to 9, SCK to 13 and MOSI to 11, with VCC, RST and LED all on 5 V. RST tied high just keeps the chip out of reset. LED is the backlight and a real pin: hold it low and the panel stays dark over a perfectly drawn picture. MISO can stay open, since nothing is read back.

Adafruit_ILI9341 compiles as it stands: construct it with the CS and DC pins, call begin() and setRotation(), then draw with the GFX calls. On an Uno every bit of every pixel is a pin change, so a full-screen fill takes a good part of a second. Snake repaints only the new head and the old tail each step, under three hundred pixels, which is what keeps it quick.

Part pin

Board pin

CS

Pin 10

DC

Pin 9

SCK

Pin 13

MOSI

Pin 11

RST

5 V

LED

5 V

VCC

5 V

GND

GND

Pong, two buttons drives the same panel from an ESP32-C3 at 3.3 V, with CS on GPIO 6, DC on 7, SCK on 4 and MOSI on 5. Adafruit_ILI9341 compiles on every board here but the ATtiny85.

Hold the button

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

Text on the ILI9341 with the Adafruit calls

How it is modeled

## What is true about the TFT display, 240x320, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Modeled

MADCTL (command 0x36) is the whole of "rotation" on this controller: MV
exchanges the two axes and MX/MY count the other way along them, and the frame
handed to the display is always in the address counter's own coordinates, so the
picture is upright whichever rotation the sketch chose. A module you rotate on the
bench is a part you rotate on the canvas. CASET/PASET set the pixel window and
RAMWR streams pixels into it, exactly as the datasheet has it.

### Not modeled

BGR (a MADCTL bit some panels use for their color filter order) is accepted but
has no effect: a pixel is always the RGB565 value that was written. The long init
sequences every library sends (power control, gamma, frame rate, VCOM) are accepted
and their parameters ignored, so a driver that sends a wrong or incomplete init gets a
perfect picture here and whatever the panel feels like on the bench.

No timing at all on the bus. SCK has no maximum rate, CS has no setup or hold
requirement, and a byte is latched the instant its eighth rising edge arrives. A real
ILI9341 wants SWRESET followed by 5 ms of quiet and SLPOUT followed by 120 ms
before it will take pixels; here both take effect immediately, so a driver that skips
those waits works here and not on a real module. There is no frame rate, no tearing
signal and no TE pin.

Also absent: vertical scrolling (0x33/0x37), partial mode, idle mode, tearing
effect control, and gamma or VCOM having any visible effect. COLMOD accepts both
16-bit and 18-bit pixel formats, but a pixel is stored as RGB565 either way, so 18-bit
mode loses the two extra bits per channel a real panel would keep. There is no
backlight brightness. LED is on or off, not a PWM dimmer.

From ILI9341 color TFT, in full.

Projects

## See the TFT display, 240x320 in a project

5 built-in projects use it. Each opens in the editor, already wired.

Lessons

## Where it turns up in a lesson

One lesson places it in its own circuit.

### Learn articles

1 lesson

- Arduino ILI9341 TFT Display: Wiring and Code

Boards

## The boards it is shown on

Each of these 2 boards has a built-in project with the TFT display, 240x320 in it.

- Arduino Uno R3
- ESP32-C3-DevKitM-1

Libraries

## Arduino libraries for the TFT display, 240x320

Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.

- Adafruit GFX Library
- Adafruit ILI9341
- TFT_eSPI

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the TFT display, 240x320

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
