#define TFT_RST 23
#define TFT_DC 9
#define TFT_CS 10
#define TFT_DC 9
#define TFT_CS 32
#define TFT_RST 31
// used for XPT2046
#undef TOUCH_CS
#undef TOUCH_TIRQ
#define TOUCH_CS 26
#define TOUCH_TIRQ 27
ILI9488_t3 tft = ILI9488_t3(TFT_CS, TFT_DC, TFT_RST);
Right now I am running a 9488 (red one with same...) on a Teensy Micromod. On my same board I run it or the ILI9341.
I have not run that example in a long long time. Looks like maybe back when the T4 was was probably in beta mode.
The default pins in the sketch for ILI9488 looks like T4.x the defaults in that sketch are:
Which are not too bad.,Code:#define TFT_RST 23 #define TFT_DC 9 #define TFT_CS 10
My board was setup with some semi random pins for this:
And it appears to work fine with it. Note, I am not using any of the touch stuff in this sketch.Code:#define TFT_DC 9 #define TFT_CS 32 #define TFT_RST 31 // used for XPT2046 #undef TOUCH_CS #undef TOUCH_TIRQ #define TOUCH_CS 26 #define TOUCH_TIRQ 27 ILI9488_t3 tft = ILI9488_t3(TFT_CS, TFT_DC, TFT_RST);
On this board the Backlight is connected to +5v through a resistor. Which I think is something like 120... The ILI9341 product sheet shows 100
https://www.pjrc.com/store/display_ili9341_touch.html
That one is pretty simple. You might cut out all of the stuff to configure for different Teensy types, and then just put one pin configuration for which pins you are using.
If things still don't work, I tend to run a pin test sketch to verify the pins are the ones I think they are and that they are being detected.
I have included 0ne that @defragster and myself hacked on a long time ago
You can use the Serial terminal to alternate between setting all pins high or all pins low (PULL_UP or PULL_DOWN) and then you can use jumper wire to opposite, that is in PULL_UP mode, to GND. The program scans the pins for changes. So if you connect GND to lets say pin 10, it should print that out when you do it and show release when you undo...
And when you switch modes it tries to look for obvious shorts. That is if it sets pin 10 high and pin 11 also goes high it will flag that as possible...
Yesterday I got a DFROBOT DFR0669 display, which uses an ILI9488 chip. Because of my project based on the ILI9341_t3 display library. This library seems an easy change but i’ve got some/near poor performance. I draw a line 20pixel after 20pixel near every 40ms repeatedly and it gives a fragmented moving red line, it looks like the display refreshes slower the vertical axis than the horizontal or at least not in sync or something, I don't know that deeply...
(the picture is rotated down below. The x0,y0 origin is at the right top corner on the picture.)
I would to ask, Is this the max performance what I can expect from this display?
I tried with slower/faster SPI speeds, shorter wires, but nothing...
#include <SPI.h>
#include <ILI9488_t3.h>
#define TFT_RST 255
#define TFT_DC 9
#define TFT_CS 10
ILI9488_t3 tft = ILI9488_t3(&SPI, TFT_CS, TFT_DC, TFT_RST);
DMAMEM RAFB fb1[480 * 320];
#define SPI_SPEED 60000000
unsigned long previousMillis = 0;
long interval = 40;
int dummyX=10;
int dummyXI;
void setup() {
Serial.begin(9600);
tft.begin(SPI_SPEED);
tft.setRotation(3);
tft.setFrameBuffer(fb1);
tft.useFrameBuffer(true);
tft.fillScreen(ILI9488_BLACK);
tft.setTextColor(ILI9488_WHITE); tft.setTextSize(2);
tft.setCursor(20,65);
tft.print("HELLO");
tft.updateScreen();
delay(1500);
interval = 40;
}
void loop() {
unsigned long currentMillis = millis();
if(currentMillis-previousMillis >=interval){
previousMillis = currentMillis;
tft.fillScreen(ILI9488_BLACK);
testLines(ILI9488_CYAN);
tft.updateScreen();
}
}
unsigned long testLines(uint16_t color) {
unsigned long start, t;
int x1, y1, x2, y2,
w = tft.width(),
h = tft.height();
tft.fillScreen(ILI9488_BLACK);
x1 = y1 = 0;
y2 = h - 1;
start = micros();
for(x2=0; x2<w; x2+=6) {tft.drawLine(x1, y1, x2, y2, color); tft.updateScreen(); }
x2 = w - 1;
for(y2=0; y2<h; y2+=6) {tft.drawLine(x1, y1, x2, y2, color); tft.updateScreen(); }
t = micros() - start; // fillScreen doesn't count against timing
tft.fillScreen(ILI9488_BLACK);
x1 = w - 1;
y1 = 0;
y2 = h - 1;
start = micros();
for(x2=0; x2<w; x2+=6) {tft.drawLine(x1, y1, x2, y2, color); tft.updateScreen(); }
x2 = 0;
for(y2=0; y2<h; y2+=6) {tft.drawLine(x1, y1, x2, y2, color); tft.updateScreen(); }
t += micros() - start;
tft.fillScreen(ILI9488_BLACK);
x1 = 0;
y1 = h - 1;
y2 = 0;
start = micros();
for(x2=0; x2<w; x2+=6) { tft.drawLine(x1, y1, x2, y2, color); tft.updateScreen(); }
x2 = w - 1;
for(y2=0; y2<h; y2+=6) {tft.drawLine(x1, y1, x2, y2, color); tft.updateScreen(); }
t += micros() - start;
tft.fillScreen(ILI9488_BLACK);
x1 = w - 1;
y1 = h - 1;
y2 = 0;
start = micros();
for(x2=0; x2<w; x2+=6) {tft.drawLine(x1, y1, x2, y2, color); tft.updateScreen(); }
x2 = 0;
for(y2=0; y2<h; y2+=6) {tft.drawLine(x1, y1, x2, y2, color); tft.updateScreen(); }
return micros() - start;
}
#include <SPI.h>
#include <ILI9488_t3.h>
#define TFT_RST 255
#define TFT_DC 9
#define TFT_CS 10
ILI9488_t3 tft = ILI9488_t3(&SPI, TFT_CS, TFT_DC, TFT_RST);
DMAMEM RAFB fb1[480 * 320];
#define SPI_SPEED 60000000
unsigned long previousMillis = 0;
long interval = 40;
int dummyX=10;
void setup() {
Serial.begin(9600);
tft.begin(SPI_SPEED);
tft.setRotation(3);
tft.setFrameBuffer(fb1);
tft.useFrameBuffer(true);
tft.fillScreen(ILI9488_BLACK);
tft.setTextColor(ILI9488_WHITE); tft.setTextSize(2);
tft.setCursor(20,65);
tft.print("HELLO");
tft.updateScreen();
delay(1500);
interval = 40;
}
void loop() {
unsigned long currentMillis = millis();
if(currentMillis-previousMillis >=interval){
previousMillis = currentMillis;
tft.fillScreen(ILI9488_BLACK);
testLines(ILI9488_CYAN);
tft.updateScreen();
}
}
unsigned long testLines(uint16_t color) {
unsigned long start, t;
int x1, y1, x2, y2,
w = tft.width(),
h = tft.height();
tft.fillScreen(ILI9488_BLACK);
x1 = y1 = 0;
y2 = h - 1;
start = micros();
for(x2=0; x2<w; x2+=6) {tft.drawLine(x2, y1, x2, y2, color); tft.updateScreen(); } //x1 replaced by x2 to get straight lines.
t = micros() - start; // fillScreen doesn't count against timing
}