Arduino Uno WiFi R4 Hardware SPI Issue: ILI9341 TFT & XPT2046 Touch (Works on Standard Arduino Uno)

Hello everyone,

I'm encountering a persistent and frustrating issue with Hardware SPI on my Arduino Uno WiFi R4 board when attempting to use an ILI9341 TFT display with an XPT2046 touch controller.

The Problem: My ILI9341 TFT display remains blank or shows corrupted output, and the XPT2046 touch functionality is completely unresponsive on the Arduino Uno WiFi R4. This setup is critical for my project's user interface.

Interesting Findings My setup works perfectly with Uno R3. With R4, to get it to work somewhat, I use the full constructor, but lose the ability to control both touch screen and tft for drawing graphics. When I use the constructor for Hardware SPI, this is when the blank screen occurs.

My Setup:

  • Problematic Board: Arduino Uno WiFi R4
  • TFT Display: ILI9341 (using Adafruit_ILI9341 library)
  • Touch Controller: XPT2046 (using XPT2046_Touchscreen library)
  • SD Card: Integrated on the same TFT module (using SD.h library) - Note: This is also affected by the SPI issue.
  • SPI Pins Used (Hardware SPI):
    • TFT_CS: Digital Pin 10
    • TFT_DC: Digital Pin 9
    • TFT_RST: Digital Pin 8
    • SD_CS: Digital Pin 4
    • TCH_CS: Digital Pin 5
    • TCH_IRQ: Analog Pin A5
    • Hardware SPI MOSI, MISO, SCK are connected to the standard pins (11, 12, 13 respectively) on the Uno WiFi R4.

Initialization Sequence in setup():

  1. All Chip Select (CS) pins (TFT_CS, SD_CS, TCH_CS) are configured as OUTPUT and set HIGH (deselected) before any SPI communication.
  2. SPI.begin() is called.
  3. tft.begin() is called.
  4. SD.begin(SD_CS) is called.
  5. touch.begin() is called.

Crucial Observation: The exact same circuit wiring and Arduino sketch work perfectly on a standard Arduino Uno (non-WiFi version, e.g., Uno R3) with no issues whatsoever. This clearly indicates the problem is specific to the Arduino Uno WiFi R4's hardware SPI implementation, its distinct Renesas RA4M1 microcontroller, or its interaction with the onboard ESP32 WiFi module.

Has anyone else encountered these specific SPI communication challenges with external displays/touch controllers on the Arduino Uno WiFi R4? I'm looking for insights, potential workarounds, or confirmation of a known compatibility issue.


Didn't have a 9341 with touch, but figured an 9486 with touch wouldn't be far off the mark.

The picture speaks for itself, I believe. No ChatGPT fluffing, no generic diagrams of other's wiring, no inscrutable Fritzing, just the hardware working.

Oh, and of course, a dedicated 3.3V regulator, hardware SPI with active level shifting, the display's untrustworthy MISO pin properly tri-stated so that touch works (and the SD card if I wanted to use it), all that good stuff.

From your schematic you are driving a 5V input with 3V3, that does not always work. Try using a level translator. This is supported by the fact that a 5V processor works.

Your Fritz picture does not match the schematic in that you have added a voltage divider also in the screen's T_DO and MISO lines with an extra 5.1k resistor. This is incorrect because these are 3v3 outputs from the screen feeding a 5 volt Arduino. If anything these should be level shifted upwards, not downwards. If it worked on a Uno R3 then it was probably luck. It would appear the Uno WiFi R4 is more sensitive. The schematic itself is anyway not nice as @gilshultz has pointed out.

Edit.
I've looked again. The schematic (difficult to follow) is indeed wrong. R4 should be omitted.