ILI9488_t3 - Support for the ILI9488 on T3.x and beyond...

@mjs513 :D
Found that one.. In the drawChar function at about lines 2446 and 2453 you need to change writedata16_cont to write16BitColor.

Could upload it, or probably just as simple for you to edit... Or I could do PR ...
 
@KurtE
Damn - missed that one - was concentrating so much on the other functions.

One final issue - with that though. If I us FB it doesn't draw the black background when i do opaque now. Have to convert the rest of the function when using framebuffer to use color index instead of color I think. Think I will do that in the morning though - then I will update for the overlap changes you made. Then will update the master branch - after I test with the T3.6

Figured it had to be something I missed somewhere. Been playing with your ST7789 code - something weird going on with that one. Will post in the other thread
 
@KurtE and any else you wants to try it

I just pushed the changes to 9488 adafruit_font branch of the lib. Got the background color working but now getting a white line between blocks. Right now my eyes are crossed so will have to wait till morning I think.
 
@KurtE - fixed final issue with BG for non-gfx. Tomorrow the rest then the PR to the master
 
@KurtE - thanks for checking - I just finished incorporating your opaque and transparency changes. Just tested on the T4 and it looks like its working. I pushed the changes up to the 9488 adafruit_font branch. Going to test on the T3.6 and hopefully will then do the merge.
 
@mjs513 - As you know I asked yesterday (I wonder if... We could enable a 16 bit frame buffer on a T4.

So I thought I would try ;) My first pass (and maybe only pass) is that on T3.5/3.6 it always stays as 8 bits, but on T4, the library can be configured as either 8 bit or 16 bit... Currently too many places in .cpp file to make it easy to do on a sketch basis...

First pass: https://github.com/KurtE/ILI9488_t3/tree/T4_FB_non_pallet

Probably many issues... I have not tried it yet on T3.6... or configured the other way yet....

In this branch I also did some other changes including:

Allow tft.begin() to now include an SPI Speed. Found it useful on ST7735.. And I was hitting some flakiness so ...

Also found that some of the functions like were called by the frame buffer test had not been converted to use frame buffer. Like the calls:
Code:
  tft.writeRect1BPP(75, 100, 16, 16, pict1bpp, palette);
  tft.writeRect1BPP(320 - 90, 75, 16, 16, pict1bpp, palette);

  palette[2] = ILI9488_MAROON;
  palette[3] = ILI9488_PINK;
  tft.writeRect2BPP(75, 125, 32, 16, pict2bpp, palette);
I did this with a quick and semi-dirty fix...

Code:
void ILI9488_t3::writeRect2BPP(int16_t x, int16_t y, int16_t w, int16_t h, const uint8_t *pixels, const uint16_t * palette )
{
	[COLOR="#FF0000"]#ifdef ENABLE_ILI9488_FRAMEBUFFER
	if (_use_fbtft) {
		writeRectNBPP(x, y, w, h, 2, pixels, palette); 
		return;
	}
	#endif[/COLOR]
   	beginSPITransaction();
	setAddr(x, y, x+w-1, y+h-1);
	writecommand_cont(ILI9488_RAMWR);
...

But if you feel like it, you might give it a try and see what you think...
 
@mjs513... Forgot to ask, if you reading pixels is working on your display or not?

Sorry for the delay been out running errands most of the day and still have a couple more things to do. Nope - still having problems with reading pixels for 9341 and 9488. Meant to mention that but we were so tired up with the other stuff.
 
@mjs513... Forgot to ask, if you reading pixels is working on your display or not?

I went ahead and also ordered one of the Ebay ones which will probably be a few weeks from now...
 
KurtE said:
So I thought I would try My first pass (and maybe only pass) is that on T3.5/3.6 it always stays as 8 bits, but on T4, the library can be configured as either 8 bit or 16 bit... Currently too many places in .cpp file to make it easy to do on a sketch basis...

First pass: https://github.com/KurtE/ILI9488_t3/..._FB_non_pallet

Probably many issues... I have not tried it yet on T3.6... or configured the other way yet....
Will check it out - had a feeling you were going to go ahead and make the change

Allow tft.begin() to now include an SPI Speed. Found it useful on ST7735.. And I was hitting some flakiness so ...
That's a great addon. Thanks. I want to fix up the constructor as well.

Will give it a try as soon as I get done with home stuff :)
 
