Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it support ILI9488 480x320 in 18bit mode #187

Closed
Super169 opened this issue Aug 11, 2018 · 37 comments

Comments

@Super169
Copy link

commented Aug 11, 2018

I have been using your library with 2.8 inch ILI9341 SPI TFT onitor, it works fine except the touch panel, I have to mix with the XPT2046_Touchscreen library to work with the touch panel.

And I just bought a new 3.5 inch ILI9488 SPI TFT monitor, I have tested the Setup21_ILI9488.h, it can only turn on the backlight, but cannot draw anything on screen.

As discussed with the seller, the ILI9488 is using 18bit instead of 16bit data, which is different from ILI9341, I'd like to like if this library support 18bit data? Thanks.

@Bodmer

This comment has been minimized.

Copy link
Owner

commented Aug 11, 2018

Yes, the library uses 18 bit for the ILI9488 wirh SPI. Setup 21 is for the ESP32. Check your connections are correct.

To provide more help I need more information on your setup.

@Bodmer

This comment has been minimized.

Copy link
Owner

commented Aug 11, 2018

Do not connect the TFT SDO (MISO) line if you have a touch controller fitted or intend to use an SD card as that line is permanently enabled on the display.

@Super169

This comment has been minimized.

Copy link
Author

commented Aug 11, 2018

Since I have already made a PCB for ILI9341 display, and both of them has the same pin layout (14 pin for TFT & Touch), I just replace the display with ILI9488 using same PCB, and I have updated the pin setting as using with ILI9341:

// For the M5Stack module use these #define lines
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
//#define TFT_CS 14 // Chip select control pin
#define TFT_CS 4 // Chip select control pin
#define TFT_DC 27 // Data Command control pin
#define TFT_RST 33 // Reset pin (could connect to Arduino RESET pin)
#define TFT_BL 32 // LED back-light

Since I also have the M5Stack, I just use similar setting as M5Stack, and only change CS to GPIO-4 as GPIO-14 is reserved for JTAG debug.

For the touch panel, I have merge those common SPI pin in the PCB, so they share the connection to GPIO 18, 19, 23 (i.e. CLK, MISO & MOSI), and I used touch panel's CS to GPIO-25, IRQ to GPIO-26.

THere has no problem sharing the MISO with TFT in XPT2046_Touchscreen, but it doesn't work in this library. So, I have mixed two library to make both working on my ILI9341 display.

But in ILI9488, I have tested with the examples for 480 x 320, but it doesn't work.

I have also try to define M5Stack in the header file of ILI9488 (just uncomment the line), but unfortunately, it doesn't work also.

@Bodmer

This comment has been minimized.

Copy link
Owner

commented Aug 14, 2018

Run the touch diagnostics sketch to see if the touch controller is working. Edit the pins if you need to in the sketch.

The TFT SDO line must be disconnected as it never goes tristate and thus there will be a bus drive conflict on the MISO line if you leave it connected.

@Super169

This comment has been minimized.

Copy link
Author

commented Aug 17, 2018

Yes, you are right. Without connecting TFT's SDO, I can use the touch function.
But there still have nothing to display.

@Bodmer

This comment has been minimized.

Copy link
Owner

commented Aug 17, 2018

I have connected up an ILI9488 display using the same connections as you have and it work fine...

Run the "Read_User_Setup" sketch and look at the serial output to make sure the pin settings and configuration is being picked up. Post the output here. Try a lower SPI frequency too.

Check your connections are good and check continuity if you can.

@Bodmer Bodmer closed this Aug 31, 2018
@Super169

This comment has been minimized.

Copy link
Author

commented Sep 1, 2018

Sorry for late reply as I was busy in these two weeks, and I just try to get a new TFT for testing, but have same result, only the touch works.

I have executed the sketch with the following output (the pin assignment is correct):
[code]
Processor = ESP32
Frequency = 240 MHz
Transactions = Yes
Interface = SPI
Display driver = 9488
Display width = 320
Display height = 480

MOSI = D23 (GPIO 23)
MISO = D19 (GPIO 19)
SCK = D18 (GPIO 18)
TFT_CS = D4 (GPIO 4)
TFT_DC = D27 (GPIO 27)
TFT_RST = D33 (GPIO 33)

