ST7796 TFT Display Library for Proteus Simulation: the 3.5 inch IPS 480 x 320 SPI TFT drawing a colour UI on an Arduino UNO V4.0

ST7796 TFT Display Library for Proteus Simulation

40
700
60
25
60
PCBWay

Hello friends, I hope you all are doing great. Today, I am going to share the new ST7796 TFT Display Library for Proteus Simulation. The 3.5" 480 x 320 IPS module with the ST7796S controller looks like the ILI9488 board at first sight, but it is a different animal: an IPS glass with wide viewing angles, 16-bit colour over SPI - so a third less data a frame - and a capacitive touch panel on I2C instead of a resistive film. With this library you can run a full Proteus simulation of that module, from the controller's command set to the touch chip's registers, and see every command your sketch sends.

ST7796 3.5 inch IPS TFT Proteus simulation with an Arduino UNO: the colour UI drawn, touches and button presses
Figure: The ST7796 simulation running: start-up, the 16-bit colour UI, touches on the pad and the PRESS button.
Updates

ST7796 TFT Display Library for Proteus

Latest version: V1.0 (December 2026, this tutorial)

Helping Tools

The demo draws a colour user interface on an Arduino UNO V4.0: a title bar, colour boxes, a hue bar, the three RGB565 ramps, a touch pad that marks where you touch and a PRESS button with a counter.

NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the LCD board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the ST7796 TFT Display Library for Proteus Simulation:

ST7796 TFT Display Library for Proteus Simulation: the 3.5 inch IPS 480 x 320 SPI TFT drawing a colour UI on an Arduino UNO V4.0
Figure: The ST7796 TFT Display Library for Proteus Simulation.

What Is the ST7796 3.5" IPS Module?

The module is a board 98 x 55.5 mm with a 3.5" IPS glass of 480 x 320 pixels - the same 0.153 mm pixels as the ILI9488 board - and the glass is as wide as the board. Behind it sits the ST7796S controller with its own frame memory; on top lies a capacitive touch panel read by an FT6336U chip over I2C. The board makes 3.3 V from a 5 V supply and shifts the display's input lines, so it is friendlier to a 5 V Arduino than most TFT boards.

  • A 14-pin header: VCC, GND, LCD_CS, LCD_RST, LCD_RS (data / command), SDI, SCK, LED, SDO, then CTP_SCL, CTP_RST, CTP_SDA, CTP_INT for the touch, and SD_CS for the SD card.
  • SPI mode 0, MSB first, writes up to about 15 MHz, reads up to about 6.7 MHz.
  • The touch at I2C address 0x38.
  • The backlight on while LED is high.

16-Bit Colour, and Why It Matters

The ST7796S accepts RGB565 over SPI: COLMOD 0x55, two bytes a pixel - five bits of red, six of green, five of blue. The ILI9488 board can only do 18-bit over SPI, three bytes a pixel. For a full screen that is 307,200 bytes instead of 460,800 - about a third faster on the same SPI clock. 18-bit (0x66) works too, if you need the extra shades.

The IPS Glass and INVON

IPS glass behaves differently from the TN glass of the cheaper boards. It is black when nothing drives it - not white - and this panel shows the right colours only with display inversion switched on (INVON, 0x21). Leave INVON out and every colour comes out as its negative: a white background turns black, red turns cyan. The library models both, and its Tests page says so.

The Extended Commands

The ST7796S guards its power, VCOM and gamma settings behind a command-set access command: F0 with C3 and F0 with 96 open the extended commands, F0 with 3C and F0 with 69 close them again. A typical init opens them, sends the board's own values and closes them. ID4 (D3h) reads 00 77 96.

The Capacitive Touch

The FT6336U does the hard work itself and reports finished coordinates. The sketch reads register 02h (TD_STATUS, the number of touch points) and the next four registers - the first point's x and y, with the event in the top two bits. CTP_INT goes low while a finger is on the glass, so the sketch reads only then. The coordinates come in the panel's native portrait orientation, 0 - 319 by 0 - 479, and are turned to the landscape screen in the sketch.

