ILI9341 TFT + Arduino Mega +Adafruit_ILI9341: no output, but with Due+M0 fine

If I wire a ILI9341 TFT (feat. touch, not used) correctly via SPI header with my Arduino Mega, it doesn’t show anything like just a black screen (or white, if formerly used), or perhaps even random coloured horizontal lines - but not what it actually is supposed to show up.

BUT if I wire all cables 1:1 to an Arduino Due or similarily to an Adafruit M0 Itsybitsy, the test runs fine.
SPI wiring 1000x checked, always correctly.
Also tried out a 2nd Mega board, same negative result.

PS, also tried a NANO , also negative result.

TFT drivers: Adafruit_ILI9341, Adafruit_GFX, latest versions.

I am dispairing - What can be the reason?

// Adafruit ILI9341

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

#if defined(__SAM3X8E__)
    #undef __FlashStringHelper::F(string_literal)
    #define F(string_literal) string_literal

// MISO, MOSI, CK: SPI Header 

#define    tft_cs     10
#define    tft_dc      9
//#define    tft_rst      8

//Adafruit_ILI9341 tft = Adafruit_ILI9341(tft_cs, tft_dc, tft_rst);
// Adafruit Hardware SPI, no RST
Adafruit_ILI9341 tft = Adafruit_ILI9341(tft_cs, tft_dc);

#define  TimerMS() millis()  // for backwards compatibility

unsigned long runtime[8];

