Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroSD So

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroSD So

Post by wfitkin »

New display not working.
I purchased a Adafruit 2.4 " LCD Touchscreen Breakout on 5/5/2022.
I am unable to get it to work, The back light works but when using the Example under Adafruit, ILI9341, graphicstest i only get a white screeen and nothing else eccept from the Serial Monitor I get
4740342
Text 255453
Lines 2374797
Horiz/Vert Lines 384945
Rectangles (outline) 244567
Rectangles (filled) 9447233
Circles (filled) 1120043
Circles (outline) 1031837
Triangles (outline) 539286
Triangles (filled) 3201198
Rounded rects (outline) 487844
Rounded rects (filled) 9780115
Done!
I am attaching some code & photos...
Showing connections
Showing connections
Proper connections.jpg (30.49 KiB) Viewed 515 times
Soldered jumpers
Soldered jumpers
3 Solder jumpers on back.jpg (26.67 KiB) Viewed 515 times
Working example with a SPI ILI9341 display showing the example.
Working example with a SPI ILI9341 display showing the example.
Working ILI9341.jpg (32.13 KiB) Viewed 515 times

Code: Select all

/***************************************************
  This is our GFX example for the Adafruit ILI9341 Breakout and Shield
  ----> http://www.adafruit.com/products/1651

  Check out the links above for our tutorials and wiring diagrams
  These displays use SPI to communicate, 4 or 5 pins are required to
  interface (RST is optional)
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution
 ****************************************************/


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

// For the Adafruit shield, these are the default.
#define TFT_DC 9
#define TFT_CS 10
#define TFT_MOSI 11
#define TFT_CLK 13
#define TFT_RST 8
#define TFT_MISO 12

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
// Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
// If using the breakout, change pins as desired
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);

