I have set up a project using
- Arduino Uno R4 Minima
- 2.8 inch TFT with SPI interface, ILI 9341 TFT driver, XPT2046 touch controller and SD card (AZ delivery: 2,8 Zoll LCD TFT Touch Display - Kompatibel mit Arduino und Raspberry)
- TXS0108E level converter
- latest Arduino IDE
- Adafruit_ILI9341 library for TFT (with correction for Uno R4)
- XPT2046_Touchscreen library for touch
- SdFat library
I tested it on my breadboard and all worked fine, using all three peripheries (TFT, touch and SD card) via SPI. Therefore I decided to solder it on a PCB.
The soldered version didn't work any longer with sufficient robustness: While 60 ... 80% of the displayed screens were correct, repeatedly I got erratic display content (wrong colors, shifted lines up to blank white screen), which led me to the suspicion that SPI communication was not robust. I checked all soldering points several times, the only thing that helped was to shorten the wires from TXS0108E to the display (30cm down to 8cm)! Additionlly I had to slow down the SPI frequency to 8MHz, which makes the display quite slow.
Looking into the ILI9341 datasheet, I found:
Does this mean that one SCL cycle needs at least 100ns and therefore the SPI transfer rate would be max. 10MHz? But in the Adafruit_ILI9341 library I see SPI_DEFAULT_FREQ of 24MHz (SPI default) up to 80MHz (RASPI), which then shouldn't work at all with ILI9341. What did I miss?