Contents

Interfacing 2.8 INCH TFT Display Shield with Arduino

2.8 INCH TFT DISPLAY Shield Features

This module is a 2.8-inch TFT LCD module with “320X240” resolution and suitable for Arduino Uno and Mega2560 development boards. It’s a touch display shield and uses 8-bit parallel port communication.

You can download the datasheet of this module here. 

2.8 INCH TFT Display Shield Pinout

This module has 20 pins:

  • 5V: Module power supply – 5 V
  • 3.3V: Module power supply – 3.3 V
  • GND: Ground
  • LCD_RST: LCD Reset
  • LCD_CS: LCD bus chip select signal, low level enable
  • LCD_BL: LCD Light
  • LCD_DC: LCD bus write type between Data and Command
  • SCLK: SPI Clock
  • MISO: Data Sending line for SPI Protocol
  • MOSI: Data transmitting line for SPI Protocol
  • TP_BUSY: Touch panel is busy
  • SD_CS: Micro SD Select
  • TP_CS: Touch panel select
  • TP_IRQ: Touch panel interrupt

You can see the pinout of this module in the image below.

Required Materials

Hardware Components

Arduino UNO R3 × 1
2.8 INCH TFT Display × 1

Software Apps

Arduino IDE

Interfacing 2.8 INCH TFT Display Shield with Arduino

Step 1: Circuit

The 2.8-inch display is a ready-made shield for Arduino Uno, which can also be placed on the Arduino Mega. The pins of this shield are designed to be easily installed on the Arduino. The bad point about these displays is that they use all Arduino Uno pins.

Step 2: Code

First, download the following file.

https://www.waveshare.com/wiki/File:2.8inch_TFT_Touch_Shield_code.7z

Now open it and follow the path below.

  1. 2.8inch_TFT_Touch_Shield_code.7z\Arduino

Copy the lib folder to your Arduino library.

Then enter the folder and follow the path below.

     2. 8inch_TFT_Touch_Shield_code.7z\Arduino\DrawGraphic

Open the Arduino file in the folder and upload it to your Arduino.

Then extract it from comment mode and upload it to your Arduino.

    #include <stdint.h>
#include <LCD.h>
#include <SPI.h>

void setup()
{
    SPI.setDataMode(SPI_MODE3);
    SPI.setBitOrder(MSBFIRST);
    SPI.setClockDivider(SPI_CLOCK_DIV4);
    SPI.begin();
    
    Tft.lcd_init();                                      // init TFT library
    
    Tft.lcd_draw_rect(30, 40, 150, 100, RED);
    Tft.lcd_draw_circle(120, 160, 50, BLUE);
    Tft.lcd_draw_line(30, 40, 180, 140, RED);
    
    Tft.lcd_draw_line(30, 220, 210, 240, RED);
    Tft.lcd_draw_line(30, 220, 120, 280, RED);
    Tft.lcd_draw_line(120, 280, 210, 240, RED);
}

void loop()
{
  
}

/*********************************************************************************************************
  END FILE
*********************************************************************************************************/

This code is for testing display and show various shapes and designs graphically.

Liked What You See?​
Get Updates And Learn From The Best​

Leave a Reply

Your email address will not be published. Required fields are marked *