Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

Optimizing SPI TFT displays for Teensy 3.1

SPI driven TFT LCDs are common way of getting graphical interface on Arduino based hardware. From Arduino perspective you just grab one of existing library like Adafruit’s TFT LCD library and with few lines of code you can get your graphics on screen. But the problem is that library is meant to be used on Arduino boards like UNO that are limited in resources like speed and memory. SO using same library on boards like Teensy 3.1 is loosing its potential.

Paul Stoffregen took this library and adapted it for Teensy 3.1 to use its benefits in order to gain much better performance. Teensy 3.1 is ARM based 32 bit board, so there are plenty ways to improve things. First of all he took advantage of SPI speed. If Arduino can drive SPI at 8MHz, Teensy 3.1 can go up to 24MHz. Another improvement is 4 level FIFO buffer in Teensy 3.1 SPI port. So software don’t have to wait until transmit is complete before sending another byte. In other words, software can write byte to SPI while it is transmitting. Other SPI tricks like combined 16bit transfers help to reduce idle time between transfers. Continuing on SPI another advantage is that SPI on Teensy 3.1 support up to 5 CS (Chip Select) lines. On Arduino CS signal had to be set manually by manipulating GPIO. There are other slight modifications to draw algorithms that give some of the kick to overall performance. The resulting difference is clearly seen on video above where improved library beats original several times. To give it a try, visit his GitHub resources.

[..Source link..]

Bookmark the permalink.

Comments are closed.