Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

White screen TFT ILI9488

dvalero484

Newbie level 6
Newbie level 6
Joined
Oct 20, 2024
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
99
Good day everyone.


So, I'm working on a project of an automatic irrigation system using Arduino Mega 2560 and RTC DS3231, using an ILI9488 TFT 4 wire SPI communication screen for the interface. So far, everything works perfectly when simulating with Proteus 8 (but since there's no ILI9488, I had to use the ILI9341). The real problem is the physically assembly. Everything's connected, but when I upload the code to the Arduino, all I get is a white screen. I've attached what it actually should display on the screen (from the simulation, of course), and you can also check the connections made:

1735616967555.png


1735618340974.png


I will also attach the part of the code where the screen is set up. The rest of the code is not important. The weird thing is, sometimes when uploading the code, it shows something on the screen for a brief moment, then immediately goes white. It displays what it should, but incompletely, as if it didn't load properly. Sometimes it just shows a weird gray band in different parts of the screen. And other times it shows everything perfectly for a short moment and then goes white. I can't show you this specific problem because it only happens once in a while when uploading the code to the Arduino, and it's only for a few seconds, as I said before.

Code:
#include <ILI9488.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <RTClib.h>
#include <EEPROM.h>
RTC_DS3231 rtc;                 // SDA a pin A4 y SCL a pin A5
#include <FreeDefaultFonts.h>
#define pulsador    3
#define valvula_1    12
#define BLACK   ILI9488_BLACK
#define RED     ILI9488_RED
#define GREEN   ILI9488_GREEN
#define WHITE   ILI9488_WHITE
#define TFT_CS    8     
#define TFT_DC    9
#define TFT_RST   10
#define SD_CS     4
ILI9488 tft = ILI9488(TFT_CS, TFT_DC, TFT_RST);


void setup() {


//Initialize EEPROM for the first time
  if (EEPROM.read(EEPROM_hora_Inicio) != 255 || EEPROM.read(EEPROM_lunes) != 255)
    readEEPROM();
  else
    writeEEPROM();
  // Initialize RTC
  if(!rtc.begin()){
    Serial.println("¡Modulo RTC no encontrado!");
    for(;;); //bucle
    }
     // Set up RTC only if time is not initialized
    if (rtc.lostPower()) {
        Serial.println("Setting up RTC with the compilation time...");
        setRTCTimeFromCompileTime();
    }
  // Initialize TFT
   tft.begin();
   tft.setRotation(1);
   tft.fillScreen(WHITE);
   tft.setTextColor(BLACK,WHITE);
}

.
.
.


I tried also the code examples that come with the ILI9488 library and got the same thing.


Thank you in advance.
 
Last edited:
ILI9488 and ILI9341 have different initialization routines, for testing purposes use the library for the display you have connected, you can change it to ILI9488 when you have one and any other issues have been debugged.

Brian.
 
Hi,

for me .... The display exactly does what your code tells it to do.

Initialize... paint it white .. finished.

Klaus
Hello Klaus.

No, that's only the initialization, I didn't want to put the rest of the code because it's very long. That part of the code I didn't showed is just the interface (colors, fonts, etc) and the different functionalities of the system. Maybe I should've put some more of the code.

As I said before, I tried very simple code examples (the graphictest that comes with the ILI9488 library and one where I paint it blue) and got the same results, white screen.
--- Updated ---

ILI9488 and ILI9341 have different initialization routines, for testing purposes use the library for the display you have connected, you can change it to ILI9488 when you have one and any other issues have been debugged.

Brian.
Hello Brian.

The library I'm using (ILI9488.h) I found it on github. It's based on the library for ILI9341 (as the author stated) so the initialization is very similar in both libraries.
 
Last edited:
No, that's only the initialization,
And something with EEPROM, with RTC and SERIAL ... .. of no use to find the problem. Correct me if I´m wrong.

your shown code just gives a white screen. That´s what it´s supposed to do.
So all the code you show .. seems to work.
--> While you hide that part of code that does not work.

It´s like bringing your brother´s bike to the repair shop while your bike is defective.
We need to see what´s wrong ... we don´t (necessarily) need to see what does work correctly.

Klaus
 
And something with EEPROM, with RTC and SERIAL ... .. of no use to find the problem. Correct me if I´m wrong.

your shown code just gives a white screen. That´s what it´s supposed to do.
So all the code you show .. seems to work.
--> While you hide that part of code that does not work.

It´s like bringing your brother´s bike to the repair shop while your bike is defective.
We need to see what´s wrong ... we don´t (necessarily) need to see what does work correctly.

Klaus
I'll attach the rest of the code in a .txt file (it's very long). By the way, it's in Spanish, so if you don't know Spanish, use the translator, sorry for that:
--- Updated ---

And something with EEPROM, with RTC and SERIAL ... .. of no use to find the problem. Correct me if I´m wrong
By the way, the code is made for the screen to only work if the RTC is connected, I forgot to mention that. But the RTC is working fine.
 

Attachments

  • Programador_de_Riego_ATmega328p.txt
    50.6 KB · Views: 9
Last edited:
Hi

as you see it makes no sense to write a that long code ... without intermediate testing.

Take your code ... copy it (backup) .. then remove everything that is not important for the display to test.

Then step by step [add code and test it]

Klaus
 

LaTeX Commands Quick-Menu:

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top