TFT LCD 2.8" 240x320 Display Not Using Full Screen on Arduino Uno

I'm working with a TFT LCD 2.8" 240x320px with SD card reader (SPI) and an Arduino Uno. The display uses the ILI9341 driver. I am also using the URTouch library for the touchscreen functionality.

Here’s the code I’m using:

#include "Adafruit_GFX.h"     
#include "Adafruit_ILI9341.h" 
#include "URTouch.h"          

#define TFT_DC 9              
#define TFT_CS 10            
#define TFT_RST 8
#define TFT_MISO 12         
#define TFT_MOSI 11           
#define TFT_CLK 13            

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);

#define t_SCK 3              
#define t_CS 4                
#define t_MOSI 5              
#define t_MISO 6             
#define t_IRQ 7              

URTouch ts(t_SCK, t_CS, t_MOSI, t_MISO, t_IRQ);

void setup() {
  Serial.begin(9600);  // Start serial communication for debugging
  tft.begin();                     
  tft.setRotation(0);           
  
  Serial.println("Starting ILI9341 Diagnostics:");
  uint8_t x = tft.readcommand8(ILI9341_RDMODE);  // Example diagnostic command
  Serial.print("Read Mode: 0x"); Serial.println(x, HEX);

  ts.InitTouch();                   
  ts.setPrecision(PREC_EXTREME);
  tft.fillScreen(ILI9341_BLACK);

  tft.setTextColor(ILI9341_PURPLE);  
  tft.setTextSize(2);               
  tft.setCursor(85, 5);              
  tft.print("Touch Demo");
}

void loop() {
  int x, y;                        
 
  while(ts.dataAvailable()) {        
    ts.read();                      
    x = ts.getX();                 
    y = ts.getY();                  
    if((x != -1) && (y != -1)) {          
      x += 13;                      
      y += 4;                       
      int radius = 4;               
      tft.fillCircle(x, y, radius, ILI9341_YELLOW);
    }
  }
}

The issue is that the display doesn’t seem to use the full screen. The text and graphics are limited to a smaller portion of the display. I’ve tried adjusting the setRotation() and recalibrating the touchscreen, but it didn’t help.

Could anyone guide me on:

  1. Why the display isn’t utilizing the full 240x320 resolution?
  2. If there are specific settings I need to configure for the ILI9341 driver or the URTouch library?

Thanks in advance for any insights or suggestions!

if you compile with all warnings activated (verbose), do you get any notification of low memory?

can you give a link to the particular display?

be careful using such TFT displays with microcontrollers which use 5Volt logic such as the UNO, Mega, etc
although such displays can often be powered from 5volts the display interface uses 3.3V logic which can be damaged if connected directly to 5V logic

This is the website where I bought the display

display looks similar to 240X320 Resolution 2.8" SPI TFT LCD Display Touch Panel ILI9341

all the documentation I have seen on this type of display states that
ifJ1 is shorted supply 3.3V on VCC
if J1 is open supply 5V on VCC
e.g. By solder shorting the two J1 pads together, the 5volt regulator is bypassed and the module can be powered directly from 3.3V.

if you are powering from 5V the display logic level is still 3.3V - do not connect directly to UNO/MEGA/etc GPIO pins which use 5V logic - use level converters

I supply power from 5V, but I used 10K resistors according to this schematic

P.S. that’s not a schematic.
It’s a sort of hybrid block/wiring diagram which is a level higher than a schematic

It doesn’t communicate the same information.

Close, but no prize.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.