Re: Need sample code for ILI9488 LCD on SPI Interface
Posted: Sun Sep 03, 2017 11:22 am
There are two sets of pin configuration in tftspi.h, one for ESP_WROVER_KIT and one for other boards, you should modify the pins defines in the second set (starting with #define PIN_NUM_MISO 19 // SPI MISO)
I have tested this library on 4 different boards with 3 different displays and never had a problem.
Yes, you can try to change #define SPI_BUS VSPI_HOST to #define SPI_BUS HSPI_HOST
Can you give more details what exactly hapens when you try to run the example?
Code: Select all
#ifdef CONFIG_EXAMPLE_ESP_WROVER_KIT
#define DISP_COLOR_BITS_24 0x66
#define TFT_INVERT_ROTATION 0
#define TFT_INVERT_ROTATION1 1
#define TFT_RGB_BGR 0x00
#define PIN_NUM_MISO 25 // SPI MISO
#define PIN_NUM_MOSI 23 // SPI MOSI
#define PIN_NUM_CLK 19 // SPI CLOCK pin
#define PIN_NUM_CS 22 // Display CS pin
#define PIN_NUM_DC 21 // Display command/data pin
#define PIN_NUM_TCS 0 // Touch screen CS pin
#define PIN_NUM_RST 18 // GPIO used for RESET control
#define PIN_NUM_BCKL 5 // GPIO used for backlight control
#define PIN_BCKL_ON 0 // GPIO value for backlight ON
#define PIN_BCKL_OFF 1 // GPIO value for backlight OFF
#define USE_TOUCH 0
#define DEFAULT_TFT_DISPLAY_WIDTH 240
#define DEFAULT_TFT_DISPLAY_HEIGHT 320
#define DEFAULT_GAMMA_CURVE 0
#define DEFAULT_SPI_CLOCK 26000000
#define DEFAULT_DISP_TYPE DISP_TYPE_ST7789V
#else
#define DISP_COLOR_BITS_24 0x66
//#define DISP_COLOR_BITS_16 0x55
// #############################################
// ### Set to 1 for some displays, ###
// for example the one on ESP-WROWER-KIT ###
// #############################################
#define TFT_INVERT_ROTATION 0
#define TFT_INVERT_ROTATION1 0
// ################################################
// ### SET TO 0X00 FOR DISPLAYS WITH RGB MATRIX ###
// ### SET TO 0X08 FOR DISPLAYS WITH BGR MATRIX ###
// ### For ESP-WROWER-KIT set to 0x00 ###
// ################################################
#define TFT_RGB_BGR 0x08
// ##############################################################
// ### Define ESP32 SPI pins to which the display is attached ###
// ##############################################################
#define PIN_NUM_MISO 19 // SPI MISO
#define PIN_NUM_MOSI 23 // SPI MOSI
#define PIN_NUM_CLK 18 // SPI CLOCK pin
#define PIN_NUM_CS 5 // Display CS pin
#define PIN_NUM_DC 26 // Display command/data pin
#define PIN_NUM_TCS 25 // Touch screen CS pin
Yes, you can try to change #define SPI_BUS VSPI_HOST to #define SPI_BUS HSPI_HOST
Can you give more details what exactly hapens when you try to run the example?