HELP needed for driver of 3.5" TFTLCD for arduino MEGA & DUE ili9841

Hello,

I've baught this object from ebay :

http://www.ebay.fr/itm/351686444709?_trksid=p2060353.m2749.l2649&var=620655336723&ssPageName=STRK%3AMEBIDX%3AIT

But since I've received it, impossible to make it work. I'm stuck with a white screen whatever I do...

I've tried Utouch library with these parameters :

UTFT myGLCD(ILI9481,38,39,40,41);
and
UTFT myGLCD(CTE32HR,38,39,40,41);

But without any result.

i also tried osoyo library :http://osoyoo.com/driver/3.5LCD_ili9481.rar
white screen one more...

Sometimes with some library I've got a blinking screen with some noise-like pattern
And i had some result once with ILI9327_8 of UTFT unoficial dgolga modified library but it only showed me some hard to see shadow rectangle....

I'm totaly lost so can someone help me please ?

Thanks for posting the link in your first message. It would be nice if everyone did that !

Try the <TFT_HX8537.h> library from Bodmer. There are threads/links on this site. The code is on GitHub.

You can configure it for an ILI9481 in the "User_Setup.h" file.

Of course, you may have a different controller. But since it says ILI9481 it is a pretty good starting point.

David.

Thanks for the answer !!!

I don't know if it's the library itself or not but the screen stays white... But sometimes it blinck for a fraction second and at a time I've a black screen then totaly white again... (exemple TFT Rainbow) so I wonder if it's not the contrast that is too high so I can't see anything....

I truly don't know what to do... Maybe an idea ?

First off. Plug the shield into the Mega2560 as Nature intended. You would be surprised how many people choose individual trailing wires.

The Shield looks like the standard 16-bit pin-out. i.e. PORTA, PORTC
So Bodmer's library should work.

It might have a different controller. I would trust Bodmer. Most modern controllers will start up by themselves.

David.

The screens are in the 2 mega and the due since the beginning so i don't think that's the problem

Every pixel is so bright that even if the library works i cannot tell you if it's the case or not...

Is there a way to test this or fix it ?

I Had a reply of the constructor who gave me a functionnal driver for arduino Mega but it doesn't seems to work with arduino Due

The V1 is the original version as gived to me by the constructor (but a bug from DefautFont.h prevent me from compile it with 1.6 IDE)

The V2 is a version where I replaced the DefaultFont.f file by the latest from UTFT original

I'm not good enough to know what's wrong to prevent to work on Due on m own. Can someone help me to find a soution ?

3.5inch ILI9481 2016.zip (87.3 KB)

3.5inch ILI9481 2016 V2.zip (88.1 KB)

Use the UTFT library :slight_smile:

http://www.rinkydinkelectronics.com/library.php?id=51

Then upload this sketch:

// UTFT_Demo_800x480
// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved
// web: http://www.RinkyDinkElectronics.com/
//
// This program is a demo of how to use most of the functions
// of the library with a supported display modules.
//
// This demo was made for modules with a screen resolution
// of 800x480 pixels.
//
// This program requires the UTFT library.
//

#include <UTFT.h>

// Declare which fonts we will be using
extern uint8_t SmallFont[];

// Set the pins to the correct ones for your development shield
// ------------------------------------------------------------
// Standard Arduino Mega/Due shield : ,38,39,40,41
// CTE TFT LCD/SD Shield for Arduino Due : ,25,26,27,28
// Teensy 3.x TFT Test Board : ,23,22, 3, 4
// ElecHouse TFT LCD/SD Shield for Arduino Due : ,22,23,31,33
//
// Remember to change the model parameter to suit your display module!
UTFT myGLCD(ILI9481,38,39,40,41);

void setup()
{
randomSeed(analogRead(0));

// Setup the LCD
myGLCD.InitLCD();
myGLCD.setFont(SmallFont);
}