Features of the ST7796 Library

  • A real-looking module: the 3.5" IPS board at its true size, the glass in its place, the header, the holes; PWR, SPI and TOUCH lights.
  • The ST7796S of the datasheet: the command set over 4-wire SPI, the F0 access, the window and the address counter, MADCTL, COLMOD 55 and 66.
  • The IPS glass: black when undriven, inverted without INVON.
  • Reads: ID4 and the status answer on SDO.
  • Capacitive touch: click and drag on the glass; the FT6336U answers over I2C and pulls CTP_INT low.
  • Simple and Advance: an on-sheet status panel, or a pop-up with the display, a bus log of every command and a Tests page that checks your init.
  • A complete package: about 1.3 MB with the library, our Arduino UNO V4.0 and the demo, without the source code of the model.

The ST7796 in Proteus

The library has two devices in TEPST7796.LIB with the model TEPST7796.DLL: TFT35ST7796TEP (Simple, with the on-sheet status panel) and TFT35ST7796ADVTEP (Advance, with the pop-up). Search ST7796 or TFT in Pick Devices. The 14 pins are the module's header, top to bottom.

3.5 inch ST7796 IPS TFT module from the ST7796 Library for Proteus Simulation, at its true size with the 14-pin header
Figure: The ST7796 TFT module.

Download ST7796 TFT Display Library for Proteus Simulation

Click the button below to download ST7796-TFT-Display-Library-for-Proteus-v1.0.zip (about 1.3 MB, without the source code of the models):

ST7796 TFT Display Library for Proteus V1.0
  • README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
  • Proteus Library Files: TEPST7796.LIB and ArduinoV4TEP.LIB.
  • Proteus Model Files: TEPST7796.DLL and TEPARDUINO.DLL.
  • Arduino Code: the demo sketch (SPI and Wire).
  • Proteus Simulation: the demo project, its HEX file and copies of the DLLs.

No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.

How to Install ST7796 TFT Display Library for Proteus Simulation

  1. Close Proteus and extract the whole zip file, for example to your Desktop.
  2. Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
  3. Copy the files from Proteus Model Files into the MODELS folder.
  4. Delete TEPST7796.IDX from the LIBRARY folder if it is there.
  5. Start Proteus, press P and search for ST7796.

Proteus Simulation of a Capacitive Touch Screen

The demo uses an A4 sheet with our Arduino UNO Library for Proteus V4.0. The TFT (TFT1, the Advance device) sits on the UNO's hardware SPI - D11, D12, D13 - with LCD_CS on D10, LCD_RS on D9, LCD_RST on D8 and the backlight on D6; the touch uses the I2C pins A4 and A5, with CTP_INT on D2 and CTP_RST on D4. The Arduino's monitor is built in, the same window as our TEP Serial Monitor Advance for Proteus. Open ST7796-TFT-Touch-ArduinoUnoV4.pdsprj.

Click and drag on the glass to touch it. For the pictures below, the touches were scripted at fixed times so that every run is the same.

ST7796 simulation in Proteus: the 3.5 inch IPS TFT on SPI and its capacitive touch on I2C wired to an Arduino UNO V4.0, A4 sheet
Figure: The whole simulation on an A4 sheet.

The Sketch

The init list sets the 16-bit format and the rotation, with the extended commands open:

  0x3A, 1, 0x55,                    // pixel format: 16-bit RGB565, 2 bytes a pixel
  0x36, 1, MADCTL_LANDSCAPE,        // memory access: landscape, header on the left, BGR colour order

and it ends with the line this IPS glass cannot do without:

  0x21, 0,                          // INVERSION ON: this IPS glass shows the right colours only with it

