I have an ESP32 running in Arduino IDE. I own a small 128x128 TFT ILI9163 display (Exactly like this one) connected through SPI.
I was wondering about the speed at which one can reasonably expect to refresh the whole screen.
I wrote a small demo that fills the screen memory with a solid color, waits 100ms, and redraws with another - in a loop. Here is the result: Tft display flickering - YouTube
As you can see the screen updates, but is redrawn not instantly which causes like a horizontal line that goes from bottom to top. What causes that?
In that example, I tried various libraries, etc. and they all produced the same result. I rewrote the driver myself, just to basic minimum, but it produces the result in the video. When I measure millis() before and after the method for sending the data via SPI, it says 10ms, which would mean it's as good as 100FPS, so why can I see that updating screen from top to bottom?
Does it have to do with the speed of SPI itself? I mean its 16bpp 128x128 area, so about 32kb. How fast can SPI send data to the device's memory? I tried playing with different SPI frequencies, but it always creates that effect, just slows down its duration.
I also tried my Arduino Mega board, and it's exactly the same. I mean the drawing routine is slower, obviously, but the effect of drawing the screen top to bottom is still there.
I know there exist different strategies for optimizing the display procedure (eg. double buffering, for which ESP32 has enough RAM, redrawing only changed pixels, etc.), but I am wondering about the feasibility of having somewhat acceptable FPS during a video playback or some basic game emulation.
I've seen NES and DOOM clones runing somewhat smoothly, how can they achieve that using SPI screens?