Display choices/issues 4.1.

grammaton

Member
I want to get started on the Teensy 4.1 I purchased. I get the impression that TFT display choices are somewhat limited/problematic.
I have an ILI3491. It almost works but the screen is off-center and a portion is blank (unless an image scroll effect is used on one particular demo). Having seen this issue over on Arduino (solved issue by using a particular library). It was down to driver issue rather than wiring.

I don't want to spend hundreds on a display.

I am considering just using an Arduino/display shield to handle any graphics and the Teensy for all the synth/midi code (where the bulk of the processing is done. It would have been nice to drive a display from the Teensy though.
 
Sorry, there is not enough information here, to suggest what issues you might be having with your ILI9341.

There are lots of options for displays. I will only mention a few of them, as ones that I have played with and libraries that I have
tinkered with...

With an SPI setup we have:

ILI9341
For example: PJRC sells two sizes of an ILI9341 display:
You can purchase some on EBAY and Amazon with the same pinout.
I also have at least one from Adafruit:

There are at least three libraries that I have played with:
Adafruit_ILI9341 - can install from github or library manager
ILI9341_t3 - Is installed with Teensyduino - faster version
ILI9341_t3n - my version which can install with library manager or Github (https://github.com/KurtE/ILI9341_t3n)
ILI9431_t4 - I have not played as much with, but several use it with LVGL.

ILI9488/86 - Purchased a couple of ones, some from Amazon/Ebay with same pinout as PJRC ILI9341, also some from BuyDisplay.com
library: ILI9488_t3 which is installed by Teensyduino - based on ILI9341_t3n code

ST7735/ST7789 - There are lots of different variations of these. Adafruit sells several, plus lots of others out there.
Libraries: Adafruit... ST7735_t3 installed with Teensduino.

Note: sometimes these can be problematic in that there are several variations and configurations. For example, the ST7789 can handle 320x240 resolution, but there are several displays that are 240x240. So how to they
setup to use the memory within the ST7789. Some might center it, some may start at the beginning of memory, others may end at the end of memory... So with these we often have some form of configuration option, either on constructor or begin/init method to say which donfiguration
this is... But then someone comes out with new configuration... So usually just need to experiment to figure out and maybe add new setting to library.

HX8357 - So far I only know of the ones that are sold by Adafruit.
Libraries: Adafruit, I also have an HX8357_t3n library

RA8875 - Several of these sold by Adafruit and BuyDisplay.
Library: RA8875 installed by Teensyduino...

RA8876 - Buydisplay (probably others out as well)
libraries: https://github.com/wwatson4506/Ra8876LiteTeensy Also maybe other versions as well.

I2C setup
There are many of them... But...

Parallel interface - 8-bit or 16-bit bus

Some of us are playing with some different versions of libraries and hardware. A lot of this is still Work in Progress
And there are other drivers out there as well.

ILI9488/86 - https://github.com/mjs513/ILI948x_t4x_p which also uses: https://github.com/mjs513/Teensy_Parallel_GFX
NT35510 - https://github.com/KurtE/NT35510_t4x_p uses the GFX one above - this is Completely WIP and who knows how far...
RA8876 - https://github.com/wwatson4506/TeensyRA8876-8080 ...

I know that I am missing mentioning other drivers and displays.

If you are interested in some specific display/setup, ask...

As for your current issue with ILI9341 - it would help if you provided information, like which display are you using. Do you have
a link to where to get one. How do you have it wired up? What library you are using? If you had a library that worked on a different
board, which board/library.

Hope this helps
 
Sorry, there is not enough information here, to suggest what issues you might be having with your ILI9341.

There are lots of options for displays. I will only mention a few of them, as ones that I have played with and libraries that I have
tinkered with...

With an SPI setup we have:

ILI9341
For example: PJRC sells two sizes of an ILI9341 display:
You can purchase some on EBAY and Amazon with the same pinout.
I also have at least one from Adafruit:

There are at least three libraries that I have played with:
Adafruit_ILI9341 - can install from github or library manager
ILI9341_t3 - Is installed with Teensyduino - faster version
ILI9341_t3n - my version which can install with library manager or Github (https://github.com/KurtE/ILI9341_t3n)
ILI9431_t4 - I have not played as much with, but several use it with LVGL.

ILI9488/86 - Purchased a couple of ones, some from Amazon/Ebay with same pinout as PJRC ILI9341, also some from BuyDisplay.com
library: ILI9488_t3 which is installed by Teensyduino - based on ILI9341_t3n code

ST7735/ST7789 - There are lots of different variations of these. Adafruit sells several, plus lots of others out there.
Libraries: Adafruit... ST7735_t3 installed with Teensduino.

Note: sometimes these can be problematic in that there are several variations and configurations. For example, the ST7789 can handle 320x240 resolution, but there are several displays that are 240x240. So how to they
setup to use the memory within the ST7789. Some might center it, some may start at the beginning of memory, others may end at the end of memory... So with these we often have some form of configuration option, either on constructor or begin/init method to say which donfiguration
this is... But then someone comes out with new configuration... So usually just need to experiment to figure out and maybe add new setting to library.

HX8357 - So far I only know of the ones that are sold by Adafruit.
Libraries: Adafruit, I also have an HX8357_t3n library

RA8875 - Several of these sold by Adafruit and BuyDisplay.
Library: RA8875 installed by Teensyduino...

RA8876 - Buydisplay (probably others out as well)
libraries: https://github.com/wwatson4506/Ra8876LiteTeensy Also maybe other versions as well.

I2C setup
There are many of them... But...

Parallel interface - 8-bit or 16-bit bus

Some of us are playing with some different versions of libraries and hardware. A lot of this is still Work in Progress
And there are other drivers out there as well.

ILI9488/86 - https://github.com/mjs513/ILI948x_t4x_p which also uses: https://github.com/mjs513/Teensy_Parallel_GFX
NT35510 - https://github.com/KurtE/NT35510_t4x_p uses the GFX one above - this is Completely WIP and who knows how far...
RA8876 - https://github.com/wwatson4506/TeensyRA8876-8080 ...

I know that I am missing mentioning other drivers and displays.

If you are interested in some specific display/setup, ask...

As for your current issue with ILI9341 - it would help if you provided information, like which display are you using. Do you have
a link to where to get one. How do you have it wired up? What library you are using? If you had a library that worked on a different
board, which board/library.

Hope this helps
Hi, thanks for your very detailed reply.

The 320 display I purchased was via microhut on eBay. https://www.ebay.co.uk/itm/17320419...ZC4kIEYSAm&var=&widget_ver=artemis&media=COPY

The ili3491 libraries you listed, I tried each one last night and only the t3 resulted in a picture albeit with a quarter of the screen missing. Problem is when buying on eBay, can't be sure which driver chip the display comes with.

I'd really like at least a 3.5 inch display like I use on my Arduino (that's a shield display though).

You've provided a big list of possible displays. When I purchase on eBay now, I always check to see which library they list to get it working. I am happy to purchase from other sources though. I did consider the 320 x 240 ones from pjrc but ideally I'd like at least 3.5.
 
By the looks of it, it appears like your display should work. Looks like same pinout as PJRC one...
How do you have it connected? Have you tried slowing down the clock to see if that helps.
For example with my ILI9341_t3n it defaults to try to run SPI at 30mhz...
Try it at 16mhz and see if anything shows up: tft.begin(16000000);

What library worked with it on which Arduino?

EDIT: Wondering if by chance this is an ILI9340 and not an ILI9341?
Not sure if the Adafruit_ILI9340 display driver still works or not... Their github project has been archived for awhile now.


ILI9488/86 - Have 3.5" displays

HX8357: 3.5" display

RA8875 - They have several different sizes like 4.3"
https://www.adafruit.com/search?q=RA8875 They sell a controller and displays that can plug into it.

RA8876 - Likewise a few different sizes. I have 7"
 
Last edited:
By the looks of it, it appears like your display should work. Looks like same pinout as PJRC one...
How do you have it connected? Have you tried slowing down the clock to see if that helps.
For example with my ILI9341_t3n it defaults to try to run SPI at 30mhz...
Try it at 16mhz and see if anything shows up: tft.begin(16000000);

What library worked with it on which Arduino?

EDIT: Wondering if by chance this is an ILI9340 and not an ILI9341?
Not sure if the Adafruit_ILI9340 display driver still works or not... Their github project has been archived for awhile now.


ILI9488/86 - Have 3.5" displays

HX8357: 3.5" display

RA8875 - They have several different sizes like 4.3"
https://www.adafruit.com/search?q=RA8875 They sell a controller and displays that can plug into it.

RA8876 - Likewise a few different sizes. I have 7"
Thanks for linking those displays. I will take a look at each one. The display I have should be a 9341 based on the eBay purchase. I can check when I go home tomorrow night. If it's a 9340 then I would have been sent the wrong display.

It might have been the t3 library that partially worked. There was a demo scene style demo and that was the one in particular that almost worked properly (except for the blank section of screen).. the blank section of screen was actually working though.. When another demo did the screen rotations.. the blank section was filled. Also I noticed when another demo did scrolling text, the text scrolled properly over the blank section of screen. Seems like it's only a small issue. I had experienced the same over on Arduino when I first tried that display and it was eventually fixed with a different library.

Since you mention reducing the clock speed of the teensy... I can try that to see if that fixes it but that raises another point. I need any display I use with teensy to be able to run far beyond 16mhz. I want much higher Teensy clock for the audio processing. So if I buy a 3.5 display from your list... Do you know if any of them will allow Teensy to run at full capacity?
 
Since you mention reducing the clock speed of the teensy... I can try that to see if that fixes it but that raises another point. I need any display I use with teensy to be able to run far beyond 16mhz. I want much higher Teensy clock for the audio processing. So if I buy a 3.5 display from your list... Do you know if any of them will allow Teensy to run at full capacity?
Sorry, there are multiple things involved here and I am not sure what you're asking or what your needs are:

When I am mentioning 16mhz, this is the SPI speed. Not the CPU speed. That is by default the processor will still be running at 600mhz
What the SPI speed impacts are things like how long it takes to update the screen. For example with the ILI9341 display, to output a full
screen of pixels, the CPU will send about 320*240*2 bytes to the display (plus a few others to setup ).
Each of these bytes will drive the SCLK pin 8 times per byte and it is this speed we are talking about. How fast you can drive these
pins reliably depends on many things like: Max speed that the chip says it can handle.
1724953773860.png

Which looks like by spec SPI should not be > 10MHZ... But usually, we can go higher... How high? Not sure
Also, it depends on the connection. For example, I have my own boards, where I mount the teensy and have a connector
to plug the display into. Typically, I can drive this a lot faster than hooking up the display, with it plugged into a breadboard using jumper wires...

So the display will take however long it takes to send that number of bytes to it. How much overhead on the system depends. If you simply call things like: tft.fillScreen(RED); by default it be in this call as long as it takes to send the data. However, with some of our libraries, we have the concept of Frame buffer. When enabled the code will simply output the bytes into a memory buffer, and we can then choose when to actually update the display. This update can be done using DMA.

However, if your concern about the speed is how fast can you update the screen: Again... Depends!

a) If you are only updating small portions of the screen at a time, the can be implemented to just update those areas. And in the case you
only send the bytes associated with those regions of the screen.

b) You use a different interface between the processor and the Teensy... For example 8 or 16 bit parallel. With this instead of needing 16 clocks to output a pixel, it only takes 1 or 2 clocks of data. They are not typically 8 or 16 times faster as there is still overhead... But they are a lot faster.
But trade off is a lot more IO pins are required:
That is for SPI it typically takes: SCLK, MISO, MOSI, CS, DC (plus power and gnd, and maybe reset).
For Parallel interface like an ILI9486 on Teensy 4.1 with 8 bit parallel, we are typically using the following pins:
Code:
#define DISPLAY_WR 36
#define DISPLAY_RD 37