Every pixel then costs two bytes:

    for (int col = 0; col < w; col++) { spiWrite(hi); spiWrite(lo); }   // 2 bytes a pixel

The touch arrives as the panel's portrait coordinates; the sketch turns them for the landscape screen:

  x = constrain(479 - (int)ty, 0, W - 1);                    // the portrait y runs from the far end to the header
  y = constrain((int)tx, 0, H - 1);

ST7796 Simulation Results

Open the project and press Run. The demo runs 5.6 simulated seconds and took about 2 minutes 41 seconds on our PC with the pop-up open and the pictures being taken. Click OPEN PANEL on the module for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.

The Start-Up

At power-on the IPS glass is black - unlike the white of a TN glass. The sketch resets the touch chip and then the display (LCD_RST low for 20 ms at 80.7 ms), sends the software reset at 250.7 ms, opens the extended commands with F0 C3 and F0 96, reads ID4 - 00 77 96 after one dummy clock - and sends the init list at 400.8 ms: COLMOD 55, MADCTL E8, the board's power, VCOM and gamma values, F0 3C and F0 69 to close the extended commands again, INVON, then SLEEP OUT at 401.0 ms. The touch chip answers its ID: 64. The background is filled once with the display still off, so the pop-up at 0.6 s still shows black glass.

ST7796 Proteus simulation pop-up: the IPS glass black while the controller starts up
Figure: The start-up.

The Picture

DISPLAY ON comes at 1207.6 ms after power-on. The monitor reports "Full screen (307,200 bytes): 638 ms" - against 918 ms for the 460,800 bytes of an 18-bit ILI9488 screen on the same UNO - and "Screen drawn in 473 ms" for the rest of the picture. The pop-up at 2.2 s shows the finished screen: 16-bit 565, MADCTL E8 (landscape, rotation 3), BGR, inversion ON - "right for IPS".

ST7796 Proteus simulation pop-up: the colour UI - title bar, colour boxes, hue bar and RGB565 ramps
Figure: The picture.
ST7796 Proteus simulation: the 3.5 inch IPS TFT module drawing its UI on the sheet
Figure: The module at work.
The ST7796 TFT display simulation running in the Proteus workspace
Figure: The simulation in the workspace.

Touching the Pad

At 2.4 s a finger touches the pad at (110, 250). CTP_INT goes low, the sketch reads TD_STATUS and the first point over I2C - the FT6336U reports the panel's portrait coordinates (250, 369) - and turns them: "Touch x 110 y 250 (native 250,369)". A dot appears under the finger.

ST7796 Proteus simulation pop-up: a touch on the pad, the FT6336U coordinates
Figure: A touch.

From 3.0 s the finger drags across the pad from (40, 220) to (270, 300). The touch chip reports 60 times a second and the sketch reads each report once, so the path comes out as an even trail of dots; the readout follows it to X 237 Y 289.

ST7796 Proteus simulation pop-up: a finger dragged across the pad, a trail of dots
Figure: A drag.

The PRESS Button

At 4.0 s the PRESS button is pressed at (386, 231) - the FT6336U says (231, 93) in its own portrait coordinates. The sketch flashes the button white - the pop-up at 4.08 s catches it, with the touch DOWN and CTP_INT low - and counts: "PRESS - count 1".

ST7796 Proteus simulation pop-up: the PRESS button flashing on a press
Figure: A press.

Two more presses at 4.6 s and 5.2 s give "PRESS - count 2" and "PRESS - count 3". The sheet at 5.6 s shows COUNT 3, with 373,719 pixels written in the whole run.

ST7796 Proteus simulation pop-up: the counter after three presses
Figure: Three presses.

The Bus Log and the Tests Page

The Bus log lists every transfer, newest first: the windows (2A, 2B), the MEMORY WRITE (2C) and the pixel bursts of each character cell, and the touch reads over I2C - with filters for the commands, the pixels or the problems alone.

