1.8 tft spi lcd st7735

I am working with a cheap Chinese TFT display. I wish to thank those who wrote, hacked, and posted comments about this particular device because it made my job a lot easier.

While the code is successful and the display works I am not happy about the write speed (refresh). Just posting some text and then erasing and writting over always produces a noticeable “blink” of the screen. I am not blanking the entire display but just overwriting with new text. It also seems that no matter what I set the clock speed at it always run through this demo at the same speed. So my guess is that I have something wrong!

Any suggestions or are these displays just that slow?

Rich V.

@rvisokey, can you say which library you are using an post your application code for us to look at?

1 Like

Of course. I am using the Adafruit library for the ST7735 and the Adafruit graphics library. I am unable to past the code below as it’s too long but I can provide a web link to a txt file. As I have a blacktab TFT I removed a lot of the code for the green and red tab versions.




@rvisokey, few things:

  1. The max SPI speed of the ST7735 seems to be 15MHz (if not lower) not 60MHz.
  2. Consider replacing the digitalWrite() for pinSetFast()/pinResetFast() in time critical SPI code.

I am looking into the ST7735 data transfer modes (bulk data xfer).

Just replacing digitalWrite() with pinSetFast/pinResetFast() made an incredible difference. I went from 30 seconds to run the demo I have to 15 seconds. I never knew digitalWrite() had such high overhead.



1 Like

@rvisokey, did you reduce the SPI clock speed as well? I contributed the fast I/O code because my analysis showed digitalWrite() took about 2us to execute with all the checking it does. The fast I/O write, on the other hand, does not checking (assuming the programmer knows what they are doing) and takes about 40ns. With SPI libraries, this can make a big difference when a lot of single bytes are written. :smile:

I set it at: SPI.setClockSpeed(15, MHZ);


1 Like