How to connect OLED/TFT to ESP32

Deouss
Posts: 400
Joined: Tue Mar 20, 2018 11:36 am

How to connect OLED/TFT to ESP32

Postby Deouss » Fri Mar 23, 2018 3:20 pm

Hi, I must connect OLED ( 128x64 SSD1306, 96x64 SSD1331, 480x320 TFT ILI9486/88 ) to ESP32
I am trying to find examples of connecting those OLEDs and haven't got luck so far.
Need to build project displaying monitored data on small screen.
If anyone could help with example code, any links or materials that'd be awesome.
Thanks!

Bodmer
Posts: 4
Joined: Sun Mar 25, 2018 5:44 pm

Re: How to connect OLED/TFT to ESP32

Postby Bodmer » Sun Mar 25, 2018 5:58 pm

This library may be of interest:

https://github.com/Bodmer/TFT_eSPI

It supports the TFT's you mention with the ESP32 either as 8 bit parallel or SPI.

Bodmer

Archibald
Posts: 107
Joined: Mon Mar 05, 2018 12:44 am

Re: How to connect OLED/TFT to ESP32

Postby Archibald » Mon Mar 26, 2018 11:25 am


Deouss
Posts: 400
Joined: Tue Mar 20, 2018 11:36 am

Re: How to connect OLED/TFT to ESP32

Postby Deouss » Mon Mar 26, 2018 12:21 pm

Bodmer wrote:This library may be of interest:

https://github.com/Bodmer/TFT_eSPI

It supports the TFT's you mention with the ESP32 either as 8 bit parallel or SPI.

Bodmer
Thank you. Yes I am trying this library with my 480x320 TFT that is very resistive to work with esp32.
I tested it with mega2560 (adafruit lib) - had to force chip ILI9481 and it worked beautiful.
Also discovered it works as parallel - disconnected spi completely despite it has all pins on the board...(?)
So far white screen sometimes one random flicker... Library looks incomplete referring to comments in headers.
Will try Oled next - probably much easier. I am not sure if ILI9488 is compatible with ILI9481 meaning - similair register specs
Are there any other libraries for ILI9481 ?

chegewara
Posts: 913
Joined: Wed Jun 14, 2017 9:00 pm

Re: How to connect OLED/TFT to ESP32

Postby chegewara » Mon Mar 26, 2018 2:25 pm

There is a plenty of libraries that let you connect ssd1306 and/or ssd1336

Bodmer
Posts: 4
Joined: Sun Mar 25, 2018 5:44 pm

Re: How to connect OLED/TFT to ESP32

Postby Bodmer » Mon Mar 26, 2018 9:24 pm

Check if the OLEDs you have need SPI or I2C connections as the library will have to be selected/configured. If I2C and you do not have data on the displays then you can use an I2C sniffer sketch to find the right I2C address. Google comes up with plenty of library options.

It sounds like you have a collection of displays available (ILI9481/86/88) so I am sure you will get at least one running quickly. The data sheets for these are readily available online for a register comparison. In summary an ILI9481 driver works on an ILI9488 but with screen mirroring in some rotations that can be fixed by changing the Memory Access Control register. An ILI9488 driver will not work on a ILI9481 though due to register conflicts. The TFT_eSPI library works fine with all these displays in 4 wire SPI or 8 bit parallel mode so there must be a wiring or configuration error in your setup :-( Check you display is not configured for 16 bits parallel or 3 wire SPI mode (needs 9 bit data transfers). 4 wire SPI is a good option to minimize wiring errors and you will only get a 50% display speed boost for a 8 bit parallel display.

Deouss
Posts: 400
Joined: Tue Mar 20, 2018 11:36 am

Re: How to connect OLED/TFT to ESP32

Postby Deouss » Tue Mar 27, 2018 3:14 am

Hey thanks for tips! I found the problem - not all inputs can be assigned to pin numbers higher than 31.
So I lowered the numbers and it works amazingly good. The graphic tests went so fast I thought there was something wrong.
Unfortunately TFT is 16bit parallel with no spi.
I think this CPU could easily handle large HD LCD/Amoled panels like in cellphones but with direct external memory writing.

Bodmer
Posts: 4
Joined: Sun Mar 25, 2018 5:44 pm

Re: How to connect OLED/TFT to ESP32

Postby Bodmer » Wed Mar 28, 2018 7:59 pm

Great to hear about your success.

The TFT interface GPIO port allocations that must be in the range 0-31 are identified in the comments in the setup file. This restriction allows single register set/clear instructions to setup all the key signal levels. The TFT signals that do not have this restriction are the ones that are rarely toggled, thus have low impact of rendering performance. The performance limit for the 8 bit parallel TFT is that the highest ESP32 GPIO signal toggle frequency is ~10MHz (50ns low and high periods) but the typical TFT can accept data at least at twice that rate.

Larger TFTs can be supported but are relatively expensive and consume a lot of power. You can buy a 7" Android tablet for $30 with WiFi, Bluetooth, battery+charger etc, so the ESP32 is better suited to being an embedded server and the tablet the display (via Wifi or whatever). It all depends on what you want to display.

Who is online

Users browsing this forum: No registered users and 19 guests