assembly 3.5 TFT LCD (ili9486) with arduino MEGA

Terminal id 0X6666

and i observed the white display is blinking like dimming and brightening when change to tft.begin(0x9486)

Buy a new MEGA2560 board. The clones are pretty cheap.

Personally, I would prefer Due or STM32.


david thank you for everything i try with due

hello dev another help to me plz

is any how i can increase uno flash memory drive through sd card or somethin

Is it necessary to stuck SD card with TFT display while I programming with Arduino Mega 2560 like Simple basic programming? Because I am getting only output "SD card initializing...failed!!!"..


I have a shield for Arduino MEGA 2560 that I bought on ebay. At first nothing was working not even the display (white screen).

Based on info found on different forums, I installed MCUFriend_kbv library and got it working after editing some library files like described below:
mcufriend_shield.h: uncommented #define USE_SPECIAL
mcufriend_special.h : uncommented #define USE_MEGA_8BIT_SHIELD

and in my sketches I’m always forcing init of TFT display with instruction tft.init(0x9486);

After those steps the display was working fine and I could get all library examples to work.

However at this stage I’m unable to get touch screen to work and tried so far with URTouch library…

I’m unclear about what pins should be provided to init call as I have the feeling that pins on my shield don’t seem to match… (I’m sure my screen is a touch screen as it was delivered with a touch stylus pen)

can someone help?

PS: below is a picture of my shield with pins visible


Ah-ha. Someone with the new ILI9486 Mega shield. I do NOT have one.

You should not need to force the ID. It should read the ID as 0x9486 in the normal way with tft.readID().
Please tell me what ID is reported in graphictest_kbv example. (On Serial Terminal and in Adafruit Tests report screen)

The Uno shields just have a resistive panel. Install Adafruit_TouchScreen library

Your shield has its own XPT2046 Touch Controller chip. Install the XPT2046_TouchScreen library via the Library Manager. TP_CS is digital #53


Hi David,
Thanks for your feedback
I ran my modified graphictest_kbv example again and this is the ID output in serial monitor:
ID = 0xD3D3 (which is result of tft.readID() call)

if I don't use tft.begin(0x9486); the sketch doesn't work...

Regarding touch screen, I installed XPT2046_TouchScreen library and ran touchTest example after updating following line:
#define CS_PIN 53

After that it worked well. Thanks !
however I tried also to use interrupt mode but this didn't work. I first tried with sketch value (#define TIRQ_PIN 2 and used in XPT2046_Touchscreen ts(CS_PIN, TIRQ_PIN);
but I believe that this interrupt is expected to be what is TP_IRQ pin on my shield right? if this is the case it should be pin 44 and tried this as well but didn't work either? Does this mean interrupt mode isn't available on my shield ?

Thanks again for your help.

Obviously it needs the correct T_IRQ pin in the constructor().
44 will be a regular PINCHANGE pin. Most Touch screens use the INTn pins.

You will need to check the library.


just wanted to say thank you, I have a new Mega plus 3.5in TFT Drive IC: ILI9486/ILI9488L

all worked fine first time

rather different from previous experience !


Hi David

Thanks for all your wonderful support for the community.

I also have a Mega2560 with an ILI9486 based display. It all works well and I'm trying to figure out how to use VertScroll.

I've looked at the scroll example but I'm not sure what the scrolled display is intended to look like so it's hard to figure out how the code works or even what the VertScroll parameters are.

My display is in landscape orientation so I guess I can only scroll horizontally. That's OK for my use case. I'd like to smooth scroll a few lines of text.

Even after lots of searching I can't seem to find a description of tft.VertScroll parameters and operation. Is there even a tiny bit of VertScroll documentation anywhere?

Thanks, Joe

You can see what Vertical Scroll can do by looking at the Penguin screens in graphictest_kbv.ino

If you are scrolling text, you need to be in Portrait. Specify how big a "band" you want to scroll.
In practice, you scroll text upwards, erase the "bottom line", draw the next text here.

It is difficult to describe how to address X, Y in a scrolled area.
I suggest that you cut out a loop of paper. Mark the physical addresses. And move your loop of paper to reflect a scroll.

If you are in Landscape mode, the scroll "looks" horizontal. Excellent for graphs or music displays. Not much good for text.

I am always amazed by people using Mega2560 with a Uno Shield. It is SLOW.
It works fine with a Mega Shield.