Font GLCD loaded
Font 2 loaded
Font 4 loaded
Font 6 loaded
Font 7 loaded
Font 8 loaded
Smooth font enabled

Display SPI frequency = 27.0 MHz
[/code]

I have try reducing the Display SPI frequency to 10.0 MHz, it still have no display.

Maybe there has different ILI8488 display, and my TFT is different from yours, below is my TFT:
My TFT

My TFT back

@Bodmer

This comment has been minimized.

Copy link
Owner

commented Sep 1, 2018

Can you run the sketch attached. You will need to edit the pins used in the sketch and make sure the MISO pins is wired up. Post the results here.

This is what I get

Register 0x01: 0x00
Register 0x04: 0x548066
Register 0x09: 0x610000
Register 0x0A: 0x08
Register 0x0B: 0x00
Register 0x0C: 0x06
Register 0x0D: 0x00
Register 0x0E: 0x00
Register 0x0F: 0x00
Register 0x2E: 0x00
Register 0x3F: 0x00
Register 0xDA: 0x56
Register 0xDB: 0x80
Register 0xDC: 0x66

Read_ID_bitbash_ESP32.zip

@Bodmer Bodmer reopened this Sep 1, 2018
@Bodmer

This comment has been minimized.

Copy link
Owner

commented Sep 1, 2018

Post a link to the TFT seller page too so I can have a look. Many retailers do not know what driver is fitted and get it wrong!

@Super169

This comment has been minimized.

Copy link
Author

commented Sep 2, 2018

Below is the result of Read_ID_bitbash_ESP32:

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:952
load:0x40078000,len:6084
load:0x40080000,len:7944
entry 0x40080310
TFT driver register values:

Register 0x01: 0x00
Register 0x04: 0x00
Register 0x09: 0xFF00000
Register 0x0A: 0x00
Register 0x0B: 0x00
Register 0x0C: 0x07
Register 0x0D: 0x84
Register 0x0E: 0x00
Register 0x0F: 0x02
Register 0x2E: 0x00
Register 0x3F: 0x10000000
Register 0xDA: 0x00
Register 0xDB: 0x00
Register 0xDC: 0x00

I bought the TFT from China Taobao, detail information can be found in: http://www.lcdwiki.com/zh/3.5inch_SPI_Module_ILI9488_SKU:MSP3520

They only provided the sample for C51 & STM32, and they claimed that the sample for ESP8266 will be available soon.