void loop()
{
int buf[798];
int x, x2;
int y, y2;
int r;

// Clear the screen and draw the frame
myGLCD.clrScr();

myGLCD.setColor(255, 0, 0);
myGLCD.fillRect(0, 0, 799, 13);
myGLCD.setColor(64, 64, 64);
myGLCD.fillRect(0, 466, 799, 479);
myGLCD.setColor(255, 255, 255);
myGLCD.setBackColor(255, 0, 0);
myGLCD.print("* Universal Color TFT Display Library *", CENTER, 1);
myGLCD.setBackColor(64, 64, 64);
myGLCD.setColor(255,255,0);
myGLCD.print("http://www.RinkyDinkElectronics.com/", CENTER, 467);

myGLCD.setColor(0, 0, 255);
myGLCD.drawRect(0, 14, 799, 465);

// Draw crosshairs
myGLCD.setColor(0, 0, 255);
myGLCD.setBackColor(0, 0, 0);
myGLCD.drawLine(399, 15, 399, 464);
myGLCD.drawLine(1, 239, 798, 239);
for (int i=9; i<790; i+=10)
myGLCD.drawLine(i, 237, i, 242);
for (int i=19; i<470; i+=10)
myGLCD.drawLine(397, i, 402, i);

// Draw sin-, cos- and tan-lines
myGLCD.setColor(0,255,255);
myGLCD.print("Sin", 5, 15);
for (int i=1; i<798; i++)
{
myGLCD.drawPixel(i,239+(sin(((i*1.13)*3.14)/180)*200));
}

myGLCD.setColor(255,0,0);
myGLCD.print("Cos", 5, 27);
for (int i=1; i<798; i++)
{
myGLCD.drawPixel(i,239+(cos(((i*1.13)*3.14)/180)*200));
}

myGLCD.setColor(255,255,0);
myGLCD.print("Tan", 5, 39);
for (int i=1; i<798; i++)
{
myGLCD.drawPixel(i,239+(tan(((i*0.9)*3.14)/180)));
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);
myGLCD.setColor(0, 0, 255);
myGLCD.setBackColor(0, 0, 0);
myGLCD.drawLine(399, 15, 399, 464);
myGLCD.drawLine(1, 239, 798, 239);

// Draw a moving sinewave
x=1;
for (int i=1; i<(79820); i++)
{
x++;
if (x==799)
x=1;
if (i>799)
{
if ((x==399)||(buf[x-1]==239))
myGLCD.setColor(0,0,255);
else
myGLCD.setColor(0,0,0);
myGLCD.drawPixel(x,buf[x-1]);
}
myGLCD.setColor(0,255,255);
y=239+(sin(((i
1.65)3.14)/180)(200-(i / 100)));
myGLCD.drawPixel(x,y);
buf[x-1]=y;
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

// Draw some random filled rectangles
for (int i=0; i<50; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=2+random(746);
y=16+random(397);
x2=x+50;
y2=y+50;
myGLCD.fillRect(x, y, x2, y2);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

// Draw some random filled, rounded rectangles
for (int i=0; i<50; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=2+random(746);
y=16+random(397);
x2=x+50;
y2=y+50;
myGLCD.fillRoundRect(x, y, x2, y2);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

// Draw some random filled circles
for (int i=0; i<50; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=27+random(746);
y=41+random(397);
myGLCD.fillCircle(x, y, 25);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

// Draw some lines in a pattern
myGLCD.setColor (255,0,0);
for (int i=15; i<463; i+=5)
{
myGLCD.drawLine(1, i, (i1.66)-10, 463);
}
myGLCD.setColor (255,0,0);
for (int i=463; i>15; i-=5)
{
myGLCD.drawLine(798, i, (i
1.66)+30, 15);
}
myGLCD.setColor (0,255,255);
for (int i=463; i>15; i-=5)
{
myGLCD.drawLine(1, i, 770-(i1.66), 15);
}
myGLCD.setColor (0,255,255);
for (int i=15; i<463; i+=5)
{
myGLCD.drawLine(798, i, 810-(i
1.66), 463);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

// Draw some random circles
for (int i=0; i<250; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=32+random(736);
y=45+random(386);
r=random(30);
myGLCD.drawCircle(x, y, r);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

// Draw some random rectangles
for (int i=0; i<250; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=2+random(796);
y=16+random(447);
x2=2+random(796);
y2=16+random(447);
myGLCD.drawRect(x, y, x2, y2);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

// Draw some random rounded rectangles
for (int i=0; i<250; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=2+random(796);
y=16+random(447);
x2=2+random(796);
y2=16+random(447);
myGLCD.drawRoundRect(x, y, x2, y2);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

for (int i=0; i<250; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=2+random(796);
y=16+random(447);
x2=2+random(796);
y2=16+random(447);
myGLCD.drawLine(x, y, x2, y2);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

for (int i=0; i<10000; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
myGLCD.drawPixel(2+random(796), 16+random(447));
}

delay(2000);

myGLCD.fillScr(0, 0, 255);
myGLCD.setColor(255, 0, 0);
myGLCD.fillRoundRect(320, 190, 479, 289);

myGLCD.setColor(255, 255, 255);
myGLCD.setBackColor(255, 0, 0);
myGLCD.print("That's it!", CENTER, 213);
myGLCD.print("Restarting in a", CENTER, 239);
myGLCD.print("few seconds...", CENTER, 252);

myGLCD.setColor(0, 255, 0);
myGLCD.setBackColor(0, 0, 255);
myGLCD.print("Runtime: (msecs)", CENTER, 450);
myGLCD.printNumI(millis(), CENTER, 465);

delay (10000);
}

alexandrerouma:
Use the UTFT library :slight_smile:

UTFT - Rinky-Dink Electronics

Then upload this sketch:

// UTFT_Demo_800x480
// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved
// web: http://www.RinkyDinkElectronics.com/
//
// This program is a demo of how to use most of the functions
// of the library with a supported display modules.
//
// This demo was made for modules with a screen resolution
// of 800x480 pixels.
//
// This program requires the UTFT library.
//

#include <UTFT.h>

// Declare which fonts we will be using
extern uint8_t SmallFont[];

// Set the pins to the correct ones for your development shield
// ------------------------------------------------------------
// Standard Arduino Mega/Due shield : ,38,39,40,41
// CTE TFT LCD/SD Shield for Arduino Due : ,25,26,27,28
// Teensy 3.x TFT Test Board : ,23,22, 3, 4
// ElecHouse TFT LCD/SD Shield for Arduino Due : ,22,23,31,33
//
// Remember to change the model parameter to suit your display module!
UTFT myGLCD(ILI9481,38,39,40,41);

void setup()
{
randomSeed(analogRead(0));

// Setup the LCD
myGLCD.InitLCD();
myGLCD.setFont(SmallFont);
}

void loop()
{
int buf[798];
int x, x2;
int y, y2;
int r;

// Clear the screen and draw the frame
myGLCD.clrScr();

myGLCD.setColor(255, 0, 0);
myGLCD.fillRect(0, 0, 799, 13);
myGLCD.setColor(64, 64, 64);
myGLCD.fillRect(0, 466, 799, 479);
myGLCD.setColor(255, 255, 255);
myGLCD.setBackColor(255, 0, 0);
myGLCD.print("* Universal Color TFT Display Library *", CENTER, 1);
myGLCD.setBackColor(64, 64, 64);
myGLCD.setColor(255,255,0);
myGLCD.print("http://www.RinkyDinkElectronics.com/", CENTER, 467);

myGLCD.setColor(0, 0, 255);
myGLCD.drawRect(0, 14, 799, 465);

// Draw crosshairs
myGLCD.setColor(0, 0, 255);
myGLCD.setBackColor(0, 0, 0);
myGLCD.drawLine(399, 15, 399, 464);
myGLCD.drawLine(1, 239, 798, 239);
for (int i=9; i<790; i+=10)
myGLCD.drawLine(i, 237, i, 242);
for (int i=19; i<470; i+=10)
myGLCD.drawLine(397, i, 402, i);

// Draw sin-, cos- and tan-lines
myGLCD.setColor(0,255,255);
myGLCD.print("Sin", 5, 15);
for (int i=1; i<798; i++)
{
myGLCD.drawPixel(i,239+(sin(((i*1.13)*3.14)/180)*200));
}

myGLCD.setColor(255,0,0);
myGLCD.print("Cos", 5, 27);
for (int i=1; i<798; i++)
{
myGLCD.drawPixel(i,239+(cos(((i*1.13)*3.14)/180)*200));
}

myGLCD.setColor(255,255,0);
myGLCD.print("Tan", 5, 39);
for (int i=1; i<798; i++)
{
myGLCD.drawPixel(i,239+(tan(((i*0.9)*3.14)/180)));
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);
myGLCD.setColor(0, 0, 255);
myGLCD.setBackColor(0, 0, 0);
myGLCD.drawLine(399, 15, 399, 464);
myGLCD.drawLine(1, 239, 798, 239);

// Draw a moving sinewave
x=1;
for (int i=1; i<(79820); i++)
{
x++;
if (x==799)
x=1;
if (i>799)
{
if ((x==399)||(buf[x-1]==239))
myGLCD.setColor(0,0,255);
else
myGLCD.setColor(0,0,0);
myGLCD.drawPixel(x,buf[x-1]);
}
myGLCD.setColor(0,255,255);
y=239+(sin(((i
1.65)3.14)/180)(200-(i / 100)));
myGLCD.drawPixel(x,y);
buf[x-1]=y;
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

// Draw some random filled rectangles
for (int i=0; i<50; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=2+random(746);
y=16+random(397);
x2=x+50;
y2=y+50;
myGLCD.fillRect(x, y, x2, y2);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

// Draw some random filled, rounded rectangles
for (int i=0; i<50; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=2+random(746);
y=16+random(397);
x2=x+50;
y2=y+50;
myGLCD.fillRoundRect(x, y, x2, y2);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

// Draw some random filled circles
for (int i=0; i<50; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=27+random(746);
y=41+random(397);
myGLCD.fillCircle(x, y, 25);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

// Draw some lines in a pattern
myGLCD.setColor (255,0,0);
for (int i=15; i<463; i+=5)
{
myGLCD.drawLine(1, i, (i1.66)-10, 463);
}
myGLCD.setColor (255,0,0);
for (int i=463; i>15; i-=5)
{
myGLCD.drawLine(798, i, (i
1.66)+30, 15);
}
myGLCD.setColor (0,255,255);
for (int i=463; i>15; i-=5)
{
myGLCD.drawLine(1, i, 770-(i1.66), 15);
}
myGLCD.setColor (0,255,255);
for (int i=15; i<463; i+=5)
{
myGLCD.drawLine(798, i, 810-(i
1.66), 463);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

// Draw some random circles
for (int i=0; i<250; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=32+random(736);
y=45+random(386);
r=random(30);
myGLCD.drawCircle(x, y, r);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

// Draw some random rectangles
for (int i=0; i<250; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=2+random(796);
y=16+random(447);
x2=2+random(796);
y2=16+random(447);
myGLCD.drawRect(x, y, x2, y2);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

// Draw some random rounded rectangles
for (int i=0; i<250; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=2+random(796);
y=16+random(447);
x2=2+random(796);
y2=16+random(447);
myGLCD.drawRoundRect(x, y, x2, y2);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

for (int i=0; i<250; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
x=2+random(796);
y=16+random(447);
x2=2+random(796);
y2=16+random(447);
myGLCD.drawLine(x, y, x2, y2);
}

delay(2000);

myGLCD.setColor(0,0,0);
myGLCD.fillRect(1,15,798,464);

for (int i=0; i<10000; i++)
{
myGLCD.setColor(random(255), random(255), random(255));
myGLCD.drawPixel(2+random(796), 16+random(447));
}

delay(2000);

myGLCD.fillScr(0, 0, 255);
myGLCD.setColor(255, 0, 0);
myGLCD.fillRoundRect(320, 190, 479, 289);

myGLCD.setColor(255, 255, 255);
myGLCD.setBackColor(255, 0, 0);
myGLCD.print("That's it!", CENTER, 213);
myGLCD.print("Restarting in a", CENTER, 239);
myGLCD.print("few seconds...", CENTER, 252);

myGLCD.setColor(0, 255, 0);
myGLCD.setBackColor(0, 0, 255);
myGLCD.print("Runtime: (msecs)", CENTER, 450);
myGLCD.printNumI(millis(), CENTER, 465);

delay (10000);
}

hello dear,i have same problem, i was used this code,but problem not solved!
and the screen is white!
what can i do , to solve this broblem?
thanks a lot

what LCD are you using ?

my lcd is : 3.5'' TFT LCD for ardunio 2560(ili9481)

Check the pinout, at the top of the sketch, it tell you what pinout you need to use (it depands on your board)

i used this code for tft driver : UTFT myGLCD(ILI9481,38,39,40,41);

Is it possible to be different PIN OUT?(38,39,40,41)

Yes, it may be different

No the problem is somewhere else...

It seems that the driver I provided is a modified version of the original UTFT

So unless you have the modified version, impossible to make it work

do you have a code or driver?
can i find my lcd driver with code?

please help me , i'm confused! :frowning:

If you have the exactly same card as me I already have gave you all you need (driver +code attached in one of my previous posts)

my problem not solved! :((

First off. Does your display match the link in message #1 ?

This means every photo, every trace on the pcb, ...

If not, please post a link to your actual display. And yes, describe any differences.

David.