Hi David

Thanks for the pointer to the Penguin scroll example, it does what I want so I'll work from that sample code.

Yes, the mega display does seem slower than I had expected, mostly when clearing a region or screen. This is my first Arduino project and it's sufficient for my needs. I didn't even know that there were display shields specifically for the Mega. Is the slowness due to not being able to transfer a byte in one operation due to the nonuniform pin/port mapping or something else?

I'll go look for a display that's more mega compatible! :wink:

Cheers, Joe

In case anyone is following this… the tft.vertScroll parameters appear to be as follows:

vertScroll(firstLine, lastLine, offset)

scrolling happens along the wide display axis, ie towards a narrower screen edge, regardless of the display orientation.

calling vertScroll offsets the scroll region by the number of display lines given in the offset parameter and the SCROLL REGION WRAPS AOUND so that what went off one end of the scroll region is displayed at the other end. Negative offset values scroll in the opposite direction.

You call vertScroll multiple times increasing the offset value to animate the scrolling

The surprising part to me is that offset needs to be constantly increased rather than just meaning “scroll up 2 more lines”. So offset seems to refer to the ORIGINAL display line positions and not the currently displayed positions after calling vert.Scroll. So you have to constantly increase (or decrease) offset to move the scroll region further each time. I haven’t yet tried drawing into the scrolled region to see what happens and what lines numbers are used. ie original vs scroll offset values.

I couldn’t find even this relatively simple info anywhere, so I wanted to share this in case it helps others.


Please excuse my weak English. I use a translator.
Please, would it be possible to connect LCD ILI9486 UNO shield to arduino Mega as mega shield?
Specifically this one 3.5 inch 480x320 TFT LCD Touch Screen Module ILI9486 3.5" LCD Display for Arduino UNO MEGA2560 Board with/Without Touch Panel|Car Monitors| - AliExpress
On pins 22 - 53.
To speed up the display. The UNO shield LCD is really slow on the Arduino Mega.
Well thank you.

You have bought a Uno Shield. It works on a Mega2560 but it is SLOW.

Follow instructions from C:\Users...\Documents\Arduino\libraries\Mcufriend_kbv\extras\mcufriend_how_to.txt

17. If you do not have a standard Uno Shield, you can add a SPECIAL to the mcufriend_special.h
    Edit mcufriend_shield.h:  #define USE_SPECIAL
    Edit mcufriend_special.h: e.g. #define USE_MEGA_16BIT_SHIELD
    If your "special" is write-only,  the library can not read the ID.  It always returns 0xD3D3

in your case this means USE_SPECIAL and USE_MEGA_8BIT_PROTOSHIELD. The code is already there. You just remove some // characters.

Rewire LCD_D0 .. LCD_D7 to 22 .. 29
The shield will still be read-write.

Personally, I use a Protoshield to receive the Display. Cut traces and route the pins with soldered wires.

If you want to use a Mega2560 is is much easier to buy a Display Mega Shield instead of a Display Uno Shield.


Well thank you.
The display is already working and going fast, but my touch has stopped working. Can you please help me solve the touch problem?
I have already ordered a display for the Arduino Mega.
Specifically this one 2.8/3.5 Inch TFT Touch LCD Screen Display Module Drive ILI9341 ILI9486 Resolution 240*320 320*480 DIY Kit For Arduino|LCD Modules| - AliExpress

I have already ordered a display for the Arduino Mega.
Specifically this one 2.8/3.5 Inch TFT Touch LCD Screen Display Module Drive ILI9341 ILI9486 Resolution 240*320 320*480 DIY Kit For Arduino|LCD Modules| - AliExpress

Ouch. You have ordered a 34-pin display that requires 3.3V logic.
There are no known Adapter Shields for 34-pin to 36-pin 5V Mega2560.
So you will not only need to hand-wire every signal but you will need 21 level shifter channels.

Regarding Touch. Just think about it. You probably calibrated the Shield on a regular Mega / Uno. In which case you know the XP, XM, YP, YM pins. XP and YM were probably on 8, 9. And you are now using 22, 23.

If you had Googled for "USE_MEGA_8BIT_PROTOSHIELD" you would probably find discussion of Touch pins.


I apologise. Thank you it already works. So I ordered the display unnecessarily. I don't understand why they sell it when it doesn't work then.
Which display is a MEGA shield?