Go Down

Topic: Problem TFT ILI9341 (Read 2438 times) previous topic - next topic

ivancr_sdw

Hi, I buy a TFT screen with ILI9341 driver. I using Arduino Mega 2560 and this pin configuration in "graphictest" example from adafruit and the screen just is blank. Some help. Thanks.

#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

DC 49
CS 53
RST 13
MISO 50
SCK 52
MOSI 51



Adafruit_ILI9341 tft = Adafruit_ILI9341(CS, DC, MOSI, SCK, RST, MISO);



david_prentice

#1
Mar 03, 2020, 08:32 am Last Edit: Mar 03, 2020, 08:33 am by david_prentice
You must provide level shifters on EVERY logic signal.   The 3.3V ILI9341 does NOT like 5V logic from your MEGA2560.

Life is much simpler with a civilised 3.3V Arduino like Zero, Due,  ...

For example,   Marek Buriak's ILI9341_due library gives a dramatic performance.

David.

Djordje Saponjic

I have problem to get touch function working on Arduino DUE + MSP3218 (ILI9341 controller). I have using MOSI, MISO and SCK for touch function as well as for tft function. CS for tft pin 10, DS for tft pin 9 and T_CS for touch function on pin 8.

Do anybody now how to do it? Please help.

Djordje


Djordje Saponjic

Dear Ard_newbie,

I have tried your advice to use PaulStoffregen/ILI9341_t3 library but I get compiler error

D:\Arduino\libraries\ILI9341_t3-master/ILI9341_t3.h:466:9: error: 'KINETISK_SPI0' was not declared in this scope
    sr = KINETISK_SPI0.SR;

And it seem it is problem because I use 32bit ARM controller on Arduino Due.

Please do you have some other advice. I must be wrong.

Thank you in advance,

Best regards,

Djordje

david_prentice

ILI9341_t3 is intended for the Teensy boards.
ILI9341_due from Marek Buriak is written for Due.

Yes,  you can put ILI9341, XPT2046 and SD card all on the same hardware SPI bus.
Note that you will need to use different SPI SCK speeds.   ILI9341 can work at 42MHz but XPT2046 needs to be slower e.g. 2MHz

XPT2046_Touchscreen library should work fine on the hardware SPI bus.   It sets the SPI speed to 2MHz.

TFTLCDCyg uses separate GPIO pins for the XPT2046.  URTouch library bit-bangs XPT2046.   URTouch does not understand hardware SPI.

Since the Due has plenty of GPIO pins,  it is reasonable to bit-bang the XPT2046.

I tend to use Uno, Zero, Nucleo, ... So I am happier with everything on the same hardware SPI bus.

David.

Djordje Saponjic

I used your instructions and it is all working good.

Thank you very much for your help and assistance.

All the best to you.

Djordje

Go Up