Arduino Forum

Products => Arduino Due => Topic started by: ivancr_sdw on Mar 03, 2020, 05:38 am

Title: Problem TFT ILI9341
Post by: ivancr_sdw on Mar 03, 2020, 05:38 am
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


(https://www.luisllamas.es/wp-content/uploads/2015/11/aduino-pinout-mega.png)
Adafruit_ILI9341 tft = Adafruit_ILI9341(CS, DC, MOSI, SCK, RST, MISO);


(https://imgaz.staticbg.com/images/oaupload/banggood/images/C7/2A/26c9af16-6cca-414e-9b61-d312a74a692b.JPG.webp)
Title: Re: Problem TFT ILI9341
Post by: david_prentice on Mar 03, 2020, 08:32 am
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.
Title: Re: Problem TFT ILI9341
Post by: Djordje Saponjic on Apr 28, 2020, 09:53 pm
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
Title: Re: Problem TFT ILI9341
Post by: ard_newbie on Apr 29, 2020, 08:31 am

https://marekburiak.github.io/ILI9341_due/ (https://marekburiak.github.io/ILI9341_due/)


https://forum.arduino.cc/index.php?topic=282106.0 (https://forum.arduino.cc/index.php?topic=282106.0)
Title: Re: Problem TFT ILI9341
Post by: Djordje Saponjic on Jul 12, 2020, 05:32 pm
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
Title: Re: Problem TFT ILI9341
Post by: david_prentice on Jul 12, 2020, 11:35 pm
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.
Title: Re: Problem TFT ILI9341
Post by: Djordje Saponjic on Aug 05, 2020, 05:01 pm
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