@KurtE

Just downloaded and tested with that FB_and_clip test sketch. Put it through its paces with DMA on/off and with Screen offset on the T4 and T3.6. Looks like the changes are working without an issue for both boards.

You ready to do the PR?

EDIT: Forgot - played with SPI Clock from tft.begin and that looks like it works as well on the T3.6
 
I've run in to an issue once I pull in the touchscreen library. The display will switch to rotation 4 by itself and the display will be mirrored (backwards). I have tried it on all 4 rotation and it always switches to mirrored rotation 4 If I remove the touchscreen library and code everything works fine. As well if I have the touchscreen library and code in the sketch but I disconnect the touchscreen from the t3.6 the display will work fine. I'm using a resistive touchscreen without a controller so all four pins are wired to the t3.6. Would I be better off trying to incorporate a touchscreen controller?
IMG_7229.jpg
IMG_7231.jpg

Code:
#include "SPI.h"
#include "ILI9488_t3.h"
#include "TouchScreen.h"

#define TFT_RST 8
#define TFT_DC 9
#define TFT_CS 10
ILI9488_t3 tft = ILI9488_t3(&SPI, TFT_CS, TFT_DC, TFT_RST);

#define YP A18
#define XM A19
#define YM 5
#define XP 6

#define TS_MINX 120
#define TS_MINY 50
#define TS_MAXX 920
#define TS_MAXY 940

TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);

#define MINPRESSURE 10
#define MAXPRESSURE 1000

void setup(){
  tft.begin();
  tft.setRotation(3);
  tft.fillScreen(ILI9488_BLACK);
  tft.setTextColor(ILI9488_GREEN, ILI9488_BLACK); tft.setTextSize(3);
}

void loop(){
  touchscreen();
}


void touchscreen(){
  TSPoint p = ts.getPoint();
  pinMode(XM, OUTPUT);
  pinMode(YP, OUTPUT);
  tft.setCursor(0,25);
  tft.print("Z=");
  tft.print(p.z);
  tft.print("  ");    
  if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {
    tft.setCursor(0,0);
    tft.print("X=");
    tft.print(p.x);
    tft.print("  ");
    tft.setCursor(200,0);
    tft.print("Y=");
    tft.print(p.y);
    tft.print("  ");
  }
}
 
@slapstick
Oops sorry just reread your post - using a touch screen without a controller on a T3.6.

I don't have a display like yours to test with. But just looking at the library I see no reason why it would do that, but I am still on my first cup of coffee.

Do you have a link to the display that you have.
 
Last edited:
@slapstick and @mjs513, I don't have the same display, I have one from BuyDisplay which has a completely different touch screen.

BUT I have run into the ILI9488 screwing up like you mentioned and end up with things reversed, and wrong orientation...

It is like somewhere the system sends out or the display at least thinks it has received a bogus: MADCTL command.

Which is one reason I added the ability to set the SPI speed as part of the begin method as part of the last update...
Maybe it is not handling the default SPI speed requested 30mhz or if your have your system configured to have F_BUS >= 64mhz... 64mhz...

When I was seeing the symptoms you mentioned, I did not see any rhyme or reason for it to happen.

I am also just on first half cup of coffee!
 
@KurtE - @Slapstick

Never ran into that problem before so something new for me as well. @Slapstick - you could reduce the SPI clock as @KurtE suggested but looking through the data sheet if you have a resistive touch its using a XPT2046 driver over SPI so you should try that library. Check the data sheet (pdf) for the display pages 9 and 10 for SPI connections. I am assuming you got the 4-wire version from SPI: https://www.buydisplay.com/download/manual/ER-TFT035-6_Datasheet.pdf
 
@mjs513 - Actually my current one has the Capacitive touch, which I never tried as the ones that I believe you and @defragster had was with the XPT2046...