#define DISPLAY_D0 19
#define DISPLAY_D1 18
#define DISPLAY_D2 14
#define DISPLAY_D3 15
#define DISPLAY_D4 40
#define DISPLAY_D5 41
#define DISPLAY_D6 17
#define DISPLAY_D7 16


#define DISPLAY_D8 22
#define DISPLAY_D9 23
#define DISPLAY_D10 20
#define DISPLAY_D11 21
#define DISPLAY_D12 38
#define DISPLAY_D13 39
#define DISPLAY_D14 26
#define DISPLAY_D15 27
The bottom one are only needed for 16 bit. With our current code, most of these pins are semi-fixed in that we are using
subsystem called FlexIO and we want all of the D0-D7 need to be contiguous FlexIO pins...
In addition to thise pins you still, need, the CS and DC pins and optionally Reset.
On Teensy 4.1 these are on FlexIO3, which does not support DMA, so any asynchronous type updates we do using interrupts.

Sorry for the shotgun answer, as not sure what you are asking.
 
Sorry, there are multiple things involved here and I am not sure what you're asking or what your needs are:

When I am mentioning 16mhz, this is the SPI speed. Not the CPU speed. That is by default the processor will still be running at 600mhz
What the SPI speed impacts are things like how long it takes to update the screen. For example with the ILI9341 display, to output a full
screen of pixels, the CPU will send about 320*240*2 bytes to the display (plus a few others to setup ).
Each of these bytes will drive the SCLK pin 8 times per byte and it is this speed we are talking about. How fast you can drive these
pins reliably depends on many things like: Max speed that the chip says it can handle.
View attachment 35632
Which looks like by spec SPI should not be > 10MHZ... But usually, we can go higher... How high? Not sure
Also, it depends on the connection. For example, I have my own boards, where I mount the teensy and have a connector
to plug the display into. Typically, I can drive this a lot faster than hooking up the display, with it plugged into a breadboard using jumper wires...