ST7796 Proteus simulation Bus log: every command, pixel burst and touch read
Figure: The Bus log.

The Tests page checks the start-up against the ST7796S datasheet and this IPS glass, and every row is green: power 5.00 V; the hardware reset 20.0 ms; the software reset at 250.7 ms (MADCTL and COLMOD survive it on the ST7796S); the waits kept; command table 2 opened with F0 C3 + F0 96 for 10 extended settings and closed again with F0 3C + F0 69; SLEEP OUT at 401.0 ms; COLMOD 55 - 16-bit, a full screen 307,200 bytes; MADCTL E8 - upright on this landscape module; BGR; INVERSION ON - right for this normally-black IPS glass; DISPLAY ON at 1207.6 ms; ID4 00 77 96. Verdict: initialised like the datasheet for this IPS glass.

ST7796 Proteus simulation Tests page: the init checked against the datasheet and the IPS glass
Figure: The Tests page.

The Arduino's built-in serial monitor prints the start-up - the version, the ID read back from the panel, the init, the touch chip's ID and the two times - and then a line for every touch and every press of the button. Its times come from millis(), which starts when the sketch starts.

Arduino UNO V4.0 serial monitor in the ST7796 Proteus simulation: the IDs, the times and the touches
Figure: The Arduino's monitor.

ST7796 or ILI9488?

Both are 3.5" 480 x 320 SPI boards. The ILI9488 in our ILI9488 TFT Display Library for Proteus takes only 18-bit colour over SPI and has a resistive film read over SPI; the ST7796 takes 16-bit colour - a third less data - has an IPS glass with wider viewing angles, and a capacitive touch on I2C that needs no calibration. For a smaller 2.8" screen see our TFT ILI9341 Library for Proteus, and for a tiny fast colour display our ST7789 TFT LCD Library for Proteus.

Try It Yourself

  • Click and drag on the glass while the simulation runs: the pad marks your path.
  • Remove the INVON line from the init: every colour turns to its negative.
  • Change COLMOD to 0x66 and send three bytes a pixel: the picture is the same, the fill takes half as long again.
  • Remove the BGR bit from MADCTL: red and blue swap.
  • Leave out F0 C3 / F0 96: the Tests page flags the extended commands sent with the access closed.

Ideas to Extend the Demo

  • A smart-home panel with big touch buttons for lights and a fan.
  • Swipe gestures: watch the touch move between two reads.
  • Load pictures from the SD card on the back.

Your Own Sketches

The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.

Things to Know Before Using a Real ST7796 Module

  • INVON: this IPS glass needs it.
  • F0 access: open it for the power and gamma settings, close it after.
  • SDO: it comes back at 3.3 V and may not release MISO - leave it unconnected if the SD card shares the bus.
  • Touch orientation: map the portrait coordinates to your rotation; a board may mirror one axis.
  • Power: 5 V; the backlight takes most of the current.

Troubleshooting

  • A black screen: no sleep out or display on, the LED pin low, or CS / RS not connected.
  • Negative colours: INVON missing.
  • Red and blue swapped: the BGR bit missing.
  • Upside down or mirrored: the MADCTL rotation.
  • No touch: SDA / SCL not on the I2C pins, CTP_RST held low, or the touch read before it booted.

Limitations of the Simulation

  • The commands, the colour formats, the F0 access, the reads, the module's size and pins and the touch registers follow the ST7796S and FT6336U datasheets and the module's specification; the module is our own drawing.
  • Our own figures: the one-dummy-clock ID4 read, the touch chip's boot time and its trigger-mode pulse, the native touch origin.
  • Not modelled: the analog power and gamma settings on the picture, the parallel interface, the SD card, two-finger gestures.
  • Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or the makers of the module and its chips.
  • Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.

So, that was all about the ST7796 TFT Display Library for Proteus Simulation. I hope it helps you build your next touch screen project. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!


Comments

0

Join the conversation