BTW, I found that they also mentioned this one is using ILI9486 in the production description (https://item.taobao.com/item.htm?id=574941281220), is there any difference between 9488 and 9486? The setup 5, 6, 10, 11 seems for another 9486.

Thanks a lot.

@Bodmer

This comment has been minimized.

Copy link
Owner

commented Sep 3, 2018

I suspect a different controller is fitted. We could try the ILI9486 init code but we will have to "fool" the library into using 18 bits, I think this is possible by defining both ILI9486 and ILI9488 in the setup:

#define ILI9488_DRIVER
#define ILI9486_DRIVER

Then in your sketch, in setup() after tft.init() add these lines to switch the display to 18 bit:

tft.writecommand(0x3A); // Pixel Interface Format
tft.writedata(0x66);  // 18 bit colour for SPI

Let me know if this works. I have ordered one of those displays to test but it will take a few weeks to be delivered from China.

@Super169

This comment has been minimized.

Copy link
Author

commented Sep 9, 2018

Thanks a lot.
I have tried your suggestion, but still no display.
I don't know if this is the problem of my display, I have received a testing program from the seller, which is a sample running on D1 mini, which only fill the screen with solid color, but it also failed in my displays. I have tested with 2 D1 mini and 1 D1 mini pro board, so it shouldn't be the program of the mcu.

Hoping that you can make it work, as it's really a very cheap display. I'd like to use it in my ESP32 projects.

@Super169

This comment has been minimized.

Copy link
Author

commented Sep 9, 2018

Just make the D1 mini sample works.

The sample code has provided a wrong pin setting, default CS for SPI in D1 mini is D8, but it has marked as D1. After changing the pin, it works now.

My TFT D1 mini

I have upload the D1 mini sample here (note, CS should be D8) https://github.com/Super169/images/blob/master/Others/clear_Screen.ino

It may compare the code sending in this sample.

@Super169

This comment has been minimized.

Copy link
Author

commented Sep 10, 2018

Just try to port the code to ESP32 by changing the pin setting for SPI, it works with my pin assignment:
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 4 // Chip select control pin
#define TFT_DC 27 // Data Command control pin
#define TFT_RS 27 // DC / RS is the same
#define TFT_RST 33 // Reset pin (could connect to Arduino RESET pin)
#define TFT_BL 32 // LED back-light

My ESP32 TFT

Need to compare the initialization code between the sample and yours.

@Bodmer

This comment has been minimized.

Copy link
Owner

commented Sep 10, 2018

It would be possible to include TFT_eSPI, run tft.init(), then run the unit code from the sketch you have, then the library functions should then work. My display is expected to arrive this week, so I can test it.

@Bodmer Bodmer closed this Sep 10, 2018
@Bodmer Bodmer reopened this Sep 10, 2018
@Super169

This comment has been minimized.

Copy link
Author

commented Sep 11, 2018

Yes, you are right.

If I replace the tft.init() with the initialization code from the sample, I can use the TFT by your library. But the image is mirrored, I have tested with different rotation value (0 ~ 3), it's still mirrored.

Then I try to replace ILI9488_Rotation.h with ILI9486_Rotation.h, it become normal for rotation 4 ~ 7. Maybe this display is using ILI9486 instead of ILI9488.

The following screen is running with setRotataion(5), and using ILI9486_Rotation.h.
TFT

@Bodmer

This comment has been minimized.

Copy link
Owner

commented Sep 11, 2018

OK, that is good to know. I expect the display I ordered will arrive soo so I willl test it and if necessay create a dedicated driver.

@Bodmer

This comment has been minimized.

Copy link
Owner

commented Sep 13, 2018

My display arrived today, it is visually identical to yours. I connected it up to an ESP8266 and used Setup20_ILI9488.h and it worked fine without any changes to the library. I connected it to an ESP32 and used Setup21_ILI9488.h and it worked fine without any changes to the library.

I ran the sketch here that you posted on the ESP8266 with the pins changed to suit and it worked fine. I ran the same sketch on the ESP32 with the pins changed to suit and it ran fine.

I can only conclude that either you have a different display or that your setup is not correct. As the display I have works fine in all my tests I cannot help further. However as you have a setup that works then you have a workable system to experiment with.

@Bodmer Bodmer closed this Sep 13, 2018
@Super169

This comment has been minimized.

Copy link
Author

commented Sep 14, 2018

Thanks for your support, and I do appreciate your help.

You can connected it to an ESP32 and used Setup21_ILI9488.h and it worked fine without any changes to the library, that means your library should work with this TFT.

I'm sorry that it has wasted your time and money, and it seems to be my fault in some setting, but unforunately, I have tested again and again today, I still cannot make it work directly using the ILI9288 setting. But if I added the initialization code after tft.init(), and replace the ILI9488_Rotation.h with ILI9486_Rotation.h, everything works fine.

Below is the step I have done to use the dirvre for my TFT, I'm using vscode with PlatformIO.

  1. Create a project in vscode

  2. Delete main.cpp (it will use the example from the library)

  3. Download the library under lib: git clone https://github.com/Bodmer/TFT_eSPI.git

  4. Copy TFT_Meters.ino from examples\480x320\TFT_Meters to src folder

  5. In User_Setup_Select.https

    • Comment #include <User_Setup.h>
    • Uncomment #include <User_Setups/Setup21_ILI9488.h>
  6. In User_Setups\Setup21_ILI9488.h
    Modify the pin setting (line 117 ~ 122) as below

    #define TFT_MISO 19 // (leave TFT SDO disconnected if other SPI devices share MISO)
    #define TFT_MOSI 23
    #define TFT_SCLK 18
    #define TFT_CS 4 // Chip select control pin
    #define TFT_DC 27 // Data Command control pin
    #define TFT_RST 33 // Reset pin (could connect to RST pin)
    #define TFT_BL 32 // LED back-light

If I test the program now, it will have no display. May I know if I have missed anything?

But if I continue with the following steps, it works fine.

  1. In TFT_Drivers folder, replace ILI9488_Rotation.h with ILI9486_Rotation.h

  2. In TFT_Meters.ino (You can find the modified ino here: https://github.com/Super169/images/blob/master/Others/TFT_Meters.fix.ino )

    • Add the initialization function from D1 mini sample
    • Modify the setup() function to call the initializaiton as below
      // tft.init();
      // tft.setRotation(1);
      GPIO_Init();
      TFT_Init();
      pin_init();
      Lcd_Init();
      tft.setRotation(5);

If I test the program again now, it works fine.

SO, the pin assignment should be correct, and I have checked many times, I'm sure they should be connected as below,

VCC    - 3V3
GND    - GND
CS     - GPIO-4
Reset  - GPIO-33
DC     - GPIO-27
MOSI   - GPIO-23
SCK    - GPIO-18
LED    - GPIO-32
MISO   - Not connected

Would you please help to check if I have missed anything in step 1 - 6?

Thanks a lot.

@Super169

This comment has been minimized.

Copy link
Author

commented Sep 14, 2018

I found something interesting, and I can solve the problem by setting GPIO-32 to high.

As you said that, you can connected it to an ESP32 and used Setup21_ILI9488.h and it worked fine without any changes to the library. "without any changes" - give me the idea that there may have something missing in the pin connection.

So this time, I do not use my PCB, and try to connect the TFT using your setting, i.e.
CS - GPIO-15 (I use 4)
DC - GPIO-2 (I use 27)
RST - GPIO-4 (I use 33)
BL - GPIO-32

In fact, I have try this before, there has no display also. And this time, I cannot see anything on the monitor at first. But I think that our monitor should be the same, both of them works fine (as I can display with the initialization code). When I put the TFT close to my eye, I found that it has display, but very very dark.....almost the same as the background.

So I try to connect with my setting again, but this time I can't see anything also. I assume that this time is really too dark, so I try to connect the LED to 3V3, it works now.

So I added the following code after tft.init() and remove the connection from LED to 3V3.
pinMode(32, OUTPUT);
digitalWrite(32, HIGH);

It works fine now.

It seems that the initialization code for ILI9488 has not set TFT_BL to HIGH.

May I know if you have connected LED to GPIO-32 or 3V3 directly?

@Super169

This comment has been minimized.

Copy link
Author

commented Sep 14, 2018

After compare the code for ILI9341 and ILI9488, I have to say sorry that I have missed something when using ILI9341. As I just follow the setting in a M5Stack device, which has define M5Stack in code.
In ILI9341_init.h, it has set TFT_BL to HIGH if M5Stack is defined.

#ifdef M5STACK
// Turn on the back-light LED
digitalWrite(TFT_BL, HIGH);
pinMode(TFT_BL, OUTPUT);
#endif

But for other TFT, it will not set TFT_BL to HIGH, and it has not set TFT_BL pin as OUTPUT also. And I didn't aware such difference.

However, as TFT_BL will not set HIGH, does it mean that it will expect LED pin is connecting to 3V3 directly (or any hardware switch), and it's not expect to change the black light in code?

Would it be better to turn on the black light if TFT_BL is defined?
I have added the following code in ILI9488_Init.h:

#if defined (TFT_BL)
pinMode(TFT_BL, OUTPUT);
digitalWrite(TFT_BL, HIGH);
#endif

So it will use the TFT_BL if defined.

But it seems that TFT_BL is always defined as 32, and it will not be used in the library, isn't it?

@Bodmer

This comment has been minimized.

Copy link
Owner

commented Sep 14, 2018

Thanks for the update. As you have found the library does not control the back light line as it is simple for the user sketch to do this, so you have come up with the right solution.

Good luck with your project!

@FLYINGSC0T

This comment has been minimized.

Copy link

commented Apr 26, 2019

Hi Bodmer, I've been using the library for a ILI9341 display sucessfully with touch and no problems.

Here are my defines:
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 5
#define TFT_DC 2
#define TFT_RST 4
#define TOUCH_CS 21

However, when I try compiling for a ILI9488 display I get a compiler error for the ESP32 - I've changed user setup files accordingly.

Any idea what is going wrong ?

Thanks in advance for any ideas.

Regards.
George

@lloydch

This comment has been minimized.

Copy link

commented May 7, 2019

I had the same problem using the Arduino IDE when I had Compiler warnings in Preferences set to More, setting it to Default the errors change to warnings and it does compile and work.

Lloyd.

@Bodmer

This comment has been minimized.

Copy link
Owner

commented May 7, 2019

Show an example error please. I use "All" in the preferences for the compiler and get no warnings or errors.

Run the "Read_User_Setup" diagnostic if you can to make sure the compiler is picking up the settings correctly.

@FLYINGSC0T

This comment has been minimized.

Copy link

commented May 9, 2019

@Bodmer

This comment has been minimized.

Copy link
Owner

commented May 9, 2019

Set Compiler warnings in Preferences to Default, make sure you click the OK button. I suspect the the Arduino IDE does not use the new preferences in some cases unless the IDE is shut down after doing this and is reloaded.

@FLYINGSC0T

This comment has been minimized.

Copy link

commented May 10, 2019

Hi Bodmer,

Here's the output from running Read_User_Setup with Preferences set to Default (IDE Shutdown and restarted):

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:808
load:0x40078000,len:6084
load:0x40080000,len:6696
entry 0x400802e4

[code]
Processor = ESP32
Frequency = 240 MHz
Transactions = Yes
Interface = SPI
Display driver = 9341
Display width = 240
Display height = 320

MOSI = D23 (GPIO 23)
MISO = D19 (GPIO 19)
SCK = D18 (GPIO 18)
TFT_CS = D5 (GPIO 5)
TFT_DC = D2 (GPIO 2)
TFT_RST = D4 (GPIO 4)

TOUCH_CS = D21 (GPIO 21)

Font GLCD loaded
Font 2 loaded
Font 4 loaded
Font 6 loaded
Font 7 loaded
Font 8 loaded
Smooth font enabled

Display SPI frequency = 40.0 MHz
Touch SPI frequency = 2.5 MHz
[/code]

When I compile for ILI9341 Read_User_Setup compiles and runs ok.
When I compile for ILI9488 Read_User_Setup fails to compile with error:

exit status 1
Error compiling for board ESP32 Dev Module.

@Bodmer

This comment has been minimized.

Copy link
Owner

commented May 10, 2019

I will investigate but it will be some time before I will be able to check.

@pfisterer

This comment has been minimized.

Copy link

commented Jun 1, 2019

Dear All,
Maybe I have a similar issue - or I'm doing sth fundamentally wrong... My display also does not show anything. Any ideas?

I've also tried User_Setups/Setup20_ILI9488.h and the following connections:

NodeMCU Display
3V3 LED
CLK SCK
SD1 SDI (MOSI)
D3 DC/RS
D4 RESET
D8 CS
GND GND
3V3 VCC

I bought the display from here: https://www.aliexpress.com/item/3-5-inch-TFT-LCD-Module-with-Touch-Panel-ILI9488-Driver-320x480-SPI-port-serial-interface/32954128438.html?spm=a2g0s.9042311.0.0.21f34c4d0dexaE.

IMG_4340
IMG_4341
IMG_4342
IMG_4343

@FLYINGSC0T

This comment has been minimized.

Copy link

commented Jun 1, 2019

Hi Dennis,

Just an idea as I don't have any experience with the ESP8266 only with ESP32's.

Your VCC voltage is set for 3V3. I use 5V for the VCC with no problems on the 3.2 inch displays which have the same pinouts as the display you're using. For the LED I always set at 3V3. Maybe this is the problem (?).

I have actually got my sketches to compile now for the ILI9488 displays with Preferences set to Default. The problem (I believe) was a missing terminating ">" character in the User_Setup_Select.h file. Absolutely my fault but I found the problem by scrutinizing very carefully the output from the compiler. Also, I cleared out duplicate files that the compiler was reporting from the Arduino directories.

Hope any of this helps but if not post your solution.

Regards,
George

@Bodmer

This comment has been minimized.

Copy link
Owner

commented Jun 1, 2019

You must use these pins, not the Flash SPI pins:

// Display SCK to NodeMCU pin D5
// Display SDI/MOSI to NodeMCU pin D7

@pfisterer

This comment has been minimized.

Copy link

commented Jun 2, 2019

Great, thank you and sorry for bothering you with this newbie issue. Best regards, Dennis

@Dancopy

This comment has been minimized.

Copy link

commented Aug 30, 2019

Hi Dennis! And to all participants!
Did you get any sketch for your display?
I have a display just like yours and would like to use it but, it's hard to find any sketch, for example, clock or anything else.
If you, or others, or Bodmer (author of this excellent library) can share something with me, my email is: meuviolino@hotmail.com
Thank you very much,
Daniel

@FLYINGSC0T

This comment has been minimized.

Copy link

commented Aug 30, 2019

Hi Dancopy,

I have exactly the same ILI9488 display as yours and have got it to work. use the Setup21_ILI9488.h file as follows:

// See SetupX_Template.h for all options available

#define ILI9488_DRIVER

//#define TFT_INVERSION_OFF

#define TFT_MISO 19 // (leave TFT SDO disconnected if other SPI devices share MISO)
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 5 // Chip select control pin
#define TFT_DC 2 // Data Command control pin
#define TFT_RST 4 // Reset pin (could connect to RST pin)

#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen

#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts

#define SMOOTH_FONT

// #define SPI_FREQUENCY 20000000
#define SPI_FREQUENCY 27000000
// #define SPI_FREQUENCY 40000000
// #define SPI_FREQUENCY 80000000

// Optional reduced SPI frequency for reading TFT
#define SPI_READ_FREQUENCY 16000000

#define SPI_TOUCH_FREQUENCY 2500000

If you have other SPI devices connected leave the TFT_MISO GPIO disconnected (GPIO 19 on my configuration). I've found that the ILI9488 display works even if GPIO 19 is not connected. The touch works also.

Remember to define IL9488 driver and Setup21_ILI9488.h in the appropriate User Setup files appropriately even although ILI9488 is defined in the Setup21_ILI9488.h file. Also, to use the latest TFT_eSPI library !!

Good luck and hope this helps and works for you.

@pfisterer

This comment has been minimized.

Copy link

commented Aug 30, 2019

I also got it to work with an ESP8266 and ESP32. I'm using platformio - so I defined the configuration in platformio.ini as follows:

ESP8266:

build_flags =
 -I$PROJECT_DIR/include/
 -DUSER_SETUP_LOADED=1
 -DILI9488_DRIVER=1
 -DTFT_MOSI=13
 -DTFT_SCLK=14
 -DTFT_CS=15
 -DTFT_DC=0
 -DTFT_RST=2
 -DLOAD_GLCD=1
 -DSPI_FREQUENCY=27000000

ESP32 (note that it worked only after reducing SPI_FREQUENCY):

build_flags =
 -I$PROJECT_DIR/include/
 -DUSER_SETUP_LOADED=1
 -DILI9488_DRIVER=1
 -DTFT_MOSI=23
 -DTFT_SCLK=18
 -DTFT_CS=15
 -DTFT_DC=2
 -DTFT_RST=4
 -DLOAD_GLCD=1
 -DSPI_FREQUENCY=20000000

Sketch:

#include <Arduino.h>
#include <SPI.h>
#include <TFT_eSPI.h>

void setup() {
 tft.init();
 tft.setRotation(1);  // 0 & 2 Portrait. 1 & 3 landscape
}

void loop() {
 tft.fillScreen(TFT_BLACK);
 delay (1000);
 tft.fillScreen(TFT_RED);
 delay (1000);
}
@Dancopy

This comment has been minimized.

Copy link

commented Aug 30, 2019

Hi George, thanks for the reply. I already answered your email.
Would you have any sketches ready (Clock or something else) to share with me? I am an apprentice in Arduino and have a hard time with these codes.
Thanks,
Daniel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.