void TFTprint(char sbuf[], int16_t x, int16_t y) {
  tft.setCursor(x, y);


inline void displayValues() {

  char buf[120];
  tft.fillScreen(ILI9341_BLACK); // clrscr()

    sprintf (buf, "%3d %9ld  int_Add",    0, runtime[0]); TFTprint(buf, 0,10);
    sprintf (buf, "%3d %9ld  int_Mult",   1, runtime[1]); TFTprint(buf, 0,20);
    sprintf (buf, "%3d %9ld  float_op",   2, runtime[2]); TFTprint(buf, 0,30);
    sprintf (buf, "%3d %9ld  randomize",  3, runtime[3]); TFTprint(buf, 0,40);
    sprintf (buf, "%3d %9ld  matrx_algb", 4, runtime[4]); TFTprint(buf, 0,50);
    sprintf (buf, "%3d %9ld  arr_sort",   5, runtime[5]); TFTprint(buf, 0,60);
    sprintf (buf, "%3d %9ld  TextOut",    6, runtime[6]); TFTprint(buf, 0,70);
    sprintf (buf, "%3d %9ld  Graphics",   7, runtime[7]); TFTprint(buf, 0,80);

int32_t test_TextOut(){  // mimic test buffer
  int  y;
  char buf[120];
  for(y=0;y<10;++y) {   
    tft.fillScreen(ILI9341_BLACK); // clrscr()
    sprintf (buf, "%3d %9d  int_Add",    y, 1000);  TFTprint(buf, 0,10);
    sprintf (buf, "%3d %9d  int_Mult",   0, 1010);  TFTprint(buf, 0,20);
    sprintf (buf, "%3d %9d  float_op",   0, 1020);  TFTprint(buf, 0,30);
    sprintf (buf, "%3d %9d  randomize",  0, 1030);  TFTprint(buf, 0,40);
    sprintf (buf, "%3d %9d  matrx_algb", 0, 1040);  TFTprint(buf, 0,50);
    sprintf (buf, "%3d %9d  arr_sort",   0, 1050);  TFTprint(buf, 0,60);
    sprintf (buf, "%3d %9d  displ_txt",  0, 1060);  TFTprint(buf, 0,70);
    sprintf (buf, "%3d %9d  testing...", 0, 1070);  TFTprint(buf, 0,80);

  return y;

int32_t test_graphics(){
  int y;
  char buf[120];
  for(y=0;y<10;++y) {
    sprintf (buf, "%3d", y);  TFTprint(buf, 0,80); // outcomment for downwards compatibility

    tft.drawCircle(50, 40, 10, ILI9341_WHITE);
    tft.fillCircle(30, 24, 10, ILI9341_WHITE);
    tft.drawLine(10, 10, 60, 60, ILI9341_WHITE);
    tft.drawLine(50, 20, 90, 70, ILI9341_WHITE);
    tft.drawRect(20, 20, 40, 40, ILI9341_WHITE);
    tft.fillRect(65, 25, 20, 30, ILI9341_WHITE);
    //tft.drawEllipse(70, 30, 15, 20); //  original test
    tft.drawCircle(70, 30, 15, ILI9341_WHITE); // alternatively, just if no drawEclipse is avaiable in the Arduino graph libs!

  return y;

long test(){
 unsigned long time0, x, y;
  double s;
  char  buf[120];
  int   i;
  float f;

  Serial.println("start test");
  // lcd display text / graphs
  sprintf (buf, "%3d %9ld  TextOut N/A", 6, runtime[6]); Serial.println( buf);

  sprintf (buf, "%3d %9ld  Graphics N/A", 7, runtime[7]); Serial.println( buf);

  y = 0;
  for (x = 0; x < 8; ++x) {
      y += runtime[x];
  sprintf (buf, "runtime ges.:  %-9ld ", y);
  Serial.println( buf);   TFTprint(buf, 0,90);
  sprintf (buf, "benchmark:     %-9ld ", x);
  Serial.println( buf);   TFTprint(buf, 0,100);

  return 1; // debug

void setup() {
  // Setup the LCD
  tft.setTextColor(ILI9341_WHITE); tft.setTextSize(1);
  Serial.println("tft started");

void loop() {
  char  buf[120];
  sprintf (buf, "Ende HaWe brickbench");   
  Serial.println( buf);
  TFTprint(buf, 0, 110);

It requires 3.3V logic. If you wire a 5V logic Mega to your screen you will destroy the II9341 controller.

If you want to connect to a Mega, use resistors or level shifter chips.

Life is much simpler with Zero, Due, STM32, ESP8266, …
The performance will be much faster too.


It requires 3.3V logic. If you wire a 5V logic Mega to your screen you will destroy the II9341 controller.

If you want to connect to a Mega, use resistors or level shifter chips.

Life is much simpler with Zero, Due, STM32, ESP8266, …
The performance will be much faster too.


no, the screen is advertized for both 5V and 3.3V level and logic feat. an onboard levelshifter to 3.3V.

1 Like

Post a link to the Ebay sale. Or a photo of the pcb on your desk.

Both links show a pcb with series resistors R1, R2, R3 on the SD lines. Current limiting R6 on the LED line. Pullup R4 on the T_IRQ line.

There is no level shifting circuitry on the TFT lines.

Both links say:

5V compatible, use with 3.3V or 5V logic

When pigs can fly I will believe Ebay vendors. They just lie. They would be serious competition for Donald Trump.

Package included:

12.8" TFT LCD Display Touch Panel SPI Serial 240320 ILI9341 5V/3.3V STM32

Note that there is no mention of a 5V Mega or Uno.

You are not alone. Lots of customers believe the lies. The ILI9341 datasheet clearly says absolute maximum logic level is 3.3V. You will damage your controller with 5V

The only way that they can use the screen is with level shifters. Please find someone who has succeeded without level shifters.


what a f*** ! I'll try to get a refund!
Thanks for you advices and explanations!

You can try to get a refund. I do not reckon much on your chances..

Especially since you know that the display works fine with M0 or Due. Ebay shops have sold 1000s of these boards

A 4-channel level shifter chip is not expensive.
Four 4k7 series resistors would be even cheaper.

I only use 5V Mega with 3.3V displays that come with level shifters on the Shield.

Otherwise I only use boards with 3.3V GPIO.
Quite honestly, your display has SPI TFT, SPI Touch Controller, SPI SD card. All can sit on the same 3.3V SPI bus. And work fast on the Due. The M0 SPI works but is pretty crap.


are you quite sure that it's a 5V issue nd not a software / driver issue?
Can you perhaps show me how to use resistors as level shifters on MISO, MOSI and CLK lines?

Yes, I am sure that it is a 5V GPIO issue.

You can Google for yourself to see how to connect MOSI, SCK, CS, RS, RST lines.

My apologies. It is five lines.

Google can explain potential divider, series resistor, level shifter, ...

The real mystery is why you should choose a MEGA2560 with 5V logic.
Especially when a DUE works so much better. e.g. with Marek's ILI9341_Due library.


I have too many 5V sensor devices for my Mega (and probably in a near future also a shield which is just Uno and Mega compatible, not 3V3). It actually should be possible to quickly attach the TFT arbitrarily to either Arduino. I think I'll try to purchase one which is really 5V/3.3V compatible.

Go on. Most sensors and most electronics are 3.3V
Which sensors are giving you the 5V problem?

Yes, Shields are a good reliable way to connect external electronics.
But buying five resistors is not going to break the bank.

Buying a CD4050 or other level-shifter chip is not expensive.

Buying a cheap Mcufriend Uno TFT Shield is pretty cheap.

What response did you get from Ebay when you asked for a refund?
Ebay is 100% reliable when you have a defective item.


I don't want to argue, but it's mainly about US distance sensors and a pozyx shield I was reading about a couple of weeks ago. But I actually don't want to mess around with external level shifters or resistors, I was simply looking for 1 TFT to fit for all, just plug-and play.
The ebay customer complaint has just been issued.

the purchase price for the faulty 5V/3.3V ILI9341 TFT has been refunded

I apologize for replaying to this fairly old post but I’ve seen too many posts claming that this display doesn’t work with 5V. I have same exact one and it works fine with Duemilanove when you solder the jumper on the back side, no level shifters needed.

ILI9341 on Duemilanove:

I apologize for replaying to this fairly old post but I've seen too many posts claming that this display doesn't work with 5V. I have same exact one and it works fine with Duemilanove when you solder the jumper on the back side, no level shifters needed.

ILI9341 on Duemilanove:

thank you, that is awesome - for the next try :wink:

Could you show please which jumper has to be soldered?

I can make some assumptions about your wiring. But you have carefully concealed how you have connected the TFT pins. How do we know whether you have not got series resistors out of view?

I possess a Red KMRTM24024-SPI and a Red TJCTM24024-SPI display.
I also have regular 2.2 TFT SPI 240x320 display.

None of these boards have any form of level shifter or series resistor in the ILI9341 signal lines.

The ILI9341 datasheet says:

Item                      Symbol Unit Condition          Min. Typ. Max. Note
Analog Operating Voltage  VCI      V Operating voltage  2.5   2.8  3.3 Note2
Logic Operating Voltage   VDDI     V I/O supply voltage 1.65  2.8  3.3 Note2

I have always used 3.3V logic. But plenty of people have attempted to use 5V logic with ILI9341 without success.

So I simply do not believe you.

Anyway, buying a few resistors is hardly going to break the bank.
The datasheet says that you will damage he ILI9341 if you exceed the maximum

Note that the XPT2046 is 5V tolerant.


It’s marked as J1 , just under U1 on the picture.

serial number is KMRTM28028-SPI

These Red displays are designed for connecting VCC pin to 5V
This feeds an AMS1117-3.3 regulator U1.

The J1 jumper is designed for operating with VCC = 3.3V i.e. it shorts out the U1 3.3V regulator.


Look at the printed instruction on kotelici's photo.


There is no jumper and neither a current path leading away from Vcc nor an imprint about 5V.