SeeedStudio TFT Touch Shield 2.8" v2.1 with D1 R32 ESP32 (ESPDUINO-32)

Hi all, I have an old TFT Touch Screen shield from SeeedStudio, that works well on Uno or Mega. I use the SeedStudio library TFTv2, the display drive is IL9341.

Recently I bought an UNO like card with ESP-32. Stupid me thought, that it was pin-compatible with UNO, why else should anyone build a card like UNO?

So here I am with a card with almost every pin different from UNO. But I like the ESP-32 for it's speed. I have built a few projects with it even using it's dual core.

The card doesn't have the 6pin SPI connector, but luckily there are jumpers on the TFT card, connecting the SPI (MOSI, MISO, SCK) to pins 11, 12, 13 on UNO.

Is there anyone, who solved this problem or has enough knowledge to help me do it? The reason for this could be, that SeeedStudio sells this card for $10, while Adafruit has 2.8" TFT for $35.

Questions are: 1. do I have to involve level shifters up from 3.3V to 5V ? (kind of awkward, since there are level shifters down on the TFT card) 2. which library do I use? Or at least to start with and adapt to my HW. (there are a few alternatives - SeeedStudios TFTv2, Adafruit_ILI9341_AS, Bodmer's TFT_eSPI,...)

Any hint to solve this will be appreciated. Thank you.

By the way, is there anyone who knows how do I contact Bodmer?

Please post links to the actual display and the actual ESP32 board. e.g. Ebay sale, Seeed wiki

It takes you 10 minutes to provide proper information. e.g. display model and version number. Only then can you expect sensible answers.

You are not a new member. You should know how to post questions.

David.

Hi David, thank you for your answer.

The links are:

Touch TFT (very slow link - give it time, please) The SeeedStudio changed the price recently to $19.90 schematics: TFTv2 scematics

D1 R32 ESP32 schematics: ESPduino-32 (very similar board)

Make the solder-bridges: P1, P2, P3

In your User_Setup:

#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS    16  // Chip select control pin
#define TFT_DC    27  // Data Command control pin
#define TFT_RST  -1  // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST

...
#define SUPPORT_TRANSACTIONS

You said your screen was old. Are you sure your screen is V2.0 ?

I suggest that you print the schematic on paper. Then you can check the wiring.

David.

Are you using the ESP32 SPI library? And these pins?

david_prentice: Make the solder-bridges: P1, P2, P3

In your User_Setup:

#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS    16  // Chip select control pin
#define TFT_DC    27  // Data Command control pin
#define TFT_RST  -1  // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST

...

define SUPPORT_TRANSACTIONS




You said your screen was old.
Are you sure your screen is V2.0 ?

I suggest that you print the schematic on paper. Then you can check the wiring.

David.

Thank you, David !

On the screen it says ver.2.1 actually, but there is no ver.2.1 on SeeedStudio site.

I did exactly what you suggested and it made the trick as out of the box :-)

So now I do not have to worry about level shifters etc.

Next step will be to bring life in the touch screen and the SD-card.

The sketch (Spiro) runs so much faster on ESP32 than Arduino Mega so that I miss the feeling of how the curve is created :-) But now I know, that it is not the display, that is slow (inspite it's age - 2012).

Thank you again for your fantastic help.

Tony.

jtbennett: Are you using the ESP32 SPI library? And these pins?

Hi, thank you for the info about several SPIs on ESP32. I don't know how the library TFT_eSPI selects the right SPI, but as you can see from the conversation here, it works for me now.

Regards Tony.

Sorry to be back again. This time with the Touch screen. "Naturally", I can not get the SeeedStudio touch screen work as described in Adafruit_TouchScreen

As I can see from the schematics (and from the PCB) SeeedStudio connected the 4 touch wires to pins A0,A1,A2,A3

as I can read from the SeeedStudio touchscreendemo sketch for Arduino UNO:

define YP A2 // must be an analog pin, use "An" notation!

define XM A1 // must be an analog pin, use "An" notation!

define YM 14 // can be a digital pin, this is A0

define XP 17 // can be a digital pin, this is A3

I am a little bit lost in the rewiring of the board in Adafruit_TouchScreen

It looks to me, that the 4 touch wires on Adafruit TouchScreen are connected to A2,A3,A4,A5 though I cannot get it verified since the resistive Adafruit board has a touch controller instead.

So, please, do I have to make a different rewiring on the ESP board? How do I finally assign the pins YP,XM,YM,XP in the sketch ESP32testTouch

Thanks for your help.

Look at your D1 R32 board.

A0 = GPIO2
A1 = GPIO4
A2 = GPIO36
A3 = GPIO34
#define YP 36   // must be an analog pin, use "An" notation!
#define XM 4   // must be an analog pin, use "An" notation!
#define YM 2   // can be a digital pin, this is A0
#define XP 34   // can be a digital pin, this is A3

Note that some ESP32 pins are Analog-only. You will have to check the ESP32 datasheet. From memory, GPIO36, GPIO34 are Analog-only. Which is why Bodmer suggests a hardware mod to link GPIO15, GPIO22 to GPIO36, GPIO34.

The Adafruit_Touchscreen library must be able to swap modes between Analog and Digital on two pins e.g. GPIO2, GPIO4. The other two pins must be digital.

#define YP 2   // must be an analog pin AND digital
#define XM 4   // must be an analog pin AND digital
#define YM 15 //36   // MUST be a digital pin
#define XP 22 //34   // MUST be a digital pin

ESP32 pins are not designed for heavy loads like the Resistive panel. Untested.

David.

Thank you, David.

Just for reference:

david_prentice: Look at your D1 R32 board.

A0 = GPIO2
A1 = GPIO4
A2 = GPIO36
A3 = GPIO34

.... David.

The GPIO36 you are referring to is actually GPIO35 (it is hard to see the difference on the photo and the schematics do not show the actual connection, but I have tested with the multimeter).

Looking at the TouchScreen.cpp I have found the analogRead(aYP) and analogRead(aXM) instructions, which told me, that I should assign: XP = 33 YP = 15 XM = 4 YM = 2

aYP = 35 aXM = 39

with the rewiring described at: Adafruit_TouchScreen

You sure understand, that I am not going to HW rewire the SeeedStudio shield to have the YP at pin 2 as you indirectly suggested in:

define YP 2 // must be an analog pin AND digital

define XM 4 // must be an analog pin AND digital

define YM 15 //36 // MUST be a digital pin

define XP 22 //34 // MUST be a digital pin

The TouchScreen is integrated with the TFT so that there is only one flat contact to the board.

This is mainly for reference to people with the same or similar SeeedStudio TouchScreen.

There are a few differences in interfacing the SeeedStudio TouchScreen from Adafruit, but assigning the right pins is definitely a good start to fix the rest.

So thank you again. Tony.