White screen on my ILI9341 2.8 LCD TFT screen

Hello.
Once again, I wanted to test another display for my school project : the 2.8 LCD TFT ILI ili9341, purchased from here : myDisplay.
I'm using a teensy 4.0 as a microcontroller, so my SPI pins and the UNO's are the same.

But unfortunately, my screen remains white when I try the graphic test of the Adafruit ili9341 library.

The sketch is compiling well, and even draw circle, square, text ... And it even print me the time on the monitor, but nothing on the screen itself : it remains white and only.

I tried this montage : myTutorial, and I even tried to connect the VCC to 3.3V : I don't know what I did wrong.

I hope you will be able to help me ! :slight_smile:
Cheers,
Quentin

Your example has:

// For the Adafruit shield, these are the default.
#define TFT_DC 9
#define TFT_CS 10

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);

Your display has a proper TFT_RST pin. I suggest that you wire it to digital#8.
And modify the Adafruit code:

// For the Adafruit shield, these are the default.
#define TFT_DC 9
#define TFT_CS 10
#define TFT_RST 8 //.kbv connect the proper RESET pin

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC .kbv /RST
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST); //.kbv use full-fat constructor

Adafruit make and sell their own hardware (which has a pullup on the RESET pin)
Adafruit know that the Chinese Red displays do not have a pullup.

Adafruit publish examples that are guaranteed to fail on the Red displays.

You should connect VCC to 5V because the Red display has a regulator (U1) on the pcb.

David.

Thanks David.
I will try your code and give you my feedbacks later in the day. If it still doesn't work, I will send photos and code.
Thanks again, cheers.
Quentin

Hello again David.
I tried what you said, and unfortunately it didn't work.
I inserted few images to show you exactly what I'm running with :
The header of the sketch, with the library version used;
The wiring setup I tried, with the diagram associated

I used the default ILI9341 library to use the graphictest, but the ideal option would be to use the optimised version of this library, donwloadable here myOptimisedLibrary.

I hope you will be able to help me, because solving this would just save my life.
Cheers,
Quentin

The wiring setup.jpg

Your photo is unreadable. I can not even see if you have soldered header strip on the Teensy4.0

I suggest that you solder header strip. Then it will plug into the breadboard.

Plug the display into the breadboard with holes in view.
Then connect straight wires from the named pins on the Teensy to the named pins on the display.

Solid wires or coloured jumper cables should be arranged so the photo shows your wiring clearly.

Then post a photo.

I didn't solder, not yet.
I just link wires and the teensy. The screen remains white, so it us supposed to work.
I don't what's the problem, do you think this is why the screen's white ?
I gave you How i linked wires and the teensy.
Cheers,
Quentin

Wires.jpg

I suppose you could try stuffing another thin wire in the hole to make a tight fit (and good electrical connection.

You do not need series resistors. And I can't read the values anyway.
You certainly don't need the 220R resistors from the Fritzing diagram (for a Uno)

David.

Okay okay, I got it it was a stupid idea, my bad.
I will solder the board with a header strip and try again.
The two thin wire doesn't fit, but it was a good idea.
I'll give you my feedbacks later in the week.
cheers,
Quentin

The SPI port of the Teensy 4 works very uniquely. Previous adafruit libraries will not work. You must use the ili9341_t3 library, that comes with the teensy loader 1.48 program or newer.

The call header must be configured as follows:

Example of ili9341_t3: graphicstest.ino

#define TFT_RST  8
#define TFT_DC  9
#define TFT_CS 10
ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC, TFT_RST);

ILI9341 3.2" + Teensy 4

The touch panel does not work at the moment. Possibly the Urtouch library might work, but the Teensy 4 pin management has 32-bit architecture. The Urtouch library makes 8 and 16 bit calls, so the configuration of the T-X control pins is not compatible.

I only have a Teensy3.2
But any Arduino should implement the regular functions like digitalWrite(), pinMode(), SPI.xxx(), Wire.xxx(), ...

I would expect Adafruit_ILI9341 library to work out of the box
But PJRC's own ili9341_t3 library should definitely work. It is their own product !!

Likewise, I would expect XPT2046_TouchScreen library to work. Another PJRC library.

URTouch library has no concept of hardware SPI. It only bit-bashes in software. So it would not worry about Teensy hardware features.

I don't have a Teensy4.0 so this is pure speculation on my part.