I believe mine has the FT6236 chip. Probably should look up which library to use for it... As probably same chip(library) probably used for the capacitive touch RA8875 displays.
 
@mjs513 - Tried out the touch display on my BuyDisplay display, that I purchased on Ebay.

I modified an Adafruit touch paint program for capacitive display which in their library version was setup for ILI9341 display, so modified it for works with our library and for the larger display... Appears to work... SO added as an example sketch (PR back to you)
 
@KurtE

Just got back to reading posts. For some strange reason not getting notified from GitHub. I will go do it right now.
 
@mjs513

I was able to play around a little bit tonight.

If I read the datasheet correctly only the capacitive touchscreen uses the controller. The resistive touchscreen is XR,YD,XL,YU. What I did was connect the adafruit display (hx8357d) to the t3.6 but still had the ili9488 resistive touch screen connected to the t3.6. Everything worked fine displaying the points on the adafruit display, the display didn't switch to a mirrored display of rotation 4.

I was able to get the ili9488 to work properly if I reduce the spi clock speed like @KurtE suggested. At 19mhz the problem went away. At 20mhz the problem is still there. This slows the display down significantly. Do you know if there is something that can be done in order to bring the clock speed back up and not have the display rotate to rotation 4 and mirror the image?
 
Never used a hx8357d display and suprised that the ILI9488 library works with that controller. I did read on the Adafruit site for that display:

Remember, if you rotate the screen drawing with setRotation() you'll have to use map() or similar to flip around the X/Y coordinates for the touchscreen as well! It doesn't know about drawing rotation
 
My BuyDisplay ILI9488 display is the ER-TFTM035-6 type: I think it is more or less: https://www.buydisplay.com/default/...lay-module-optl-touch-screen-w-breakout-board

Again it took me a few seconds to realize that different PDF file... The one linked in to your display is without the M...

With the M option: Both types of touch panels go through a controller:
resistive - XPT2046 - Like our ILI9341 displays.
capacitive - FT6236 (I think like the RA8875 displays)...

So I am not really setup to debug this one. I believe the only thing the touchscreen library does is a couple of analogReads... so should not be anything very special...

Wondering if maybe should try a variant of your sketch that simply waits for lets say a second, and then calls your display code 10 times with only real short delays between calls and see if it screws up.

Sometimes it can also end up being just bad connections with jumpers. Or long lengths or ...
 
Another FYI - I took the program above and converted it to use the capactive touch library.... And so far I have not had the display reset directions...
Code:
#include "SPI.h"
#include "ILI9488_t3.h"
#include <Wire.h>      // this is needed for FT6206
#include <Adafruit_FT6206.h>


#define TFT_RST 8
#define TFT_DC 9
#define TFT_CS 10
ILI9488_t3 tft = ILI9488_t3(&SPI, TFT_CS, TFT_DC, TFT_RST);

#define TS_MINX 120
#define TS_MINY 50
#define TS_MAXX 920
#define TS_MAXY 940

// The FT6206 uses hardware I2C (SCL/SDA)
Adafruit_FT6206 ctp = Adafruit_FT6206();



#define MINPRESSURE 10
#define MAXPRESSURE 1000

void setup() {
  tft.begin();
  tft.setRotation(3);
  tft.fillScreen(ILI9488_BLACK);
  tft.setTextColor(ILI9488_GREEN, ILI9488_BLACK); tft.setTextSize(3);
  if (! ctp.begin(40)) {  // pass in 'sensitivity' coefficient
    Serial.println("Couldn't start FT6206 touchscreen controller");
    while (1);
  }
}

void loop() {
  touchscreen();
}


void touchscreen() {
  if (! ctp.touched()) {
    return;
  }

  // Retrieve a point
  TS_Point p = ctp.getPoint();
  tft.setCursor(0, 25);
  tft.print("Z=");
  tft.print(p.z);
  tft.print("  ");
  tft.setCursor(0, 0);
  tft.print("X=");
  tft.print(p.x);
  tft.print("  ");
  tft.setCursor(200, 0);
  tft.print("Y=");
  tft.print(p.y);
  tft.print("  ");
}
 
Back
Top