Arduino Mega with ILI9341 3.2" TFT shows artifacts, help!

Hello everyone!

I am trying to build an aquarium controller based on the Jarduino project.
To spare you all the unneccessary details:
After using the screen and the arduino fo a few days, loading the modified codes, I started to get screen glitches.
(So, for a few days, this whole setup was working glitch free, exactly as I intended).
In the images attached you can see the glitches happening.
To sum up:

Materials used:
-Arduino Mega 2560
-ITDB02 v1.1 shield
-3.2" TFT from ebay with ILI9341 (16 bit parallel mode is used)
The TFT is plugged in directly into the ITDB02 shield, which is plugged in directly into the Mega.

Codes used:
-First, the Jarduino code, which gave me the glitches after a few days
-Then the examples provided by the UTFT library.

To get the ILI9341 to work, I had to mod the UTFT library, because as of now it does not support ILI9341 in 16 bit parallel mode. However, there are many threads with the solution to this. You need to modify UTFT.cpp so that the resolution of the ILI9327 entry becomes 240x320. Apart from the resolution the ILI9341 and ILI9327 work identically, or so Ive been told.

The strange part is that, once I got these glitches, they disappeared sometimes after restarting, or after having the screen glitch out for a good half hour. So it is really random when the glitches appear, but once they appear they stay on for quite some time.

Solutions tried:
-Different TFT screen
-Resoldering the ITDB02 v1.1
-Checking the ITDB02 v1.1 contacts with multimeter
-USB power
-External 9V power (yes enough amps available for the mega)
-Different library
-Clearing EEPROM

None of these solutions worked. Right now my best guess is my Arduino is broken.
However, the IDE gives no errors, and all the other sketches such as blink or the SD library work just fine.

I have already ordered a new Arduino as a sort of final solution, but do you guys know what causes these glitches? And how to fix it?

Many thanks!

ps the example sketch I used, the modded UTFT.cpp, and a few pictures of the problem are included. The colored stripes are supposed to showcase squares in different colors, but are glitching instead.

Pps. In the example sketch, I replaced

UTFT myGLCD(ITDB32S,38,39,40,41);

by

UTFT myGLCD(ILI9327,38,39,40,41);

because you need to choose your type of screen.

UTFT_Demo_320x240.ino (7.32 KB)

IMG_20160405_164445.jpg

IMG_20160405_164430.jpg

IMG_20160405_164426.jpg

UTFT.cpp (27.5 KB)

Sorry, I don't know what causes the glitches, especially as it runs just fine for, what? Some days? before the artifacts appear?

Could be overheating of a component.

Could be memory leakage in the code (not necessarily yours, in the LCD driver) causing display corruption.

Does unplugging and replugging it into the power source (not USB/PC) clear the glitches?

Does pressing the reset button on the Arduino clear the glitches?

Dear Ralph

It worked fine for a few days, then the glitches appeared.
Since that moment, the glitches are there 90% of the time.

I do not think it is overheating, since removing power for a day and turning it back on still shows glitches
However, sometimes after a few minutes the glitches disappear, only to come back after a few minutes

Unplugging/replugging does not clear the glitches but it sometimes changes the severety of the glitches.
Pressing the reset button has the same effect: Sometimes the glitches are less severe with even a few readable characters on screen, sometimes the whole screen stayes white, sometimes it looks like the images I included.

I will look into the memory leakage you mentioned.

The example sketch from the UTFT library displays circles and squares, which some runs look fine, some runs they are not distinquishable at all, and some runs only the yellow square shows, and some runs the squares have a few black lines going through them.

I am still not sure what causes this but I hope using another arduino will solve the problem. Sucks though since this one is only a few weeks old.

Mmm. Sounds ominous.