void setup() {
  Serial.begin(9600);
  Serial.println("ILI9341 Test!"); 
 
  tft.begin();

  // read diagnostics (optional but can help debug problems)
  uint8_t x = tft.readcommand8(ILI9341_RDMODE);
  Serial.print("Display Power Mode: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDMADCTL);
  Serial.print("MADCTL Mode: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDPIXFMT);
  Serial.print("Pixel Format: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDIMGFMT);
  Serial.print("Image Format: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDSELFDIAG);
  Serial.print("Self Diagnostic: 0x"); Serial.println(x, HEX); 
  
  Serial.println(F("Benchmark                Time (microseconds)"));
  delay(10);
  Serial.print(F("Screen fill              "));
  Serial.println(testFillScreen());
  delay(500);

  Serial.print(F("Text                     "));
  Serial.println(testText());
  delay(3000);

  Serial.print(F("Lines                    "));
  Serial.println(testLines(ILI9341_CYAN));
  delay(500);

  Serial.print(F("Horiz/Vert Lines         "));
  Serial.println(testFastLines(ILI9341_RED, ILI9341_BLUE));
  delay(500);

  Serial.print(F("Rectangles (outline)     "));
  Serial.println(testRects(ILI9341_GREEN));
  delay(500);

  Serial.print(F("Rectangles (filled)      "));
  Serial.println(testFilledRects(ILI9341_YELLOW, ILI9341_MAGENTA));
  delay(500);

  Serial.print(F("Circles (filled)         "));
  Serial.println(testFilledCircles(10, ILI9341_MAGENTA));

  Serial.print(F("Circles (outline)        "));
  Serial.println(testCircles(10, ILI9341_WHITE));
  delay(500);

  Serial.print(F("Triangles (outline)      "));
  Serial.println(testTriangles());
  delay(500);

  Serial.print(F("Triangles (filled)       "));
  Serial.println(testFilledTriangles());
  delay(500);

  Serial.print(F("Rounded rects (outline)  "));
  Serial.println(testRoundRects());
  delay(500);

  Serial.print(F("Rounded rects (filled)   "));
  Serial.println(testFilledRoundRects());
  delay(500);

  Serial.println(F("Done!"));

}


void loop(void) {
  for(uint8_t rotation=0; rotation<4; rotation++) {
    tft.setRotation(rotation);
    testText();
    delay(1000);
  }
}

unsigned long testFillScreen() {
  unsigned long start = micros();
  tft.fillScreen(ILI9341_BLACK);
  yield();
  tft.fillScreen(ILI9341_RED);
  yield();
  tft.fillScreen(ILI9341_GREEN);
  yield();
  tft.fillScreen(ILI9341_BLUE);
  yield();
  tft.fillScreen(ILI9341_BLACK);
  yield();
  return micros() - start;
}

unsigned long testText() {
  tft.fillScreen(ILI9341_BLACK);
  unsigned long start = micros();
  tft.setCursor(0, 0);
  tft.setTextColor(ILI9341_WHITE);  tft.setTextSize(1);
  tft.println("Hello World!");
  tft.setTextColor(ILI9341_YELLOW); tft.setTextSize(2);
  tft.println(1234.56);
  tft.setTextColor(ILI9341_RED);    tft.setTextSize(3);
  tft.println(0xDEADBEEF, HEX);
  tft.println();
  tft.setTextColor(ILI9341_GREEN);
  tft.setTextSize(5);
  tft.println("Groop");
  tft.setTextSize(2);
  tft.println("I implore thee,");
  tft.setTextSize(1);
  tft.println("my foonting turlingdromes.");
  tft.println("And hooptiously drangle me");
  tft.println("with crinkly bindlewurdles,");
  tft.println("Or I will rend thee");
  tft.println("in the gobberwarts");
  tft.println("with my blurglecruncheon,");
  tft.println("see if I don't!");
  return micros() - start;
}

unsigned long testLines(uint16_t color) {
  unsigned long start, t;
  int           x1, y1, x2, y2,
                w = tft.width(),
                h = tft.height();

  tft.fillScreen(ILI9341_BLACK);
  yield();
  
  x1 = y1 = 0;
  y2    = h - 1;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = w - 1;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t     = micros() - start; // fillScreen doesn't count against timing

  yield();
  tft.fillScreen(ILI9341_BLACK);
  yield();

  x1    = w - 1;
  y1    = 0;
  y2    = h - 1;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = 0;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t    += micros() - start;

  yield();
  tft.fillScreen(ILI9341_BLACK);
  yield();

  x1    = 0;
  y1    = h - 1;
  y2    = 0;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = w - 1;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t    += micros() - start;

  yield();
  tft.fillScreen(ILI9341_BLACK);
  yield();

  x1    = w - 1;
  y1    = h - 1;
  y2    = 0;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = 0;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);

  yield();
  return micros() - start;
}

unsigned long testFastLines(uint16_t color1, uint16_t color2) {
  unsigned long start;
  int           x, y, w = tft.width(), h = tft.height();

  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(y=0; y<h; y+=5) tft.drawFastHLine(0, y, w, color1);
  for(x=0; x<w; x+=5) tft.drawFastVLine(x, 0, h, color2);

  return micros() - start;
}

unsigned long testRects(uint16_t color) {
  unsigned long start;
  int           n, i, i2,
                cx = tft.width()  / 2,
                cy = tft.height() / 2;

  tft.fillScreen(ILI9341_BLACK);
  n     = min(tft.width(), tft.height());
  start = micros();
  for(i=2; i<n; i+=6) {
    i2 = i / 2;
    tft.drawRect(cx-i2, cy-i2, i, i, color);
  }

  return micros() - start;
}

unsigned long testFilledRects(uint16_t color1, uint16_t color2) {
  unsigned long start, t = 0;
  int           n, i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  n = min(tft.width(), tft.height());
  for(i=n; i>0; i-=6) {
    i2    = i / 2;
    start = micros();
    tft.fillRect(cx-i2, cy-i2, i, i, color1);
    t    += micros() - start;
    // Outlines are not included in timing results
    tft.drawRect(cx-i2, cy-i2, i, i, color2);
    yield();
  }

  return t;
}

unsigned long testFilledCircles(uint8_t radius, uint16_t color) {
  unsigned long start;
  int x, y, w = tft.width(), h = tft.height(), r2 = radius * 2;

  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(x=radius; x<w; x+=r2) {
    for(y=radius; y<h; y+=r2) {
      tft.fillCircle(x, y, radius, color);
    }
  }

  return micros() - start;
}

unsigned long testCircles(uint8_t radius, uint16_t color) {
  unsigned long start;
  int           x, y, r2 = radius * 2,
                w = tft.width()  + radius,
                h = tft.height() + radius;

  // Screen is not cleared for this one -- this is
  // intentional and does not affect the reported time.
  start = micros();
  for(x=0; x<w; x+=r2) {
    for(y=0; y<h; y+=r2) {
      tft.drawCircle(x, y, radius, color);
    }
  }

  return micros() - start;
}

unsigned long testTriangles() {
  unsigned long start;
  int           n, i, cx = tft.width()  / 2 - 1,
                      cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  n     = min(cx, cy);
  start = micros();
  for(i=0; i<n; i+=5) {
    tft.drawTriangle(
      cx    , cy - i, // peak
      cx - i, cy + i, // bottom left
      cx + i, cy + i, // bottom right
      tft.color565(i, i, i));
  }

  return micros() - start;
}

unsigned long testFilledTriangles() {
  unsigned long start, t = 0;
  int           i, cx = tft.width()  / 2 - 1,
                   cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(i=min(cx,cy); i>10; i-=5) {
    start = micros();
    tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
      tft.color565(0, i*10, i*10));
    t += micros() - start;
    tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
      tft.color565(i*10, i*10, 0));
    yield();
  }

  return t;
}

unsigned long testRoundRects() {
  unsigned long start;
  int           w, i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  w     = min(tft.width(), tft.height());
  start = micros();
  for(i=0; i<w; i+=6) {
    i2 = i / 2;
    tft.drawRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(i, 0, 0));
  }

  return micros() - start;
}

