ILI9341 not working on Teensy 4.1

Windorey

Active member
Hello, I am attempting to use the ILI9341_t3 library on my Teensy 4.1, but I get only a white screen and nothing else. The code used is the graphics test, but the display shows nothing but white. For a moment, it did work, but instantly went white again. All the wiring is the same as it s ays to wire it up in the demo, but I have changed the CS pin to GPIO 9 and the D/C pin to GPIO 10.
IMG_7564.jpg
IMG_7566.jpg
 
Please post your code per the website rules. It helps us help you! Please use the code tag, indicated by the # so your formatting stays intact. It's hard to tell what you have done, if you don't show everything.
 
As I said, the code is identical as the one found in Examples -> ILI9341_t3 -> graphicstest, but just swapped CS and DC to #define TFT_DC 10 & #define TFT_CS 9
 
It looks like you may have pin #6 tied to RESET on the display? If so, unless you are modifying the program to drive that pin high, the reset pin will be floating which could give intermittent operation. You can just tie the RESET pin to 3.3V to see if that is the problem.
 
never tried it to see what happens but it looks like you have vcc tied to 5v? try tieing it to 3.3v and bl to 5v, set tft.rst to your rst pin. Usually when I get blank screens it because I dont have RST set.
 
There is a different library that doesn't have any GFX, but it works. Yesterday for some reason in the morning it was working with 3.3v, but later that day it only wanted to work with 5v.

Giving the display 3v and with RST pin set I get a grey screen.

EDIT: I tried an ST7789 240x320 with ST7789_t3 and it works, but this ILI doesn't want to work with ILI9341_t3
 
Strange. I have used 4 of these ILI9341 displays and haven't had a problem. However, I used the following defines.
Code:
#define TFT_DC  9
#define TFT_CS 10
#define TFT_RST -1
#define TFT_SCK 13
#define TFT_MISO 12
#define TFT_MOSI 11
#define TOUCH_CS  8
I tied reset to +3.3V. The back light is tied to +5V through a 100 ohm resistor, per some recommendations I have read.
Constructors are:
Code:
XPT2046_Touchscreen ts(TOUCH_CS);
ILI9341_t3n tft = ILI9341_t3n(TFT_CS, TFT_DC, TFT_RST, TFT_MOSI, TFT_SCK, TFT_MISO);
I use the ILI9341_t3n library and haven't had any significant issues with it. I have built an Electronic Lead Screw for my lathe around this display. All my boards come right up and into the application. The display is powered by +5V since it has its own 3.3V regulator. Touch works great as well, although you do have to match the touch rotation to your screen rotation. That information is right on the sticker on the PJRC DISPLAY_ILI9341_TOUCH_32 that I use.
 
Last edited:
Different authors. I'm sure a couple of features. Seemed like the t3n fit better with what I wanted to do. I needed to do strings, and floats with the correct number of digits in my display.
t3 is the baseline library. It should work for you. I think you should check your wiring. It's quite hard to tell if you got it right, from the photos. I initially had problems with mine, but once I got it wired correctly, everything worked great.

This is what I would do, since you are not using a PCB. Remove all the wires. Wire it exactly like the original example. Shouldn't take but a couple of minutes. Use the original example code. What happens? It's real easy to miscount pins, so take it slow and easy when rewiring.
 
ili9341_t3n is my extended version of the ili9341_t3 library. It has things like DMA screen updates, Can be used on all of the SPI busses...
 
Remove all the wires. Wire it exactly like the original example. Shouldn't take but a couple of minutes. Use the original example code. What happens? It's real easy to miscount pins, so take it slow and easy when rewiring.

Still not working, only stripes :(
 
Last edited:
ili9341_t3n is my extended version of the ili9341_t3 library. It has things like DMA screen updates, Can be used on all of the SPI busses...

Do you have such a library for ST7789 that supports the DMA? It could be useful with LittlevGL to get a nice rotary encoder UI.
 
Last edited:
It still looks like you have reset connected to a digital pin (D8?) rather than 3.3V, but hard to tell for sure from the pic.
 
Do you have a voltmeter? Maybe try the LED blink program. Its default is pin 13. Upload and then touch your voltmeter to GND and SCK on the top of the display, to check that pin 13 really is changing voltage connected all the way to the display. Then edit pin number, upload again, and measure another pin, and repeat for all the signals. Yeah, tedious, but simple and effective for checking if one of the wires isn't actually connected.
 
Couple of things:

a) I have found these displays more reliable when you setup a Reset pin which is passed into constructor.

b) If I find it not working well, I try to drop the SPI speed. I believe this library defaults to 30mhz.
#define ILI9341_SPICLOCK 30000000

I would try lowering it to 20mhz and see if that makes a difference. You can either do it by edigint the define.
Or you could add a call in to tft.setClock(20000000);

c) I don't remember what hardware CS pin requirement this library has for CS or more likely DC. That is with T3.x they both need to be hardware CS pins. But our T4.x boards only have one CS pin on the main SPI object.
I know with _t3n, I removed the requirement. We might get a slight change in speed if the DC uses the hardware CS pin.
 
Couple of things:

a) I have found these displays more reliable when you setup a Reset pin which is passed into constructor.

b) If I find it not working well, I try to drop the SPI speed. I believe this library defaults to 30mhz.
#define ILI9341_SPICLOCK 30000000

I would try lowering it to 20mhz and see if that makes a difference. You can either do it by edigint the define.
Or you could add a call in to tft.setClock(20000000);

c) I don't remember what hardware CS pin requirement this library has for CS or more likely DC. That is with T3.x they both need to be hardware CS pins. But our T4.x boards only have one CS pin on the main SPI object.
I know with _t3n, I removed the requirement. We might get a slight change in speed if the DC uses the hardware CS pin.

My display has no trouble running with 115 MHz at all, and I have tried adding the reset pin to the constructor, with the same error. I am also previously aware of the speed increase by using DC on the hardware CS pin from a different library.
 
New thing, the display no longer works at all.
I tried the old library which works, no results. Just stripes on the display and nothing else.
Is there any way I could revive it?
 
New thing, the display no longer works at all.
I tried the old library which works, no results. Just stripes on the display and nothing else.
Is there any way I could revive it?

You might have unconnected a wire by accident. Had the wiring on these displays but when have to sometimes pulling all the wire off and reconnecting them works for me. As for libraries I usually use the ILI9341_t3n library with the following connections:
Code:
#define TFT_DC  9
#define TFT_CS 10
#define TFT_RST 9
#define TFT_SCK 13
#define TFT_MISO 12
#define TFT_MOSI 11

VCC = 3.3v, BL = 5v, gnd to gnd.

Using the following constructor:
Code:
ILI9341_t3n tft = ILI9341_t3n(TFT_CS, TFT_DC, TFT_RST)

Pretty much identical to @clinker8. Usually when I get the wiring right it works. I always using the Graphicstest sketch in the lib to make sure.
 
Well, I’ve tried different breadboards, different MCU boards, different wires and even new headers for the LCD and nothing worked. ESP32, STM32F401 and the Teensy all can’t get it to work, only the stripes.
 
Back
Top