Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By wooduino.ca
#45691 I wonder whether anyone can assist here.
I purchased a 2.4" TFT LCD Touchscreen (IL19341) and I have been unable to get it to operate on the WeMos D1 R2 board using SPI.
I have tried just about every library I can find - even those that are deemed to be ESP8266 enhanced - but I get nothing but a blank white screen.
I have used an oscilloscope to test that the SPI interface (SCLK, MOSI and CS) is running and it appears fine, although clearly running fast.
Any ideas as to what to check?

Many thanks,
Adrian Jones
http://www.wooduino.ca
User avatar
By picstart
#45700 Often the issue is with the init routine that is lengthy specific to a controller and has almost no tolerance for any changes
..... below is Arduino 1.6.5 IDE code for a 2.8" LCD with a touch screen it uses a 12E but it was short pins so GPIO9 and GPIO10 are freed by lifting the pins on the flash chip. It has the defines just in case you have something amiss and it references a commercial LCD driver form Adafuit.
It does work.

Code: Select all/// notes
/// the esp12e USES qio FOR THE PROGRAM FLASH
/// the places GOPI10 and GPIO9 as unavailable
/// unless the flash inside the can is removed and pins 3 and 7 lifted
/// pin 3 is wired to 7 and then to 3.3v
/// pads 3 and 7 are connected to GPIO9 and GPIO10
/// since GPIO9 and GPIO10 are now free and then set the FLASH to DIO mode
//// QIO will now not work
/// DIO mode maybe is the default for the arduino IDE NodeMCU v1 12E board
///       +--------+
///   _CS |1      8| 3.3v
///    DO |2      7| _HOLD
///   _WP |3      6| CLK
///   GND |4      5| DI
///       +--------+
///       25Q32   4m byte flash

///////////////////////////Pin outs lolin esp12E //////////
// D0-GPI016 Wake
// D1-GPIO5-->T-IRQ ILI9341
// D2-GPIO4-->T-CS  ILI9341
// D3-GPIO0 Flash
// D4-GPIO2-->D/C ILI9341
// 3.3v
// Gnd        ReSet ILI9341
// D5-GPIO14 |-->SCK ILI9341
//           |-->T-ClK ILI9341
//
// D6-GPIO12 |-->MISO ILI9341
//           |-->T-DO ILI9341
//
// D7-GPIO13 |-->MOSI ILI9341
//           |-->T-DIN ILI9341
//
// D8-GPIO15-->CS ILI9341
// D9-GPI03  RX
// D10-GP01  TX
///////////////////////////////////////////////////////////
// modded to add two buttons the original was for one button
// Adafruit_GFX_Button button;  original
// Adafruit_GFX_Button buttons[2]; for two
/// SPI MOSI MISO CLK use hardware SPI
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <SPI.h>
#include <SD.h>
#include <Ticker.h>
#include <Adafruit_ILI9341esp.h>
#include <Adafruit_GFX.h>
#include <XPT2046.h>

// Modify the following two lines to match your hardware
// Also, update calibration parameters below, as necessary

// For the esp shield, these are the default.
#define TFT_DC 2
#define TFT_CS 15

#define Touch_CS 4
#define Touch_IRQ 5
#define SD_CS 9
// For esp8266 chipSelect 9 is GPIO9 SD2 needs flash 3 7 pins lifting
//const int SD_CS = 9;

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
XPT2046 touch(Touch_CS, Touch_IRQ);
User avatar
By wooduino.ca
#45864 PICSTART,
Many thanks for your post... I'll take a closer look.
At first glance, however, it may not work for me. For instance, I'm attempting to run SPI and not I2C (as you say in your post), and also I notice that the reset on my display is active LOW, not HIGH in your case.

The display uses the ILI9341 and has a touch screen as well. I am not really interested in the touch panel yet but just want to get the functionality of the display. The display runs correctly on an 3.3V Arduino Pro-Mini using its SPI interface. However, I have not been able to get it to run it on the WeMos D1.
A couple of throughts:

Maybe I'm not connecting or assigning the DC and CS pins correctly.
Maybe the SPI interface is running too fast on the ESP for this panel.

I am using a 2.4" screen from Digole (really beautiful display) on a WeMos D1 mini using the I2C interface for a number of projects ( see www.wooduino.ca ) and have had no issues with this display. However, it is not cheap at around $20 CDN while the 2.4" TFT from eBay is 1/3 of the price. That's why I'd like to get it working on the ESP8266 platform.

Any thoughts?

Regards,
... Adrian Jones
www.wooduino.ca
User avatar
By RichardS
#45927 Mr. Wood,

See this post, it also talks about SPI MODE3 needed so check that....
viewtopic.php?f=29&t=6828

Also for SPI in Ardunio IDE clues...
See posts https://github.com/esp8266/Arduino/pull/1781 and
https://github.com/esp8266/Arduino/releases/tag/2.2.0 and
https://github.com/esp8266/Arduino/issu ... -201936233

RichardS