unsigned long testFilledRoundRects() {
  unsigned long start;
  int           i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(i=min(tft.width(), tft.height()); i>20; i-=6) {
    i2 = i / 2;
    tft.fillRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(0, i, 0));
    yield();
  }

  return micros() - start;
}

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroS

Post by adafruit_support_carter »

It looks like the initial serial prints did not get included above. Can you run the sketch again and paste those lines here. They are the ones printed here, which contain some diagnostic information:
https://github.com/adafruit/Adafruit_IL ... no#L36-L46

See example expected output at the bottom of page here:
https://learn.adafruit.com/adafruit-2-4 ... iring-test

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroS

Post by wfitkin »

I only get this on the serial monitor when the breakout is connected...

4740342
Text 255453
Lines 2374797
Horiz/Vert Lines 384945
Rectangles (outline) 244567
Rectangles (filled) 9447233
Circles (filled) 1120043
Circles (outline) 1031837
Triangles (outline) 539286
Triangles (filled) 3201198
Rounded rects (outline) 487844
Rounded rects (filled) 9780115
Done!

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroS

Post by wfitkin »

Overview showing connections
Overview showing connections
Overview.jpg (27.97 KiB) Viewed 496 times
I have tried connecting two other ili9341 displays to the Arduino Nano 33 IoT controller and they display fine using the controller in the picture and the code I attached. They display the demo perfectly. The Adafruit breakout only turns on the backlight and never displays anything.
Using the following pins on all of them.
Vin is 3.3 volts
CLK on 13
MISO on 12
MOSI on 11
CS on 10
DC on 9
RST on 8

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroS

Post by wfitkin »

At home tonight i tested it again, Only the following on the Serial Monitor...

4740232
Text 255458
Lines 2374795
Horiz/Vert Lines 384945
Rectangles (outline) 244562
Rectangles (filled) 9447274
Circles (filled) 1120045
Circles (outline) 1031992
Triangles (outline) 539287
Triangles (filled) 3201173
Rounded rects (outline) 487845
Rounded rects (filled) 9780125
Done!

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroS

Post by wfitkin »

I did try this wired directly to an Arduino Uno R3. same result

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroS

Post by adafruit_support_carter »

The lines could be scrolling out of view in the Serial Monitor window. Try making the window bigger. Can also add a wait:

Code: Select all

