Go Down

Topic: Fast ST7735R SPI rendering via Uno. (Read 381 times) previous topic - next topic

rowboteer

#15
Jul 04, 2015, 03:10 pm Last Edit: Jul 04, 2015, 03:12 pm by rowboteer
I'm currently working with a display and using it's 8-bit parallel interface.

I think you will be quite disappointed at the performance with an 8 bit interface. The good point about SPI is the data is sent in the"background" after a single write instruction, so the processor can go and do something else instead of waiting. This is how the PDQ_GFX library gets such good line plotting performance, an 8 bit parallel version will not get the same performance here.

Most 8 bit display shields for the UNO split the byte across two AVR 8 bit ports so then performance really drops due to the byte manipulation required, the UNO only has one complete 8 bit port mapped to the I/O pins and two of those pins are inconveniently the serial Tx+Rx...

The way to go to get better than SPI performance with an AVR processor is a 16 bit interface on a Mega, then the screen can be cleared or rectangles filled at 2Mega pixels per second (setup 16 bit colour on the ports and then toggle write strobe in a fast loop).

jboyton

I think you will be quite disappointed at the performance with an 8 bit interface.
I understand what you're saying. The parallel interface I have requires three processor cycles per write whereas an SPI write is only one. The clear screen is kind of a special case. But in general I'm only getting better performance because I haven't fully optimized my display code.

It's a moot point. Although this controller (ST7565) has a native SPI interface mode, the display manufacturer decided, for some unknown reason, not to expose the pin that allows selection of SPI mode. It's particularly annoying since there is an unused pin in the FFC cable. Regardless, I am forced to use 8-bit parallel. I could add an external shift register to save pins. To get SPI performance would require additional logic.

I wish I could find a display like this that has an (available) SPI interface.

david_prentice

#17
Jul 08, 2015, 05:13 pm Last Edit: Jul 08, 2015, 05:18 pm by david_prentice
I really would not worry too much about the smaller TFT displays.     Just make the best use of your compiler.  e.g. use inline functions or macros.

The theoretical best speeds can be obtained with USART_MSPI for serial and "whole port" for 8-bit or 16-bit parallel.    Obviously you can only get whole ports with a PROMINI or MEGA2560.     Most displays want to run at 3.3V so you need level shifters for 5V 16MHz operation.    Mind you,   most mega328p will run at 3.3V and 16MHz quite happily.

Look at the Adafruit libraries.    They tend to be well written.

The UNO needs a split port for 8-bit.    Hence SPI is a realistic competitor for speed.
The MEGA2560 has been carefully designed to prevent you using USART_MSPI on any of its 4 usarts.

David.

jboyton

The UNO needs a split port for 8-bit.
Not if you aren't using the UART in the sketch.

Go Up