Did the example sketch also work correctly in the beginning? If so, (and now it doesn't) then it does sound a bit like component failure.

That said, I must have tried half a dozen libraries to get my TFT working satisfactorily, some gave me partial results some just gave me junk on the display.

You say you modified (or took a modified version) of a library - is there something going on in there perhaps (but which still doesn't explain how it all worked for several days, glitch-free, unless it is doing something to your TFT that is outside of its specification).

Is the voltage to the TFT correct (eg it expects and gets the 3.3V or 5V or whatever), tested by you on the relevant pins?

Is the soldering (probably originally done by some 9-year child in the Far East, no offense intended) up to scratch? Perhaps a fine soldering iron and a magnifying glass to go over all the joints may elicit success (I fixed a portable TV once by doing this, I was well-chuffed).

Finally you could purchase another, identical one to see if the problem persists (or returns). Or buy a better-supported TFT, that is, with a library that everyone else is using. And controlled by SPI or even slow old I2C rather than umpteen wires directly from the Arduino.

Or, depending on what it is you are displaying, abandon the TFT for a reliable 20 x 4 LCD. Yes, a bit rad I know.I'm just going through all the things I would try before admitting it was a component failure.

Use TFTLCDcyg's modified library.

It is crazy to use "unknown" controller models with UTFT. I would guess that TFTLCDcyg has got correct initialisation for the ILI9341. And it should run glitch-free for weeks on end.

At least you are using a proper Adapter shield. This should give you good electrical connections. I am not so happy with the mechanical robustness.

David.

hell

Voyagerscout:
Hello everyone!

I am trying to build an aquarium controller based on the Jarduino project.
To spare you all the unneccessary details:
After using the screen and the arduino fo a few days, loading the modified codes, I started to get screen glitches.
(So, for a few days, this whole setup was working glitch free, exactly as I intended).
In the images attached you can see the glitches happening.
To sum up:

Materials used:
-Arduino Mega 2560
-ITDB02 v1.1 shield
-3.2" TFT from ebay with ILI9341 (16 bit parallel mode is used)
The TFT is plugged in directly into the ITDB02 shield, which is plugged in directly into the Mega.

Codes used:
-First, the Jarduino code, which gave me the glitches after a few days
-Then the examples provided by the UTFT library.

To get the ILI9341 to work, I had to mod the UTFT library, because as of now it does not support ILI9341 in 16 bit parallel mode. However, there are many threads with the solution to this. You need to modify UTFT.cpp so that the resolution of the ILI9327 entry becomes 240x320. Apart from the resolution the ILI9341 and ILI9327 work identically, or so Ive been told.

The strange part is that, once I got these glitches, they disappeared sometimes after restarting, or after having the screen glitch out for a good half hour. So it is really random when the glitches appear, but once they appear they stay on for quite some time.

Solutions tried:
-Different TFT screen
-Resoldering the ITDB02 v1.1
-Checking the ITDB02 v1.1 contacts with multimeter
-USB power
-External 9V power (yes enough amps available for the mega)
-Different library
-Clearing EEPROM

None of these solutions worked. Right now my best guess is my Arduino is broken.
However, the IDE gives no errors, and all the other sketches such as blink or the SD library work just fine.

I have already ordered a new Arduino as a sort of final solution, but do you guys know what causes these glitches? And how to fix it?

Many thanks!

ps the example sketch I used, the modded UTFT.cpp, and a few pictures of the problem are included. The colored stripes are supposed to showcase squares in different colors, but are glitching instead.

Pps. In the example sketch, I replaced

UTFT myGLCD(ITDB32S,38,39,40,41);

by

UTFT myGLCD(ILI9327,38,39,40,41);

because you need to choose your type of screen.

hello dear

i have the same setup but untill now i do not know to to connect the tft screen to the shield where the tft shield i got is v1.1 and have many pins to be plugged in and the screen pin does not match the shield i duno how you get them both working i will give you the links for the shield and the screen i bought and wish ny one could help me

this is the tft 3.2"

Free shipping! LCD 3.2 inch touch screen TFT LCD color screen module ILI9341 compatible punctuality atom

(from AliExpress Android)

and this is the shield

TFT 3.2 inch Mega Touch LCD Expansion Board Shield - IC partial pressure for arduino Mega 2560 R3
http://s.aliexpress.com/A3Az6zaU
(from AliExpress Android)

Buy a proper ColdTears Adapter shield. This has a 34-pin header. You must check that your display pins match the 34-pins.

Otherwise you will have to hand wire your 34 pins to the 40-pin header on your Adapter shield.

After you have done all of this, you will have to find TFTLCDCyg's modified UTFT library.

Life is a lot simpler if you just buy a Mega2560 Display Shield in the first place.

David.

david_prentice:
Buy a proper ColdTears Adapter shield. This has a 34-pin header. You must check that your display pins match the 34-pins.

Otherwise you will have to hand wire your 34 pins to the 40-pin header on your Adapter shield.

After you have done all of this, you will have to find TFTLCDCyg's modified UTFT library.

Life is a lot simpler if you just buy a Mega2560 Display Shield in the first place.

David.

thank you could you please offer me a link for that shield

Try this Adapter MEGA2560 Shield which has both 32-pin and 40-pin headers.

Most 3.3V Displays use the 40-pin header. Which is why your Adapter only has the 40-pin.
As I said earlier. It is your responsibility to check the 32-pin compatibility.

Since your display has 34-pin and not 32-pin, I am not too hopeful.

David.

david_prentice:
Try this Adapter MEGA2560 Shield which has both 32-pin and 40-pin headers.

Most 3.3V Displays use the 40-pin header. Which is why your Adapter only has the 40-pin.
As I said earlier. It is your responsibility to check the 32-pin compatibility.

Since your display has 34-pin and not 32-pin, I am not too hopeful.

David.

i found that

TFT/SD Shield for Arduino MEGA 2560 LCD Module SD level translation 2.8 3.2 DUE
http://s.aliexpress.com/u6VNRJbY
(from AliExpress Android)

and this is the discription

Description:
The IO of arduino MEGA is officially 5V, TFT LCD use 3.3V IO. This CTE TFT LCD/SD shield for arduino MEGA provides the connection to a TFT LCD Module directly without flying wires.
The shield use TRUE 5v to 3.3V level translation IC, therefore, it is compatible with many TFT LCD modules. Compatibility is highest when compared to ordinary TFT Shield, which use resistors or buffer to "shift" 5V to 3.3V. Compatibility issues may arise when using this method to translate IO level to 3.3V, especially at high write speed.
The Shield fits two type of TFT LCD module's pinout:

  1. 40pin version LCD which is commonly used in previous version of TFT Mega shield for Arduino MEGA 2560
  2. 32pin version LCD which is commonly used in STM32 development board. (unsoldered)
    Packing list:
  3. CTE TFT/SD Shield for Arduino MEGA 2560
  4. 32pin header
    Features:
    True 5V to 3.3V level translation using TI SN74ALVC164245 for LCD data lines, TI SN74LVC4245 for LCD control line and SPI lines
    Highest compatibility. One shield for many types of TFT LCD modules.
    Drive TFT LCD on arduino DUE by just plugging into arduino MEGA 2560 main board, no flying wires.
    Compatible with 40-pin version LCD, which is commonly used in TFT Mega shield
    Also comptabile with 32-pin version LCD, which is commonly used in STM32 development board
    On board SD card slot
    On board SPI flash footprint with adjustable CS selection, for upgrade to include Font IC to draw text to the LCD and also support for SPIFlash library
    On board 1A 3.3V regulator for provide enough current for larger screens
    LCD power 3.3V and 5V selectable through solder jumpers
    LCD Backlight (LEDA+) 3.3V., 5V or PWM selectable through solder jumpers

Yes, before you spend your money, check the 34-pin pin-out of your Display with the 32 pin header socket on the Adapter.

There are Mega Display Shields that do not need any adapters. For about the same cost as the Adapter shield. Some with Touch. Some without Touch.

There are Uno shields that will plug into your Mega2560.

David.