ILI9341_due Setup on Arduino Mega 2560


You have bought a Module that requires 3.3V GPIO.
The Due has 3.3V GPIO
The Mega2560 has 5V GPIO

The screen will work fine when you provide the correct logic levels e.g. with level-shifter chips or potential dividers.

Some controllers are forgiving (input voltage tolerant even though the datasheet says otherwise). The ILI9341 will not work with >= 3.6V.



Post a photo of your wiring. Or an accurate schematic.

Yes, I would expect you to "get away with" 10k series resistors.

You can always turn these into potential dividers e.g. with 22k or even with 10k.
Most controllers are designed for 2.8V logic and will work with 1.65V logic

You can see that 5V logic is "off the scale"

But the wisest advice is: Buy a Due. It has DMA as well as civilised 3.3V logic.






You appear to have the "URTouch" calibration prog running.
But the other photo does not have a power LED. So it will never run without power.

  1. install library e.g. Marek's ILI9341_Due
  2. configure wiring to match. e.g. use Marek's wiring as if it was a Due.
  3. this means connecting to 3x2 SPI header.
  4. run all the library examples

Make notes about what works and what fails.

Rinse and repeat with UTFT, Adafruit_ILI9341, ...

When everything succeeds, configure any "User_Setup.h" for your custom wiring. Alter constructor if required.
Re-run the library examples.



Paste the UTFT (and URTouch) constructor statement from the UTFT sketch that works.

It is no good “saying” what your wiring is. If you have a problem, we need proof.



Your working constructors:

UTFT    myGLCD(ILI9341_S5P,51,52,10,9,8);
URTouch  myTouch( 6, 5, 4, 3, 2);

you would like to use this example:

#define TFT_RST 9
#define TFT_DC 8
#define TFT_CS 10
ILI9341_due tft = ILI9341_due(TFT_CS, TFT_DC, TFT_RST);
URTouch  myTouch(6, 5, 4, 3, 2);

The working sketch uses MOSI=51, SCK=52, RST=9, DC=8, CS=10:
So I would expect Marek's example to work straight out of the box.

I have used Marek's library on (3.3V) Uno and Due.
From memory, the AVR code is not specific to Uno.
I have never attempted to connect to a Mega2560. After all, Due clones are cheap and use civilised 3.3V GPIO.

The library works on (3.3V) Uno but obviously has less Flash memory than a Due.
You need to add level shifters for a Mega2560. The Mega will be just as SLOW as a Uno.

I would never dream of using the brain-dead URTouch library on a Due.
You should get all the non-Touch examples working first.

And then use XPT2046_Touchscreen library on the hardware SPI bus.



Buy a proper 3.3V Arduino. Due clones are very cheap. ESP8266 or ESP32 boards are even cheaper.

When experimenting with this type of screens, it is necessary to use short wiring, it is better to solder the terminals for greater contact accuracy.

In the MEGA remember to use the SPI head since pins 11, 12 and 13 do not have those signals as in the arduino UNO.

It is better to use resistors in the form of voltage dividers, I have seen that they behave better than using their direct equivalent between the TFT pin and the arduino pin. Another option is to use converters such as the CD4050BE