So the display will take however long it takes to send that number of bytes to it. How much overhead on the system depends. If you simply call things like: tft.fillScreen(RED); by default it be in this call as long as it takes to send the data. However, with some of our libraries, we have the concept of Frame buffer. When enabled the code will simply output the bytes into a memory buffer, and we can then choose when to actually update the display. This update can be done using DMA.

However, if your concern about the speed is how fast can you update the screen: Again... Depends!

a) If you are only updating small portions of the screen at a time, the can be implemented to just update those areas. And in the case you
only send the bytes associated with those regions of the screen.

b) You use a different interface between the processor and the Teensy... For example 8 or 16 bit parallel. With this instead of needing 16 clocks to output a pixel, it only takes 1 or 2 clocks of data. They are not typically 8 or 16 times faster as there is still overhead... But they are a lot faster.
But trade off is a lot more IO pins are required:
That is for SPI it typically takes: SCLK, MISO, MOSI, CS, DC (plus power and gnd, and maybe reset).
For Parallel interface like an ILI9486 on Teensy 4.1 with 8 bit parallel, we are typically using the following pins:
Code:
#define DISPLAY_WR 36
#define DISPLAY_RD 37


#define DISPLAY_D0 19
#define DISPLAY_D1 18
#define DISPLAY_D2 14
#define DISPLAY_D3 15
#define DISPLAY_D4 40
#define DISPLAY_D5 41
#define DISPLAY_D6 17
#define DISPLAY_D7 16


