How to speed up 2,2" TFT Display?

Hi everyone!

I need help to get my Displays faster, hope some of you have advice for me.

I use following hardware: Arduino Mega 2560, MPU6050 acceleration sensor, two 2,2" 320x240 QVGA TFT SPI Displays.

Whe i tried to get the Displays working, i tried with a few libs. The only one which worked was the Adafruit ILI9340. So everything was fine. But now i have a faster singnal (accelerations and angles from MPU6050) and when redrawing the screen it flickers and don't runs smooth (it takes about 185 milliseconds to redraw).

Therefore i tried some optimized libs, without sucsess:

ILI9341_t3-master -> says I am using Teensy and its not compatible for my hardware

TFT_ILI93XX-master -> works, but always a grey rectangle in the background. Don't seems to be faster.

PDQ_ILI9340 -> Display stays white

PDQ_ILI9341 -> Display stays white

and all other from the PDQ_GFX_Libs-master collection with the same result.

I can't understand why PDQ_ILI9340 is not working. And there is another important question: How can you use two displays with this lib? With Adafruit it's easy, because you initialize the object with the pins, but here you have a seperate file.

You can find my two sketches attached.

Hope you can help me, or someone maybe has another idea.

Thanks in advance and nice evening!

MPU_mit_TFT_ADF.ino (21.1 KB)

MPU_mit_TFT_PDQ.ino (21 KB)

PDQ_ILI9340_config.h (2.37 KB)

I briefly look through your code, and saw a lot of print() and chart. Of course, if you trying to update all those data simultaneously it'd take time. Any uCPU wold be slow, except GPU specially designed to run graphics with high speed.

But the truth is you don't have to update all fields at once. Split each field (digital box) into separate digits, and update one digit at a time. And update digit ONLY if new value is different that is already drawn last time.
Map all positions, draw black rectangular at digit that gonna be updated , redraw new one, and keep a counter for current field. Two counters probably, one to track current digital box, and another to track current digit in the specific box.
Doing so, you can increase "refrash" rate up to 25-40 frame per seconds, just measure how long does it takes to redraw one digit.
Image would fly.

Hello,

thanks for the hints. I reworked my sketch und splittet the print-functions in a static and rewrite part. I just rewrite what is necessary. This leads to following improvements:

  if (BC_Left == 1)
  {
    AusgabeBC_Acc_rewrite(tftLeft); // about 120 milliseconds (35 ms faster) -> OK
  }
  else if (BC_Left == 2)
  {
    AusgabeBC_AccGraph_rewrite(tftLeft); // about 155 milliseconds (130 ms faster) -> you still see flickering, when making the old value black
  }
  else if (BC_Left == 3)
  {
    AusgabeBC_Winkel_rewrite(tftLeft); // about 80 milliseconds (30 ms faster) -> OK
  }
  else if (BC_Left == 4)
  {
    AusgabeBC_WinkelGraph_rewrite(tftLeft); // about 180 milliseconds (not faster) -> too long, flickers extremly
  }

Its impressing, how this can speed up, but it is not enough. Refreshing text works fine, but the problem are the graphs (lines an triangles), especially in the for-loops. You can see, when the old value is printed black and the new value white again - it flickers extremly and is too slow for rapid changing accelerations.

Any other suggestions? Any advice getting the PDQ-lib working (for two displays)?

Thanks!

MPU_mit_TFT_ADF_V2.ino (22.4 KB)