adafruit / Adafruit_ILI9341

Library for Adafruit ILI9341 displays
406 stars 281 forks source link

Latest update (1.3.1) causes artifacts on display #42

Closed merdok closed 5 years ago

merdok commented 5 years ago

Hi,

with the latest update 1.3.1 the display will get artifacts (text are not readable anymore and don't update) after around 10/15 minutes of run time. After downgrading back to 1.2.0 everything is fine again. Could you please fix that? My setup: ESP32 + 2.4 Touchscreen (ILI9341, XPT2046)

PaintYourDragon commented 5 years ago

Was Adafruit_GFX updated as well, or just the ILI9341 library?

PaintYourDragon commented 5 years ago

Also, hardware SPI, or bitbanging?

merdok commented 5 years ago

Yes, Adafruit_GFX was also updated. But with the latest Adafruit_GFX and Adafruit_ILI9341 1.2.0 it is working. When i update Adafruit_ILI9341 to 1.3.1 then the issue starts to appear.

I suppose hardware SPI... Here is my init method: Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

PaintYourDragon commented 5 years ago

Haven't been able to reproduce the problem yet…been running overnight without glitching. In order to help track down the cause of what you're seeing, here's some things to try...

merdok commented 5 years ago

I have attached some pictures so you can see what is happening. The first picture shows how it should look like at all times. The clock in the middle updates every second, the values above and below the clock update every 60 seconds. On picture 2 you can see the glitching. I marked all the sections with blue lines and numbers:

Picture 3 shows what happens after the screen starts to glitch and i do a soft reboot(without pulling the power plug). The complete screen is suddenly missing most of the text, only the text which is overlapping in picture 2 is still present for some reason.

And here is the code which i use to write the text

    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);
    tft.setTextSize(1);
    tft.print("Temperature: ");
    tft.setTextSize(1);
    tft.print(temp_value);

I hope that i could explain it more detailed :) And again (this is very important here) all of this is not happening with version 1.2.0 of this library, ONLY with 1.3.1!

1 2 1 3

Loimulohi commented 5 years ago

I have same problem as merdok. Using Adafruit_ILI9341 v1.3.1 is causing artifacts on screen and sometimes screen is completely white and flickering and stays that way. Usually this happens few seconds after power on but sometimes it takes couple of minutes to happen.

I don't have any problems using ILI9341 v1.2.0 and GFX v1.3.2. I have not tried latest GFX and ILI9341 v1.2.0 is that combination working or not.

Using custom made ESP32 board and 2.8" TFT.

PaintYourDragon commented 5 years ago

Please try GFX v1.4.4 and let me know if that clears it up. Thanks!

Loimulohi commented 5 years ago

I have updated to GFX v1.4.6 and ILI9341 v1.3.4 and no glitches for 15 hours so far, so it seems to be working! Thank you very much!

merdok commented 5 years ago

@PaintYourDragon Tried it today with GFX v1.4.7 and ILI9341 v1.3.4 and the issue is still there. As soon as i downgrade back the ILI9341 library to 1.2.0 and leave GFX at v1.4.7, everything is working again.

edit: GFX at v1.4.7 and ILI9341 at 1.2.0 also has the issue, so i guess this is a GFX library issue?

PaintYourDragon commented 5 years ago

@merdok An earlier message suggested the problem started with ILI9341 version 1.3.1. Is that not the case…is it actually a specific GFX release where the issue starts to appear?

merdok commented 5 years ago

Doing some testing now to find out the specific versions of the packages. Tried with GFX v1.3.0 and ILI9341 v1.2.0 and everything is working fine. Will be going slowly up to and see at what version the issue will appear.

merdok commented 5 years ago

Ok, did a lot of tests today and i can confirm once again that this issue is related to the ILI9341 library. I installed the ILI9341 1.2.0 and after that i tested it with GFX library from 1.3.0 to 1.4.7 and everything was working fine. Then i tested ILI9341 1.3.1 and GFX 1.4.7 and after a few minutes the issues appeared. So some of the changes which was made in 1.3.1 of the ILI9341 library is breaking it. This has nothing to do with the GFX library.

So with any version of ILI9341 library since 1.3.1 the artifacts starts to appear. No matter which GFX library version!

PaintYourDragon commented 5 years ago

This is strange…the few changes at v1.3.1 should apply only to the ESP8266.

There was some stuff that changed in 1.3.0 that might be important though. Try changing the display’s begin() call by passing 40000000 (40 MHz) as an argument, e.g. tft.begin(40000000);

merdok commented 5 years ago

I have tried it with tft.begin(40000000); and it seems to work now. It is running for a few hours now and the issue did not appear! I guess that the default values are messed up since version 1.3.1. Could you please fix that?

PaintYourDragon commented 5 years ago

"Classic" default SPI speed behavior has been restored in v1.3.6; should work as before now.

merdok commented 5 years ago

Thanks for the fix! Can confirm that with version 1.3.6 everything works again!

PaintYourDragon commented 5 years ago

Yay! Good to hear.

Curious though: are any of your sensors interfaced via SPI, and do they take readings during an interrupt, like a timer or data-ready signal?

merdok commented 5 years ago

I have a BME680 connected over I2C and i read out the sensor every 60 seconds using the Adafruit_BME680 library.

Loimulohi commented 5 years ago

I have BME280, EEPROM, DS3231 and LM75A connected to I2C bus and four DS18B20 1-wire temperature sensors and SD Card connected to SPI bus.