#define DISPLAY_D8 22
#define DISPLAY_D9 23
#define DISPLAY_D10 20
#define DISPLAY_D11 21
#define DISPLAY_D12 38
#define DISPLAY_D13 39
#define DISPLAY_D14 26
#define DISPLAY_D15 27
The bottom one are only needed for 16 bit. With our current code, most of these pins are semi-fixed in that we are using
subsystem called FlexIO and we want all of the D0-D7 need to be contiguous FlexIO pins...
In addition to thise pins you still, need, the CS and DC pins and optionally Reset.
On Teensy 4.1 these are on FlexIO3, which does not support DMA, so any asynchronous type updates we do using interrupts.

Sorry for the shotgun answer, as not sure what you are asking.
Thank you for the detailed explanation and I we thinking processor speed even though you'd previously demonstrated passing a clock speed to SPI (🤣 it didn't register in my head).

I have one 320x240 display that's parallel 8 bit but as you say, a lot more connections are needed. I should have mentioned also that I might be using the audio board as well. SPI display will probably suffice to keep more ports free. I will take steps to shrink the display connection wire length also. I've seen first hand how that can impact functionality especially when using breadboard. I haven't had to worry about that for recent projects because I've been using display shields (in particular a 3.5 SPI TFT shield on Arduino mega).

When I look deeper into it on Teensy I might end up going with an 8 bit parallel for the performance but it's not critical yet.
 
Back
Top