Hello i am doing a smart thermostat design using the ESP32. Due to the lack of IO i decided to add 2 MCP23017 IC's to my design to have the IO needed to connect an LCD.
Problem is i cannot find if its possible to use the MCP23017 to communicate with an LCD such as this one
http://www.lcdwiki.com/3.2inch_16BIT_Module_ILI9341_SKU:MRB3205.
The display driver is the ILI9341 and the touch controller is the XPT2046.
So my goal is to control an SPI display using the IO provided by the MCP23017 via I2C.
Can this be done ?
If not possible i am afraid the only other way is to use a typical 16*4 I2C lcd display module.
Other alternatives for my application are these lcds : 3.2 Inch LCD ILI9341 Unknown touch driver or this Larger 4 Inch Display with the OTM8009A
A link to the display i am talking about : 3.2 Inch LCD driver IC : ILI9341, tourch driver XPT2046
I am sure that you could use multiple MCP23017 chips for a paint drying application.
But it would be a lot of hard work. Especially since most TFT controllers have a hardware SPI interface and ILI9341 SPI displays are commonplace.
Yes, you can use SPI Shift Registers to drive a 16-bit parallel display panel. That is how the Waveshare abortions work with their RPi displays. They have inherently worse performance than using the native SPI interface. But have infinitely better potential than I2C bus expanders.
David.
Got it ... is there a way to go with a maximum of 5 pins with a graphical display in general ? I searched everywhere and could not find any i2c capable or i2c driven displays... or even only 4 wire SPI ones.
4 -wire SPI needs CS, MOSI, SCK, DC and a pullup on RST
3-wire SPI needs CS, MOSI, SCK. 9-bit SPI is painful on AVR.
Many controllers will let you read on a single bidirectional SDA pin. Most apps never read anyway.
Raio controllers like RA8875 have an I2C interface. Which is practical because the chip accepts high level graphics commands but any drawPixel app will be SLOW.
I would choose 4-wire SPI with XPT2046 requiring another CS pin and MISO. i.e. 6 pins
An SD card needs CS and MISO i.e. total 7 pins.
You can just manage on ESP8266. ESP32 has lots of GPIO pins.
David.
Thank you for your help. Since the ESP32 has more than enough pins left it should be no problem running the 7 wires needed. Problem is i am pretty confused with the libraries used to drive these kind of displays and how to connect them.
Take for example these three3.5" SPI ILI9486/88,3.2" ILI9341 SPI and 2.8" ILI9341 SPI
The last 2 have the same controller but different number of connections, the first has a different controller. Is anything that needs to be connected besides the uSD,touch and SPI ?
The first two are 16-bit parallel. There are not enough pins on ESP32.
The third one has SPI ILI9341, SPI XPT2046, SPI SD card. And is supported by many libraries.
But you might just as well use TFT_eSPI on an ESP32
David.
Well thank you so much for your reply i will order the 3rd one to have something on the way as i research how the parallel and spi interfaces work so i am more informed the next time.
Thanks again!