Go Down

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

SujanW

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.
Friends,

I also have the same issue as aguther and i tried all your advices so far but non of them worked. From www.mcufriend.com site i found out that the control IC is ST7781 and from below address i found the specific library for the IC.
https://github.com/yamsam/TFTLCD_ST7781
yet i get this garbled pixals.

If someone can help me it would be great.
I spent this whole week trying to figure out this ?

Lundin

Friends,

I also have the same issue as aguther and i tried all your advices so far but non of them worked. From www.mcufriend.com site i found out that the control IC is ST7781 and from below address i found the specific library for the IC.
https://github.com/yamsam/TFTLCD_ST7781
yet i get this garbled pixals.

If someone can help me it would be great.
I spent this whole week trying to figure out this ?
Download the ST7781 found earlier in this thread.. it worked for one of my LCD's.. i'd suggest that you also open the serial monitor when running the code to see that it actually find the driver and that it - IS - the ST7781

It may well be that it isn't that driver even if it should.. the garbled pixels makes this somewhat obvious it's still a problem with the driver, or that Arduino couldn't make this out by running the code. I have tried so many drivers and libraries out there but what did the trick was to install the latest ADAfruit libraries and - manually - set the driver in the "Graphicstest.ino" sketch that comes with the libraries.

If you load and run the sketch and open the Serial monitor window and see what it gives for an answer when running the code.. If the serial monitor says " Unknown driver" when running the code.. then it's not ST7781...or it couldn't discern it.. in this case try to set this manually and you may as well have a winner


Also: If it is the ST7781, and you have set it manually,  but still doesn't work, make sure you have the latest libraries and no doubles of any library. It might be you installed a new library but Arduino still picks the old one.. No doubles - No troubles

Otherwise: Set up the sketch as you normally would before running it and post it here. It's way easier to help by seeing how the code is set up.. maybe there's something you'ver overlooked by trying over and over..

Cheers

SujanW

Lundin Thanks a lot for the advice mate.

I may be getting somewhere but I don't know if it is the right direction.
As you said I cleaned the library and kept only Adafruit libraries and ran Graphicstest.ino.
Bingo it says "unknown lcd driver chip c0c"
however going further with your advice I hardcoded all 5 types of drivers but yet no success.

It makes me wonder could there be another driver IC which we may have missed.
your thoughts are greatly appreciated.

Thanks in advance.

Lundin

#78
Dec 20, 2014, 09:33 pm Last Edit: Dec 20, 2014, 09:37 pm by Lundin Reason: Adding a link
Can you perhaps put up the little snippet of code to show how you made the changes? It seems fairly strange that none of them worked..
...but ofcourse.. mcufriend may have gone with a totally different driver.. nothing suprises me anymore regarding imported stuff..it's like russian roulette sometimes :)

It was the ST7783 i meant, not the ST7781

mcapurso

I bought a shield on ebay that has the text "aitendo UL024TF ILI9325"
It has a 2.4 TFTLCD , a touch screen and a SD reader with the following pins

Pins on the shield   Pin Arduino UNO

LCD_RST   A4
LCD_CS   A3
LCD_RS   A2
LCD_WR   A1
LCD_RD   A0

LCD_D2   D2
LCD_D3   D3
LCD_D4   D4
LCD_D5   D5
LCD_D6   D6
LCD_D7   D7

LCD_D0   D8
LCD_D1   D9

SD_SS   D10
SD_DI   D11
SD_DO   D12
SD_SCK   D13

Tested library TouchScreen from ladyada (AdaFruit) Touch-Screen-Library-master.zip

https://github.com/adafruit/Touch-Screen-Library

using example touchscreendemoshield
Pin used follow...

// These are the pins for the shield!
#define YP A1  // must be an analog pin, use "An" notation!
#define XM A2  // must be an analog pin, use "An" notation!
#define YM 7   // can be a digital pin
#define XP 6   // can be a digital pin

