Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

2.2" 18-bit color TFT LCD and Teensy: white screen only
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

2.2" 18-bit color TFT LCD and Teensy: white screen only

by phliar on Tue Jan 14, 2020 3:49 pm

Hi, I just got the 320x240 color TFT screen, and I'm trying to use it with a Teensy 4.0.

The TFT breakout is configured for SPI, and I'm using hardware SPI. I've doubled-checked all SPI connections with a multimeter. All the connections on the breakout are connected to the Teensy: based on previous messages here about the display, I bring the RESET line low, wait 1ms, then high.

The screen stays white. All the debugging values from "graphicstest" are 0x0. Prior messages in this forum point to a possible SPI wiring issue; but I've checked them all with a multimeter.

I've tried both the "Adafruit_ILI9341" lib and Paul Stoffregen's "ILI9341_t3" lib; same results on both, i.e. the screen stays white.

My sketch is a simple test program: bring RESET up, call begin(), fill the screen with black, draw one rectangle, one line, and text. I can post the code if required.

phliar
 
Posts: 6
Joined: Fri Dec 27, 2019 8:07 pm

Re: 2.2" 18-bit color TFT LCD and Teensy: white screen only

by phliar on Tue Jan 14, 2020 4:33 pm

I thought I might as well post the code, please delete this message if it's not required....

Code: Select all | TOGGLE FULL SIZE
// Use https://github.com/PaulStoffregen/ILI9341_t3 instead?
#define USE_T3

#include <SPI.h>
#include <Wire.h>

#ifdef USE_T3
#include <ILI9341_t3.h>
#else
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#endif

const int tftWidth = 320;
const int tftHeight = 240;

const int tftDC = 4;
const int tftCS = 10;
const int tftSDCS = 5;
const int tftReset = 6;

// HW SPI on the Teensy 4.0:
// SCLK = 13
// MISO = 12
// MOSI = 11

// The backlight pin on the TFT
const int8_t tftBacklight = 15;

// The TFT panel, using HW SPI.
#ifdef USE_T3
ILI9341_t3 tft = ILI9341_t3(tftCS, tftDC);
#else
Adafruit_ILI9341 tft = Adafruit_ILI9341(tftCS, tftDC);
#endif

const int tftFG = ILI9341_ORANGE;
const int tftBG = ILI9341_WHITE;
const int tftTXT = ILI9341_DARKGREEN;

void setup() {
    digitalWrite(tftReset, LOW);
    delay(1);
    digitalWrite(tftReset, HIGH);
    digitalWrite(tftBacklight, HIGH);

    tft.begin();
    tft.fillScreen(ILI9341_BLACK);

    Serial.begin(115200);
    while (!Serial)
        ;
    Serial.println("Started.");

    // 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);

    tft.setTextColor(tftTXT);
    tft.setTextWrap(false);

    tft.fillRect(5, 5, 100, 100, tftBG);
    tft.drawRect(5, 5, 100, 100, tftFG);
    tft.drawLine(5, 5, 100, 100, tftFG);

    tft.setCursor(6, 90);
    tft.print("Hello, world!");
}

void loop() {}


phliar
 
Posts: 6
Joined: Fri Dec 27, 2019 8:07 pm

Re: 2.2" 18-bit color TFT LCD and Teensy: white screen only

by adafruit_support_mike on Wed Jan 15, 2020 5:37 am

Post a photo showing your hardware and connections and we'll take a look. 800x600 images usually work best.

adafruit_support_mike
 
Posts: 61422
Joined: Thu Feb 11, 2010 2:51 pm

Re: 2.2" 18-bit color TFT LCD and Teensy: white screen only

by phliar on Wed Jan 15, 2020 12:08 pm

Thanks, here it is. The display goes into row G of the breadboard. (The wires go under the TFT breakout, so I popped it off to make the connections visible. Ignore the button and potentiometer, not used by the test sketch.)

IMG_1050.jpg
IMG_1050.jpg (91.79 KiB) Viewed 87 times

phliar
 
Posts: 6
Joined: Fri Dec 27, 2019 8:07 pm

Re: 2.2" 18-bit color TFT LCD and Teensy: white screen only

by paulstoffregen on Sun Jan 19, 2020 6:15 am

I have a test board here with that display (perhaps an earlier version?) that was meant to use Teensy 3.2.

Since Teensy 4.0 has SPI pins in the same locations, I put a Teensy 4.0 on it and run the ILI9341_t3 graphicstest example, to check if ILI9341_t3 running on Teensy 4.0 really work with this display.

Yup, works fine. Here's a photo:
Attachments
DSC_0696_web.jpg
DSC_0696_web.jpg (175.69 KiB) Viewed 67 times
Last edited by paulstoffregen on Sun Jan 19, 2020 6:20 am, edited 1 time in total.

paulstoffregen
 
Posts: 436
Joined: Sun Oct 11, 2009 11:23 am
Location: Portland, Oregon, USA

Re: 2.2" 18-bit color TFT LCD and Teensy: white screen only

by paulstoffregen on Sun Jan 19, 2020 6:16 am

Here's a photo of the wiring on the bottom side of that board.
Attachments
DSC_0697_web.jpg
DSC_0697_web.jpg (165.78 KiB) Viewed 67 times

paulstoffregen
 
Posts: 436
Joined: Sun Oct 11, 2009 11:23 am
Location: Portland, Oregon, USA

Re: 2.2" 18-bit color TFT LCD and Teensy: white screen only

by adafruit_support_mike on Sat Jan 25, 2020 1:53 am

Sorry for the delay.

The connections above look okay. Can you get the display to work with any other kind of microcontroller?

adafruit_support_mike
 
Posts: 61422
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.