ESP32 Pins for TFT_eSPI

I am trying to run Read_ID_bitbash.ino from Bodmer's TFT SPI library. I am not getting a reply.

I am wondering if anyone can see anything wrong using the following mapped pins for a custom ESP32 board..

Read_ID_bitbash.ino.. 

//Custom ESP32 board
#define TFT_MOSI  23
#define TFT_SCK 18
#define TFT_CS 5
#define TFT_DC  4
#define TFT_RESET 14

I have the board, wired to this 2.4" LCD TFT.

GPIO LCD PIN
4 DC
5 CS
14 RESET
18 SCK
23 SDI(MOSI)
3.3V VCC
GND GND

Can anyone confirm that Bodmer's Read_ID_bitbash.ino (in examples) works on an ESP32 board? I imagine it would only take a few minutes if you have a TFT LCD and a few wires kicking around. Perhaps the project doesn't work with modern timings?

If there's another SPI example out there that you know works, for reading the LCD ID, please share!

Yes, of course it works on any target.

However some display hardware is write-only.
As always, post a link to the actual display that you have bought e.g. Ebay sale page.

It takes you 10 seconds to copy-paste the link. The advice is repeated in almost every thread. It means that you get an accurate answer instead of a discussion that is drawn out over days and weeks.

David,

The link unfortunately doesn't specify much. It is the 2.4" model, if you scroll down a bit. I suspect it is an ILI9341 driver, based on other similar looking boards.

Oh also, I learnt that the VCC should be 5V, and the LED should be connected to 3.3V, based on a video I have seen. Since making those attachments, I get the backlight to turn on at least now.

UPDATE

I guessed at the ILI9341 driver, and set the LCD pins and successfully got the screen to run Colour_Test.ino!

Perhaps you were right.. it was just a read issue.

I next have to test the touch capabilities.. but not sure where I can re-map the touch pins.

I would be much happier if you said that your pcb exactly matches the "2.4 Inch
At least 4 IO drivers are required without touch, with a minimum of 9 IO drivers with touch. Resolution 240*320" set of photos.

The 2.4 inch has ILI9341 and receives data on SDI pin. Outputs data on SDO pin.

The 1.44 inch ST7735 has bidirectional data on the SDA pin.
The 1.80 inch ST7735 has bidirectional data on the SDA pin.
The 2.0 inch ILI9225 has write-only data on the SDA pin. (the buffer chip ruins read function)
The 2.2 inch ILI9341 receives data on SDI pin. Outputs data on SDO pin.
The 2.4 inch ILI9341 receives data on SDI pin. Outputs data on SDO pin.
The 2.8 inch ILI9341 receives data on SDI pin. Outputs data on SDO pin.

David.

The link I shared is all I knew about it.

I went back, using the same wiring and pin mapping, and can confirm that Read_ID_bitbash.ino does not report the ID for this board.

Though you may be right that the ID may not be queryable, it's also possible that this code doesn't support the ESP32 SPI bit framing. The version of project that DOES work, has some very specific ESP32 ifdef statements in the libraries.

Would be an interesting experiment, for someone that is failing to read the ID on ESP32 board, can in fact read it on another type of dev board.

It does not matter whether your link is the exact shop. But it does matter that the photos on the link match the pcb on your desk.

Read_ID_bitbash.ino is for bidirectional SDA style controllers like ST7735, ST7789, ILI9163, GC9102, ...

TFT_Read_Reg.ino is for SDI, SDO style controllers like ILI9341.

This is my output for an ILI9341 Red board on ESP32:

Register 0x04: 0x00000000
Register 0x09: 0x00000000
Register 0x0A: 0x00000008
Register 0x0B: 0x00000000
Register 0x0C: 0x00000006
Register 0x0F: 0x00000000
Register 0x2E: 0x00000080
Register 0xDA: 0x00000000
Register 0xDB: 0x00000000
Register 0xDC: 0x00000000
Register 0xDD: 0x000000C1
Register 0xD3: 0x00009341

Test 8, 16 and 32 bit reads and the index...
93
9341
41009341

David.

It does not matter whether your link is the exact shop. But it does matter that the photos on the link match the pcb on your desk.

And why would I give a link with an image that wasn’t an exact match? Maybe you’ve come across some situations where this was not the case? I didn’t feel it necessary for redundantly mentioning that, since most people do typically mention differences, if any are applicable. I guess there’s more variance than I am aware of. But yes, that is an exact match, to be clear.

Anyways, thanks for your thorough test. I was not aware that the ILI9341 was different in that respect, and that the Read_ID_bitbash project was not the right one to be running.

I do have a suggestion, though, so that this doesn’t happen again…

Why not merge TFT_Read_Reg and Read_ID_bitbash into a singular ‘Read_ID’ project. Put a #define and an explanation for the lay-person so that they not only have a singular go to project for determining IDs, but, has information like what was just unearthed for me in your previous comment?

TFT_Read_Reg.ino is for SDI, SDO style controllers like ILI9341.

I can test the ILI9341 that I have with it right away, if I see a fresh check-in!

And why would I give a link with an image that wasn't an exact match? Maybe you've come across some situations where this was not the case?

Yes, it is very common that Ebay / AliExpress sale pages are a pack of lies. Photos of obsolete pcb. Very often the text description is complete rubbish.

Yes, it is very common for readers to even get the pcb colour wrong.
I can't expect readers to be technically competent. But most people can recognise a Red pcb, Green pcb, ...
And most people can identify whether the components are "in the same place" and if the pcb traces "look" the same. Some people can even read the printing on a pcb.

It is very easy for a Poster to provide a link. Even better when it is a clickable link.
Most importantly, it means that everyone can identify exactly what hardware you have without having to ask extra questions.

Regarding Read_ID_bitbash.ino and TFT_Read_Reg.ino
Yes, they could be combined into a single sketch but the punter would need to configure a few things.
That usually ends in tears.

Bodmer is the author of Read_ID_bitbash.ino and TFT_Read_Reg.ino
It would be a good idea (tm) if Read_ID_bitbash.ino was in the examples/128x160
and TFT_Read_Reg.ino was in examples/240x320

David.

Yeah I did share the link, but, unfortunately it's just a picture and one line of text, not even mentioning the exact controller. Really, it was a questionable purchase, but I kind of presumed I could ID it, if needed.

If Bodmer wanted to be really ambitious, what he could do is have the combined sketch try both methods until one responds with a known ID. If this is such a problem on ebay, it would help a lot of people establish exactly what they're dealing with if there was a single 'Read ID' to rule them all!

You need to connect up MISO to read the display.

The Read_ID_bitbash sketch only works with displays that have a bidirectional pin (typically called SDA). I suspect your board has SDO and SDI pins so is a standard SPI MISO and MOSI bus.