The Teensy4.0 will be able to decode JPG, PNG, ... at impressive speed.
But there is little to gain for the TFT. ILI9341 can just run 42MHz SPI but no faster. Obviously DMA makes the operation virtually transparent.

@Quentin,
Look at TFTLCDCyg's neat protoboard. This is very important.

David.

offtopic:

jejejeje as well as clean ... clean ... It is what there is at this moment, as I learn to design my own boards.

This is the error that URTouch reports for tclk (it's identical for tcs, tdin, dout, irq):

C:\Users\User\Documents\Arduino\libraries\URTouch\URTouch.cpp: In member function 'void URTouch::InitTouch(byte)':

C:\Users\User\Documents\Arduino\libraries\URTouch\URTouch.cpp:55:8: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment

  P_CLK = portOutputRegister(digitalPinToPort(T_CLK));

Maybe with "your eyes of TFT-Elf" could you see any output XD

Regarding the frequency in SPI for ILI9341, it seems to me that the maximum is 30 MHz@600 MHz, after that value, the screen does not respond.

Speaking of the handling of jpg or png images, for the Teensy 4 there is practically no information about it. I have tried to explore other options, but it involves using other types of screens, as you know I have learned on screens with EVE2 chips, specifically with the FT813 chip. It has the ability to handle video in AVI format, in addition to jpg, jpeg or png files.

I installed the SDIO reader on Teensy 4 and I managed to make it work with the Greiman SDFat beta library; It's incredibly fast, it surprised me.

This just needs the appropriate type.

P_CLK = portOutputRegister(digitalPinToPort(T_CLK));

From memory Adafruit handle this properly.
I would not expect RinkyDink to behave (but it is always possible)

Regarding SPI speed. Marek Buriak's ILI9341_due library works reliably at 42MHz.
Experiments with faster MCUs show it working with the occasional glitch at 48MHz.

It just comes down to available SPI speeds i.e. what clock and hardware divisor.

Since you possess the hardware, please could you try Adafruit_ILI9341 library.
At least Quentin knows that ILI9341_t3 works with the Teensy4.0

I have just ordered the Teensy4.0. So I will be able to see for myself. (instead of blind guesswork)

David.

La librería Adafruit_ILI9341, descargada directamente del repositorio de Adafruit, ¡no funciona!. Este es el reporte de fallos:

In file included from C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX\Adafruit_GFX.cpp:40:0:

C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX\glcdfont.c:13:0: warning: "PROGMEM" redefined

  #define PROGMEM

 ^

In file included from C:\arduino_189\hardware\teensy\avr\cores\teensy4/WProgram.h:41:0,

                 from C:\Users\User\AppData\Local\Temp\arduino_build_786498/pch/Arduino.h:6,

                 from C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX\Adafruit_GFX.h:5,

                 from C:\Users\User\Documents\Arduino\libraries\Adafruit_GFX\Adafruit_GFX.cpp:39:

C:\arduino_189\hardware\teensy\avr\cores\teensy4/avr/pgmspace.h:28:0: note: this is the location of the previous definition

 #define PROGMEM __attribute__((section(".progmem")))

 ^

C:\Users\User\Documents\Arduino\libraries\Adafruit_ILI9341\Adafruit_ILI9341.cpp: In constructor 'Adafruit_ILI9341::Adafruit_ILI9341(int8_t, int8_t, int8_t, int8_t, int8_t, int8_t)':

C:\Users\User\Documents\Arduino\libraries\Adafruit_ILI9341\Adafruit_ILI9341.cpp:184:15: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment

     csport    = portOutputRegister(digitalPinToPort(_cs));

               ^

C:\Users\User\Documents\Arduino\libraries\Adafruit_ILI9341\Adafruit_ILI9341.cpp:186:15: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment

     dcport    = portOutputRegister(digitalPinToPort(_dc));

               ^

C:\Users\User\Documents\Arduino\libraries\Adafruit_ILI9341\Adafruit_ILI9341.cpp:188:17: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment

     clkport     = portOutputRegister(digitalPinToPort(_sclk));

                 ^

C:\Users\User\Documents\Arduino\libraries\Adafruit_ILI9341\Adafruit_ILI9341.cpp:190:17: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment

     mosiport    = portOutputRegister(digitalPinToPort(_mosi));

                 ^

C:\Users\User\Documents\Arduino\libraries\Adafruit_ILI9341\Adafruit_ILI9341.cpp:193:21: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment

         misoport    = portInputRegister(digitalPinToPort(_miso));

                     ^

C:\Users\User\Documents\Arduino\libraries\Adafruit_ILI9341\Adafruit_ILI9341.cpp: In constructor 'Adafruit_ILI9341::Adafruit_ILI9341(int8_t, int8_t, int8_t)':

C:\Users\User\Documents\Arduino\libraries\Adafruit_ILI9341\Adafruit_ILI9341.cpp:211:15: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment

     csport    = portOutputRegister(digitalPinToPort(_cs));

               ^

C:\Users\User\Documents\Arduino\libraries\Adafruit_ILI9341\Adafruit_ILI9341.cpp:213:15: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment

     dcport    = portOutputRegister(digitalPinToPort(_dc));

               ^

Error compilando para la tarjeta Teensy 4.0.

Wow!. The Adafruit_ILI9341 library that comes with the teensy loader if it works, just add this call

#define TFT_RST 8
#define TFT_DC 9
#define TFT_CS 10

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

These are the results using the ili9341_t3 library:

PD:
I apologize for my failure, I just installed the head to verify the operation of a 3.5 "ILI9488 screen, I connected the ILI9341 until today, seeing the post of friend Quentinemusee, I was curious to see if it worked!

Most Adafruit libraries will run on different Arduinos. e.g. EVERY, Zero, Due, STM32, Teensy, ESP8266, ...
Just keep them "up to date" via the Library Manager.

I would expect Adafruit_ILI9341 to work but probably slower than PJRC's ILI9341_t3 code.

Regarding JPG, PNG, GIF. They all run on Teensy 3.2
Teensy3.2 performance is pretty good. Teensy 3.5, 3.6, 4.0 will be BETTER.
Some formats require a lot of SRAM.

Obviously there are some hardware features of a Teensy that will not be supported by STM32, ESP, ...
But standard things like TFT only require SPI or GPIO. Available on every Arduino.

David.

Wow sorry for no responding, I prefered to wait for my teensy to be soldered.
Now, this is done.
I'm still not sure my screen's working, I did several test and it seems that the SPI wasn't efficient at all.
I can try the optimised Library, should I ?
Thanks to both of you for your involvment, I saw that you ordered the teensy 4.0 David, I'm a little sorry ahah.
Cheers,
Quentin

My Teensy4.0 arrived this afternoon.

ILI9341_t3 library examples (that come with your Teensy) work. Remember to connect your TFT_RST line to digital#8 and put in the constructor.
Adafruit_ILI9341 library examples work. Connect TFT_RST. Use full-fat constructor.

Post a photo of your wiring.
Copy-Paste the constructor line.

Now that I have the Teensy4.0 I can run your problem code.

David.

Woo-Hoo. I have added support for Teensy 4.0 with the MCUFRIEND_kbv library (Beta)

It decodes and displays a 320x240 JPEG image in 30ms (from PROGMEM)
It decodes much faster than the STM32F767 (Cortex-M7 @ 216MHz)

I have not got my SPI library running on the Teensy4.0 yet.
But the important news is that the public Adafruit_ILI9341 library works out of the box.

David.

As a child in jejejeje fair!. Awaiting your progress with these screens in teensy 4.

If an SDIO reader is installed in the pads on the back side, you can use it with the Greiman SdFat beta library.

SanDisk Extreme 32 Gb (class 3)

No, I have not mounted the microSD holder. I have not tried.

I have added support for IMXRT1062 which is the chip in my Teensy 4.0

//####################################### TEENSY 4.0 ############################
#elif defined(__IMXRT1062__)// regular UNO shield on a Teensy 4.x
#warning regular UNO shield on a Teensy 4.0

//LCD pins  |D7  |D6  |D5 |D4 |D3 |D2 |D1  |D0  | |RD  |WR  |RS  |CS  |RST |  A5
//MXRT pin  |7.17|7.10|9.8|9.6|9.5|9.4|7.11|7.16| |6.18|6.19|6.23|6.22|6.17|6.16

The "core_pins.h" has variant pins for IMXRT1052 but I do not know whether this is a commercial board or just a historic prototype.

//LCD pins  |D7  |D6  |D5 |D4 |D3 |D2 |D1  |D0  | |RD  |WR  |RS  |CS  |RST |  A5
//MXRT pin  |4.16|4.17|2.7|2.6|2.5|2.4|4.11|4.10| |1.18|1.19|1.23|1.22|1.17|1.16

David.