occasional issues with 3.2" touch lcd (TFT_320QVT)

I am working with an Arduino mega 2560 r3 with a TFT_320QVT screen and using a tft lcd mega shield v2.2. Also I am using a 8 relay board with this setup. As far as software I am using the "pixels" not the usual "UTFT". I am using a 120Vac to 5Vdc power supply that is capable of pushing out 10A.

Now I have been through a lot of forums about the screen and issues that people have had and I have tried to apply the responses to my application. None have been a solution for the problems.

The menu screen I have created consist of 6 touch screen buttons, 4 select relays, 1 turns off all relays and 1 allows you to access the next menu screen. When a button is pressed the screen displays a red border around the button. This is only while the button being pressed.

Now my first problem is if you press the buttons a lot or jump between the buttons fast, sometimes the red will show up in undesired places and it will sometimes make the text look smeared across the screen. These unwanted lines and colored pixels do go away after the screen redraw, either for the screen saver after 15 seconds or the selection of the next menu screen. The functionality of the screen never changes though. You can still select the buttons as normal just the display has the random red smeared with the smeared text.

The second issue is more severe. The screen seems to be provoked in the same manner however the screen errors in a couple different ways. It either just makes all lines across the screen, turns the screen completely white, or lastly it will invert the display. When this happens the screen will keep the functionality of the buttons but does NOT get fixed from either redraw or selecting the next menu screen. The only way to get the screen back to normal is to remove power from the unit and then it will go back to normal once power is reapplied.

I have tried to be as informative about the setup and issues. Please let me know if you have any more questions.

I would like to thank everyone who spends any of their time reading through this topic and/or has any input for me.

A few things that have been tried to mitigate the problem are:

The power supply has just a red and black (positive and negative) that go to the arduino. I have added a ground from the USB type B to a chassis.

Have tried better cabling between the boards.

Relays have been set to normally high and normally low. (Thinking to lower what the processor has to think of.)

The way the screen is mounted to the metal face-plate. I 3D printed a bezel to act as a insulator from the screen to the face-plate but it didn't change anything ( and yes I realize that the screen is not capacitive touch, I was thinking more towards covering the solder points on the screen).

Now my first problem is if you press the buttons a lot or jump between the buttons fast, sometimes the red will show up in undesired places and it will sometimes make the text look smeared across the screen. These unwanted lines and colored pixels do go away after the screen redraw, either for the screen saver after 15 seconds or the selection of the next menu screen. The functionality of the screen never changes though. You can still select the buttons as normal just the display has the random red smeared with the smeared text.

It looks as a Loop() button selection problem.

Have you tried to emulate "single button press"?

Something like

byte ButtonPress;
ButtonPresss = digitalRead(button pinx); // normally reads button

ButtonPress = 1; // emulate button press

if(ButtonPress)
{
...check the LCD... run single verifiable process - is is OK?

for(semicolon semicolon) semicolon // force stop processing
}

Vaclav thank you very much for the info. I will give that a try and see if it will still give me any issues or not.

So to you it sounds like a code issue? I was kinda hoping it would be code because the physical side should theoretically be operating properly. Not that I want a code issue but I was starting to go crazy with thinking what could be hooked up wrong.

ElecEngSteve:
Vaclav thank you very much for the info. I will give that a try and see if it will still give me any issues or not.

So to you it sounds like a code issue? I was kinda hoping it would be code because the physical side should theoretically be operating properly. Not that I want a code issue but I was starting to go crazy with thinking what could be hooked up wrong.

Yes, hooking up 20 plus wires one can go blind. Ha Ha

If it makes you feel better - I have a similar issue.
I finally got the class initialized and hoping to see some background color next.
The "problem" is there is no feedback from the LCD so I really do not have a clue if it is initialized.
So I'll have to go thru at least one command / data and verify the hardware / pins levels.
I was hoping for some feedback (command) for each write, but I guess I have to read the actual register state.
Fun.