void setup() {
  Serial.begin(9600);
  while (!Serial);
to wait for the Serial Monitor to be opened before printing out the text.

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroS

Post by wfitkin »

That did provide some more information. Thank you for your help with this.

Here is the new output... looks like all of the Serial.print information is there.

ILI9341 Test!
Display Power Mode: 0x0
MADCTL Mode: 0x0
Pixel Format: 0x0
Image Format: 0x0
Self Diagnostic: 0x0
Benchmark Time (microseconds)
Screen fill 4740383
Text 254324
Lines 2374799
Horiz/Vert Lines 384942
Rectangles (outline) 244567
Rectangles (filled) 9447192
Circles (filled) 1120042
Circles (outline) 1031874
Triangles (outline) 539291
Triangles (filled) 3201188
Rounded rects (outline) 487838
Rounded rects (filled) 9780117
Done!

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroS

Post by adafruit_support_carter »

Thanks. These are the lines that were of interest:

Code: Select all

ILI9341 Test!
Display Power Mode: 0x0
MADCTL Mode: 0x0
Pixel Format: 0x0
Image Format: 0x0
Self Diagnostic: 0x0
It's getting back all 0's for the various mode and format parameters. Those are being read back from the TFT. Getting all 0's is a good indication that there's a connection issue.

Please post a higher res photo of the soldering on the TFT header pins:
solder.jpg
solder.jpg (17.94 KiB) Viewed 462 times

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroS

Post by wfitkin »

Here are 2 photos
Here are 2 photos
ILI9341d.jpg (550.58 KiB) Viewed 456 times
ILI9341c.jpg
ILI9341c.jpg (797.57 KiB) Viewed 456 times

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroS

Post by adafruit_support_carter »

Thanks. A little hard to tell for sure, but is maybe the MISO pin a little thin / under soldered?
pins.jpg
pins.jpg (35.36 KiB) Viewed 438 times
And also maybe D/C and RST?

See here for reference:
https://learn.adafruit.com/adafruit-gui ... n-problems

Try adding a bit more solder to those to see if it helps. Same general check for goodness - run same sketch, should get some non-zero values back for the various settings.

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroS

Post by wfitkin »

I re flowed and added solder to all pins.

Here is a fresh output from the serial monitor

ILI9341 Test!
Display Power Mode: 0x0
MADCTL Mode: 0x0
Pixel Format: 0x0
Image Format: 0x0
Self Diagnostic: 0x0
Benchmark Time (microseconds)
Screen fill 4740481
Text 254327
Lines 2374797
Horiz/Vert Lines 384945
Rectangles (outline) 244565
Rectangles (filled) 9447239
Circles (filled) 1120045
Circles (outline) 1031997
Triangles (outline) 539293
Triangles (filled) 3201185
Rounded rects (outline) 487849
Rounded rects (filled) 9780132
Done!
Re-Soldered pins
Re-Soldered pins
Re-Soldered Pins.jpg (453.92 KiB) Viewed 430 times

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroS

Post by wfitkin »

Here is the Serial output from a WaveShare ILI9341. The sketch is running normally
ILI9341 Test!
Display Power Mode: 0x0
MADCTL Mode: 0x0
Pixel Format: 0x0
Image Format: 0x0
Self Diagnostic: 0x0
Benchmark Time (microseconds)
Screen fill 4740490
Text 254325
Lines 2374800
Horiz/Vert Lines 384945
Rectangles (outline) 244565
Rectangles (filled) 9447232
Circles (filled) 1120046
Circles (outline) 1031999
Triangles (outline) 539286
Triangles (filled) 3201175
Rounded rects (outline) 487845
Rounded rects (filled) 9780125
Done!
Working ILI9341 Waveshare display, same sketch, same board
Working ILI9341 Waveshare display, same sketch, same board
Working ILI9341 Waveshare display, same sketch, same board.jpg (607.23 KiB) Viewed 426 times

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroS

Post by wfitkin »

Hello,
I have done everything you asked of me can I get a warranty on this display?

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit 2.4" TFT LCD with Touchscreen Breakout w/MicroS

Post by adafruit_support_carter »

OK, let's just replace it and see what happens.

Send an email to [email protected] with a link to this thread and your order number and they can send you a replacement TFT.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”