Go Down

Topic: 2.4 inch TFT touch LCD Screen Module For Arduino UNO R3 SD low price jocks (Read 21735 times) previous topic - next topic

Lundin

Hello.
I purchased 5 of these displays a few days ago ( labeled www.mcufriend.com) of which 1x display works perfectly with the driver ts7783 fond in this thread, but 4 x displays just shows garbled pixels ( which i think is what McAndrew got.. the differenc with my LCD's is that the serial output says " LCD test! Unknown driver, ID=0.."

Is there a way to manually locate ins software or physically on the hardware) which driver the LCD is using or is the driver the actual LCD?

Here's what my TFT looks like..


Thanks for any info

jstarcher

I just got a TFT that didn't work "out of the box" for me either.

Here is something you can try:


  • Copy the AdaFruit driver into a new directory

  • Rename the .cpp and .h files to match the directory name.  This creates a new library

  • Edit the .cpp

  • Edit the .cpp file and look for the line
Code: [Select]
uint16_t Adafruit_TFTLCD::readID(void) {,[/li]
[li]Add these right after that line:[/li][/list]
Code: [Select]
//return 0x9325;
//return 0x9328;
//return 0x9341;
//return 0x8357;
//return 0x7575;

[/li]
[li]Starting at the BOTTOM, uncomment the lines one by one and test, see if any of them work.[/li]
[li]If none of them work, re-comment all the lines then edit the .h file and comment (or uncomment) the line
Code: [Select]
//#define USE_ADAFRUIT_SHIELD_PINOUT 1

  • Try all the above return options again, remember to start at the BOTTOM



Took a while, but it worked for me.

As it turned out, even though my board was a shield, I had to configure the code to work as breakout.

After that it I had to experiment a bit more with the pins to get the touch screen working.

casemod

If it doesn't detect the driver don't fear. It may still be a 778x, but it is not being initialized, because the software has no idea what it is.

Code: [Select]

void setup()
{
  Serial.begin(9600);

  tft.reset();

  uint16_t identifier = tft.readID();

 
    Serial.print(F("Found LCD driver chip ID: "));
    Serial.println(identifier, HEX);
   
  tft.begin(identifier);


As you see the software reads the initializer and throws it on the init.

If there is no ID being read replace the above with:

Code: [Select]

void setup()
{
  Serial.begin(9600);

  tft.reset();
  tft.begin(0x9325);



The 0x9325 is a guess. Thats the only thing I have in my library, which you are likelly to be using. If not try one at the time as mentioned by  jstarcher:

Code: [Select]


0x9325;
0x9328;
0x9341;
0x8357;
0x7575;


There's no need to edit the .cpp. All is done within the sketch.

Lundin

Thank you both
Ah.. i tried so many different software packages i found and got sent to me a couple of different one's from the seller but i see now that the Adafruit one has all these other options.. and the 0X9341 saved the day for those that didn't work..  This is platinum quality help guys!

..and i think this should be excellent info in a sticky.. saves a ton of time and a bucket of headache figuring out.

Karma up to both of you!

rmohan10

Anybody has a working code for 2.8" arduino tft shield from www.mcufriend.com?

Pls help.

stez90

Anyone got one of those 2.4" ST7783 displays working with Arduino Due?
Using the libraries from previous post (with Mega pinout since they are the same) gives only pages of errors...

SWTFT+Adafruit GFX

Code: [Select]
Arduino:1.5.8 (Windows 7), Scheda:"Arduino Due (Programming Port)"

C:\Users\Stez\Documents\Arduino\libraries\SWTFT\mega_24_shield.h:89:18: note: in expansion of macro 'write8inline'
   #define write8 write8inline
                  ^
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\SWTFT.cpp:621:2: note: in expansion of macro 'write8'
  write8(lb);
  ^
In file included from C:\Users\Stez\Documents\Arduino\libraries\SWTFT\SWTFT.cpp:15:0:
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\mega_24_shield.h:63:5: error: 'PORTE' was not declared in this scope
     PORTE = (PORTE & B11001111) | ((d << 2) & B00110000); \
     ^
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\mega_24_shield.h:89:18: note: in expansion of macro 'write8inline'
   #define write8 write8inline
                  ^
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\SWTFT.cpp:622:2: note: in expansion of macro 'write8'
  write8(lb);
  ^
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\mega_24_shield.h:65:2: error: 'PORTG' was not declared in this scope
  PORTG = (PORTG & B11011111) | ((d << 1) & B00100000); \
  ^
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\mega_24_shield.h:89:18: note: in expansion of macro 'write8inline'
   #define write8 write8inline
                  ^
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\SWTFT.cpp:622:2: note: in expansion of macro 'write8'
  write8(lb);
  ^
C:\Users\Stez\Documents\Arduino\libraries\SWTFT\mega_24_shield.h:66:2: error: 'PORTH' was not declared in this scope
  PORTH = (PORTH & B11100111) | ((d >> 3) & B00011000); \

And so on, trimmed due to max lenght exceeded..
 

aguther

Hello.

  Also I purchased one 2.4 inch TFT touch screen supporting ( For UNO R3 ) labeled www.mcufriend.com and I try to put in function, but no good results just shows garbled pixels.
 Thanks in advence for any info.

Lundin

@stez90: It looks like the sketch is trying to declare something that the libraries can't resolve.... i tried to convert a similar project from the MEGA to the DUE and ran into sh#tload of errors because of incompatible libraries and different voltages... so i took another path.

Which sketch are you running?


@Aguther: All information you need to know should be found is in this thread.. the ts7787 driver worked for one of my TFT's but the other 4 needed a tweak in the ADAfruit.cpp setting the driver manually to x9341  to work properly as they all had the "unknown driver" error.

If it doesn't work with the x9341 you just have to try the next one and so on until you find which it is.

It also may work with the advice from casemod but i only tried jstarchers so i guess you'll have to find this out by yourself.

@rmohan10: The ADAfruit one's should be able to run the 2.8".. look at their pages to find the latest files.
Good luck

Lundin

Just for the sake of trying to help and knowing what headache i had trying to figure this out, here's some icecream for you:

Download the latest ADAfruit libraries and add them to where your userlibrary is located (mine is at: C:\Users\QUAD ONE\Documents\Arduino\libraries).

Load up the GraphicsTest.ino that comes with this library

In the GraphicsTest.ino, change the line:
Code: [Select]

uint16_t identifier = tft.readID();

to
Code: [Select]

uint16_t identifier = 0x9341;

This way you "hardcode" what driver should be used as it can't resolve this on it's own

If this doesn't work you can try to substitute with the other possibie types:

0x9325;
0x9328;
0x9341;
0x8357;
0x7575;

Good luck (again)

 

aguther

hello,

I have not succeeded yet, but I hope to find help to find the working solution and this garbled pixels to disappear and the shield is operate.

I try all this types:
0x9325;
0x9328;
0x9341;
0x8357;
0x7575;

without succes.

Go Up