Tested library SD from ladyada  AdaFruit  https://github.com/adafruit/SD
using example SD_listfiles  with  CS set to 10
Pin used follow...

* SD card attached to SPI bus as follows:
 ** MOSI - pin 11
 ** MISO - pin 12
 ** CLK - pin 13
 ** CS - pin 10

For TFTLCD , used Adafruit TFTLCD-Library-master.zip from
https://github.com/adafruit/TFTLCD-Library
and Adafruit-GFX-Library-master.zip from
https://github.com/adafruit/Adafruit-GFX-Library

VERY IMPORTANT: THE PINOUT FOLLOWS THE adafruit 2.8" TFT Breakout Board Pinout
Therefore, before compiling, please go to Adafruit_TFTLCD.h in the libraries directory
and be sure to have commented the line that follows

// **** IF USING THE LCD BREAKOUT BOARD, COMMENT OUT THIS NEXT LINE. ****
// **** IF USING THE LCD SHIELD, LEAVE THE LINE ENABLED:             ****

//#define USE_ADAFRUIT_SHIELD_PINOUT 1

To test the shield please use the graphicstest example with some modifications,
considering that the chip in the aitendo shield has TWO VERY IMPORTANT
ISSUES:
1 - Answers 0 HEX to the request to identify the chip.
uint16_t identifier = tft.readID();
2 - The chip is a 9341 

Therefore, you have to change the first 85 lines , those preceding
tft.begin(identifier);
to what follows:

// IMPORTANT: Adafruit_TFTLCD LIBRARY MUST BE SPECIFICALLY
// CONFIGURED FOR EITHER THE TFT SHIELD OR THE BREAKOUT BOARD.
// SEE RELEVANT COMMENTS IN Adafruit_TFTLCD.h FOR SETUP.

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_TFTLCD.h> // Hardware-specific library

// The control pins for the LCD can be assigned to any digital or
// analog pins...but we'll use the analog pins as this allows us to
// double up the pins with the touch screen (see the TFT paint example).
#define LCD_CS A3 //
#define LCD_CD A2 //
#define LCD_WR A1 //
#define LCD_RD A0 //
#define LCD_RESET A4 //

// When using the BREAKOUT BOARD only, use these 8 data lines to the LCD:
// For the Arduino Uno, Duemilanove, Diecimila, etc.:
//   D0 connects to digital pin 8  (Notice these are
//   D1 connects to digital pin 9   NOT in order!)
//   D2 connects to digital pin 2
//   D3 connects to digital pin 3
//   D4 connects to digital pin 4
//   D5 connects to digital pin 5
//   D6 connects to digital pin 6
//   D7 connects to digital pin 7
// For the Arduino Mega, use digital pins 22 through 29
// (on the 2-row header at the end of the board).

// Assign human-readable names to some common 16-bit color values:
#define   BLACK   0x0000
#define   BLUE    0x001F
#define   RED     0xF800
#define   GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
// If using the shield, all control and data lines are fixed, and
// a simpler declaration can optionally be used:
// Adafruit_TFTLCD tft;

