Display is not working [ILI9341]

Hello, I recently bought a display:
https://pl.aliexpress.com/item/1005003943508410.html?spm=a2g0o.order_list.order_list_main.11.26ae1c24AU2sa6&gatewayAdapt=glo2pol

touchscreen and connected it to Arduino Uno as shown in the official instructions:
image
image

and I recorded their code:

// IMPORTANT: LCDWIKI_SPI LIBRARY MUST BE SPECIFICALLY
// CONFIGURED FOR EITHER THE TFT SHIELD OR THE BREAKOUT BOARD.

//This program is a demo of displaying string

//when using the BREAKOUT BOARD only and using these hardware spi lines to the LCD,
//the SDA pin and SCK pin is defined by the system and can't be modified.
//if you don't need to control the LED pin,you can set it to 3.3V and set the pin definition to -1.
//other pins can be defined by youself,for example
//pin usage as follow:
//             CS  DC/RS  RESET  SDI/MOSI  SDO/MISO  SCK  LED    VCC     GND    
//Arduino Uno  A5   A3     A4      11        12      13   A0   5V/3.3V   GND

//Remember to set the pins to suit your display module!

/***********************************************************************************
* @attention
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT, QD electronic SHALL NOT BE HELD LIABLE FOR ANYA
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
**********************************************************************************/
#include <LCDWIKI_GUI.h> //Core graphics library
#include <LCDWIKI_SPI.h> //Hardware-specific library

//paramters define
#define MODEL ILI9341
#define CS    A5    
#define CD    A3
#define RST   A4
#define MOSI  11
#define MISO  12
#define SCK   13
#define LED   A0   //if you don't need to control the LED pin,you should set it to -1 and set it to 3.3V

//the definiens of software spi mode as follow:
//if the IC model is known or the modules is unreadable,you can use this constructed function
LCDWIKI_SPI mylcd(MODEL,CS,CD,MISO,MOSI,RST,SCK,LED); //model,cs,dc,miso,mosi,reset,sck,led
//if the IC model is not known and the modules is readable,you can use this constructed function
//LCDWIKI_SPI mylcd(240,320,CS,CD,MISO,MOSI,RST,SCK,LED); //width,height,cs,dc,miso,mosi,reset,sck,led

//define some colour values
#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

void setup() 
{
  mylcd.Init_LCD();
  mylcd.Fill_Screen(BLACK);
}

void loop() 
{
  mylcd.Set_Text_Mode(0);
  //display 1 times string
  mylcd.Fill_Screen(0x0000);
  mylcd.Set_Text_colour(RED);
  mylcd.Set_Text_Back_colour(BLACK);
  mylcd.Set_Text_Size(1);
  mylcd.Print_String("Hello World!", 0, 0);
  mylcd.Print_Number_Float(01234.56789, 2, 0, 8, '.', 0, ' ');  
  mylcd.Print_Number_Int(0xDEADBEF, 0, 16, 0, ' ',16);
  //mylcd.Print_String("DEADBEF", 0, 16);

  //display 2 times string
  mylcd.Set_Text_colour(GREEN);
  mylcd.Set_Text_Size(2);
  mylcd.Print_String("Hello World!", 0, 40);
  mylcd.Print_Number_Float(01234.56789, 2, 0, 56, '.', 0, ' ');  
  mylcd.Print_Number_Int(0xDEADBEF, 0, 72, 0, ' ',16);
  //mylcd.Print_String("DEADBEEF", 0, 72);

  //display 3 times string
  mylcd.Set_Text_colour(BLUE);
  mylcd.Set_Text_Size(3);
  mylcd.Print_String("Hello World!", 0, 104);
  mylcd.Print_Number_Float(01234.56789, 2, 0, 128, '.', 0, ' ');  
  mylcd.Print_Number_Int(0xDEADBEF, 0, 152, 0, ' ',16);
 // mylcd.Print_String("DEADBEEF", 0, 152);

  //display 4 times string
  mylcd.Set_Text_colour(WHITE);
  mylcd.Set_Text_Size(4);
  mylcd.Print_String("Hello!", 0, 192);

  //display 5 times string
  mylcd.Set_Text_colour(YELLOW);
  mylcd.Set_Text_Size(5);
  mylcd.Print_String("Hello!", 0, 224);

  //display 6 times string
  mylcd.Set_Text_colour(RED);
  mylcd.Set_Text_Size(6);
  mylcd.Print_String("Hello!", 0, 266);

  delay(3000);
}

but it keeps showing me white and nothing happens
do you know what the problem might be?

I have no experience of the board or the library bit did you take note of

// IMPORTANT: LCDWIKI_SPI LIBRARY MUST BE SPECIFICALLY
// CONFIGURED FOR EITHER THE TFT SHIELD OR THE BREAKOUT BOARD.

and make any necessary changes ?

1 Like

I don't use any separation plate so I connected it as it is in the code

here:
image

The pin numbering on the screen does not appear to correspond with your document in post #1. For example, the document states that Vcc is screen pin 9. On your breadboard setup the red wire goes to pin 1 which also appears to correspond with the pictures in the vendor link. I have what appears to be a similar screen to yours but th 2.8" version. I had to connect a 10k resistor between screen pins Vcc and Reset to get it to work. I also use Adafruit's ILI9341 libraries with mine.

see I connected it like this:

image
image

And I uploaded this code:

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ILI9341.h> // Hardware-specific library for ILI9341
#include <Adafruit_ST7789.h>  // Hardware-specific library for ST7789

// Definicje pinów (dostosuj je do swojego połączenia)
#define TFT_CS 10
#define TFT_RST 9
#define TFT_DC 8

// Wybierz jeden z poniższych ekranów do testu, zakomentuj pozostałe
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);  // jeśli używasz ILI9341
//Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);   // jeśli używasz ST7789

void setup() {
  Serial.begin(9600);
  tft.begin();
  tft.fillScreen(ILI9341_BLACK); // dla ST7789 można użyć ST7789_BLACK

  // Sprawdzenie czy ekran działa
  tft.setCursor(0, 0);
  tft.setTextColor(ILI9341_WHITE);  // dla ST7789 można użyć ST7789_WHITE
  tft.setTextSize(2);
  tft.println("Testowanie wyswietlacza!");

  Serial.println("Test zakończony.");
}

void loop() {

}

And it only shows me when I press the reset button

Did you try this:

it's stil not working

What happens if you connect the resistor as I said but disconnect the wire between the screen reset pin and the Uno pin 9. This is also used for savinģ one Uno pin.
When you said this, did you mean you saw your text on the screen when you pressed a reset button?

Very strange but it does appear that the text is getting somehow from the Uno to the screen. It is just not visible until a reset of the Uno.

Just some things to try because I cannot understand what is happening:

  1. Power the screen backlight (LED) from 3.3 volts instead of 5v
  2. Change the colour of the text you write to the screen (neither black nor white)
  3. Write a HIGH to pin 10 at the end of setup() :
    digitalWrite( TFT_CS, HIGH ) ;
  4. Comment out this: #include <Adafruit_ST7789.h>

Otherwise make a table of screen connections to Uno pins because the picture is not clear enough for all connections. Add that to this thread.

Have you tried setting D9 (TFT_RST) as OUTPUT and HIGH before calling begin()?

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