How to establish SPI connection with a TFT display? - Page 1
Forum section: electronics / projects

author: Hague Tech
author_rank: Contributor
timestamp: June 26, 2025, 10:01:16 am
content: I am trying to connect a display screen to an ESP32 via SPI. The display I am using is the HS17QS178RX. Its datasheet is limited but I have a datasheet for a module that utilises the same display but in general how does one go about connecting the display to the MCU? I have simply connected each of the SPI pins to the MCU through a 4.7k ohm resistor and have included some caps on the backlight LED but other than that is there anything else I would need to do to establish a connection? The reference schematic on the module datasheet is pretty bad as it has repeated lables and uses a library chip but I have tried to copy it as best as I can. I have attached my schematic and the datasheets, my display schematic is on page 5/5. Any help with this would be appreciated.

author: darkspr1te
author_rank: Frequent Contributor
timestamp: June 26, 2025, 10:10:26 am
content: Schematic seems sound other than missing ground between devices.darkspr1te

author: Hague Tech
author_rank: Contributor
timestamp: June 26, 2025, 10:19:26 am
content: Quote from: darkspr1te on June 26, 2025, 10:10:26 amYou mean to say I need to connect each SPI line to ground? The display and MCU are connected to a common ground plane through their respective pins, I thought that was sufficient?

author: tooki
author_rank: Super Contributor
timestamp: June 26, 2025, 11:25:03 am
content: Quote from: Hague Tech on June 26, 2025, 10:19:26 amObviously not, then they wouldn’t work because they’d always be held low.Quote from: Hague Tech on June 26, 2025, 10:19:26 amIt should be, assuming KiCad doesn’t require you to connect ground explicitly (on page 1). On page 1, why is everything except ground connected manually? I would have guessed that (on non-repeating schematics) that the net names alone would do the trick. I suppose the source of confusion is that everything has a manual connection except ground.P.S.- On your schematic, you list the “RESET and EN” buttons. But EN and RESET are the same signal, and what you actually mean is RESET (or EN) and BOOT (which is the IO0 signal).- Your battery voltage is standard single-cell LiIon/LiPo, right? Then you may not be able to use the selected voltage regulator. A LiIon/LiPo cell discharges down to about 3V, well below your 3.3V output. The regulator datasheet says that to prevent damage to the IC, Vout must never be larger than Vin+0.3V. So Vin=3.0V is the absolute rock bottom minimum input voltage to avoid damage. Without battery state-of-charge management, you have no way of knowing when you’ve dipped down to 3V or lower. You could consider adding a little voltage divider to scale your battery voltage (down to 950mV, 1.25V, 1.75V, or 3.1V full-scale, depending on which ADC attenuation setting you select), then use the ESP32’s ADC to measure the voltage. Consider using software-latching soft power on to allow the ESP32 to shut off the voltage regulator in hardware. Just tie the regulator’s CE pin low with a weak pulldown resistor, and connect CE to an unused GPIO pin through a diode, as well as to a momentary button that pulls it high. In your code, the very first thing you do is set the GPIO to an output and set it high. Then when you press the button, it turns on the regulator, and then the GPIO holds it high to stay on. To turn off (whether due to user action, or because the battery voltage is too low), just set the GPIO low in software.

author: Hague Tech
author_rank: Contributor
timestamp: June 26, 2025, 12:40:43 pm
content: Yeah everything with the GND label is the same ground on Kicad. Thanks for the advice on the LDO, I will have a look at incorporating some sort of charge management. Thanks again!