void setup(void) {
  Serial.begin(9600);
  Serial.println(F("TFT LCD test"));

#ifdef USE_ADAFRUIT_SHIELD_PINOUT
  Serial.println(F("Using Adafruit 2.8\" TFT Arduino Shield Pinout"));
#else
  Serial.println(F("Using Adafruit 2.8\" TFT Breakout Board Pinout"));
#endif

  Serial.print("TFT size is "); Serial.print(tft.width()); Serial.print("x"); Serial.println(tft.height());

  tft.reset();

  uint16_t identifier = tft.readID();

  if(identifier == 0x9325) {
    Serial.println(F("Found ILI9325 LCD driver"));
  } else if(identifier == 0x9328) {
    Serial.println(F("Found ILI9328 LCD driver"));
  } else if(identifier == 0x7575) {
    Serial.println(F("Found HX8347G LCD driver"));
  } else if(identifier == 0x9341) {
    Serial.println(F("Found ILI9341 LCD driver"));
  } else if(identifier == 0x8357) {
    Serial.println(F("Found HX8357D LCD driver"));
  } else {
    Serial.print(F("Unknown LCD driver chip: "));
    Serial.println(identifier, HEX);
    Serial.println(F("If using the Adafruit 2.8\" TFT Arduino shield, the line:"));
    Serial.println(F("  #define USE_ADAFRUIT_SHIELD_PINOUT"));
    Serial.println(F("should appear in the library header (Adafruit_TFT.h)."));
    Serial.println(F("If using the breakout board, it should NOT be #defined!"));
    Serial.println(F("Also if using the breakout, double-check that all wiring"));
    Serial.println(F("matches the tutorial."));
    // return;
  }

  //tft.begin(identifier);
  tft.begin(0x9341);

...

IT WORKS ! SOLVED

mcapurso

I bought a shield on ebay that has the text "aitendo UL024TF ILI9325"
It has a 2.4 TFTLCD , a touch screen and a SD reader with the following pins

Pins on the shield   Pin Arduino UNO

LCD_RST   A4
LCD_CS   A3
LCD_RS   A2
LCD_WR   A1
LCD_RD   A0

LCD_D2   D2
LCD_D3   D3
LCD_D4   D4
LCD_D5   D5
LCD_D6   D6
LCD_D7   D7

LCD_D0   D8
LCD_D1   D9

SD_SS   D10
SD_DI   D11
SD_DO   D12
SD_SCK   D13

Tested library TouchScreen from ladyada (AdaFruit) Touch-Screen-Library-master.zip

https://github.com/adafruit/Touch-Screen-Library

using example touchscreendemoshield
Pin used follow...

// These are the pins for the shield!
#define YP A1  // must be an analog pin, use "An" notation!
#define XM A2  // must be an analog pin, use "An" notation!
#define YM 7   // can be a digital pin
#define XP 6   // can be a digital pin

Tested library SD from ladyada  AdaFruit  https://github.com/adafruit/SD
using example SD_listfiles  with  CS set to 10
Pin used follow...

* SD card attached to SPI bus as follows:
 ** MOSI - pin 11
 ** MISO - pin 12
 ** CLK - pin 13
 ** CS - pin 10

For TFTLCD , used Adafruit TFTLCD-Library-master.zip from
https://github.com/adafruit/TFTLCD-Library
and Adafruit-GFX-Library-master.zip from
https://github.com/adafruit/Adafruit-GFX-Library

VERY IMPORTANT: THE PINOUT FOLLOWS THE adafruit 2.8" TFT Breakout Board Pinout
Therefore, before compiling, please go to Adafruit_TFTLCD.h in the libraries directory
and be sure to have commented the line that follows

// **** IF USING THE LCD BREAKOUT BOARD, COMMENT OUT THIS NEXT LINE. ****
// **** IF USING THE LCD SHIELD, LEAVE THE LINE ENABLED:             ****

//#define USE_ADAFRUIT_SHIELD_PINOUT 1

To test the shield please use the graphicstest example with some modifications,
considering that the chip in the aitendo shield has TWO VERY IMPORTANT
ISSUES:
1 - Answers 0 HEX to the request to identify the chip.
uint16_t identifier = tft.readID();
2 - The chip is a 9341 

Therefore, you have to change the first 85 lines , those preceding
tft.begin(identifier);
to what follows:

// IMPORTANT: Adafruit_TFTLCD LIBRARY MUST BE SPECIFICALLY
// CONFIGURED FOR EITHER THE TFT SHIELD OR THE BREAKOUT BOARD.
// SEE RELEVANT COMMENTS IN Adafruit_TFTLCD.h FOR SETUP.

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_TFTLCD.h> // Hardware-specific library

// The control pins for the LCD can be assigned to any digital or
// analog pins...but we'll use the analog pins as this allows us to
// double up the pins with the touch screen (see the TFT paint example).
#define LCD_CS A3 //
#define LCD_CD A2 //
#define LCD_WR A1 //
#define LCD_RD A0 //
#define LCD_RESET A4 //

// When using the BREAKOUT BOARD only, use these 8 data lines to the LCD:
// For the Arduino Uno, Duemilanove, Diecimila, etc.:
//   D0 connects to digital pin 8  (Notice these are
//   D1 connects to digital pin 9   NOT in order!)
//   D2 connects to digital pin 2
//   D3 connects to digital pin 3
//   D4 connects to digital pin 4
//   D5 connects to digital pin 5
//   D6 connects to digital pin 6
//   D7 connects to digital pin 7
// For the Arduino Mega, use digital pins 22 through 29
// (on the 2-row header at the end of the board).

// Assign human-readable names to some common 16-bit color values:
#define   BLACK   0x0000
#define   BLUE    0x001F
#define   RED     0xF800
#define   GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
// If using the shield, all control and data lines are fixed, and
// a simpler declaration can optionally be used:
// Adafruit_TFTLCD tft;

void setup(void) {
  Serial.begin(9600);
  Serial.println(F("TFT LCD test"));

#ifdef USE_ADAFRUIT_SHIELD_PINOUT
  Serial.println(F("Using Adafruit 2.8\" TFT Arduino Shield Pinout"));
#else
  Serial.println(F("Using Adafruit 2.8\" TFT Breakout Board Pinout"));
#endif

  Serial.print("TFT size is "); Serial.print(tft.width()); Serial.print("x"); Serial.println(tft.height());

  tft.reset();

  uint16_t identifier = tft.readID();

  if(identifier == 0x9325) {
    Serial.println(F("Found ILI9325 LCD driver"));
  } else if(identifier == 0x9328) {
    Serial.println(F("Found ILI9328 LCD driver"));
  } else if(identifier == 0x7575) {
    Serial.println(F("Found HX8347G LCD driver"));
  } else if(identifier == 0x9341) {
    Serial.println(F("Found ILI9341 LCD driver"));
  } else if(identifier == 0x8357) {
    Serial.println(F("Found HX8357D LCD driver"));
  } else {
    Serial.print(F("Unknown LCD driver chip: "));
    Serial.println(identifier, HEX);
    Serial.println(F("If using the Adafruit 2.8\" TFT Arduino shield, the line:"));
    Serial.println(F("  #define USE_ADAFRUIT_SHIELD_PINOUT"));
    Serial.println(F("should appear in the library header (Adafruit_TFT.h)."));
    Serial.println(F("If using the breakout board, it should NOT be #defined!"));
    Serial.println(F("Also if using the breakout, double-check that all wiring"));
    Serial.println(F("matches the tutorial."));
    // return;
  }

  //tft.begin(identifier);
  tft.begin(0x9341);

...

IT WORKS. SOLVED.

Lundin

Edit: Deleted post... have to revise my thinking before answering :)

I'm sure this question is a dup but I can't find the answer in the 6 pages of posting here:)  Anyway, I've found myself in the same boat as many having an LCD with a 7783 chip and no library.  Can someone point me to where I can find the libs for this display that will work on an UNO?  I've asked the manufacturer but I expect this will take 5 or 6 email before the light turns on.  Thanks in advance!


aguther

Hi,

Thank's for dias1973 for second test code on post #4, from http://forum.arduino.cc/index.php?topic=288425.0
also for me is work too on:
 - 3.5" LCD TFT for UNO R3 and also work on:
 - 2.4" LCD TFT for UNO R3

PS:
-this 2.4" LCD TFT for UNO R3 before this code just garbled pixels shows
reade posts #66 from:
 http://forum.arduino.cc/index.php?topic=223769.60

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy