2.8" TFT touchscreen + Teensy 3.0

Not open for further replies.
Yes, sort of. I'm using an older version, that's been modified to work with Teensy 3, Teensy 2++, and I macheted in support for the ILI9341 driver before Adafruit did on their version.

They are not using the current library, as you guessed. I tried patching pin_magic.h with the teensy 3 mods, but more is required for the current TFTLCD library. The library now supports DUE, and the constructor does a lot of work mapping the control pins into port register access for set/clear operations. Maybe the teensy equivalent would be to use
portSetRegister(pin) and portClearRegister(pin), or just digitalWrite() ?

Has someone already done this?
Last edited:
For the hacked together version I've been using and testing on a 3.1, the __AVR__ style of pin/port mapping from the new library seems to be what I've been using. csPort = portOutputRegister(digitalPinToPort(cs)); etc
OK, I got teensy 3.0 and 3.1 working with current Adafruit libraries. For teensy 3.1, I had to add delayMicroseconds(1) to read8inline so it looks like
#define read8inline(d) { RD_ACTIVE; delayMicroseconds(1); d = GPIOD_PDIR; RD_IDLE;}
Here are graphicstest times
 teensy 3.0  96mhz
      TFT LCD test
      Using Adafruit 2.8" TFT Breakout Board Pinout
      Found ILI9328 LCD driver
      Benchmark                Time (microseconds)
      Screen fill              295919
      Text                     35533
      Lines                    719936   total time
      Horiz/Vert Lines         30875
      Rectangles (outline)     21577
      Rectangles (filled)      734834
      Circles (filled)         222147
      Circles (outline)        76280
      Triangles (outline)      57157
      Triangles (filled)       299737
      Rounded rects (outline)  40465
      Rounded rects (filled)   833481

 teensy 3.1 @ 96mhz
      Benchmark                Time (microseconds)
      Screen fill              210555
      Text                     25952
      Lines                    598607
      Horiz/Vert Lines         20019
      Rectangles (outline)     14406
      Rectangles (filled)      459568
      Circles (filled)         167211
      Circles (outline)        64348
      Triangles (outline)      47564
      Triangles (filled)       203945
      Rounded rects (outline)  31232
      Rounded rects (filled)   531085
I tried 168mhz on teensy 3.1, but output had some gibberish and it eventually hung in Circles test ?? Lines at 168mhz was 363296us.

And I measured 32.7ma at 3.3v for the TFTLCD, so I powered it from the teensy 3 3.3v pin. This is on older Adafruit TFTLCD, http://www.adafruit.com/products/335

The Lines results (testLines in .cpp) is the total line drawing time. The graphicstest sketch had a bug (in my opinion) that only reported the time for the last test sequence, instead of the sum of all four line drawing sequences, so I corrected the return value to reflect the total time.

For comparison, here are Lines results (us == microseconds) for
DUE @84mhz   1728104 us
maple @72mhz 8069394 us  (my hack of 2012 lib)
UNO @16mhz   4316544 us

Paul has performance results for SPI-based TFTLCD here
(Lines results probably needs to be multiplied by 4, 4*245785 = 983140us )
Last edited:
Can someone please tell me where people are sharing their modifications for the TFTLCD library? On GitHub, or just with ad-hoc patches to this forum?
Well, this is awkward. I had a 2.8" ILI9325 screen from Adafruit working on a Teensy 3.0 a couple of years back. I just tried to rebuild the code for that and I seem to have lost some files. Specifically I'm looking for the right Adafruit_TFTLCD library (well, I think that's all I'm looking for). The current library from Github doesn't compile with a Teensy3, and I recall I had to edit the pin_magic file as per ZTiK.nl (earlier in this thread). But the later files from Github look different now. I don't seem to be able to go back to an earlier branch on Github.
I can see Paul has posted an ILI9341_t3 library, but mine is an ILI9325. Has anyone got a working copy of the library that works with my combination posted somewhere? I'd rather not upgrade the hardware at this stage, the problem I have is software.
Not open for further replies.