We've been using the Waveshare 4 inch TFT shield with the following library GitHub - MHotchin/Waveshare4InchTftShield: Graphics and touchscreen drivers for Waveshare 4" shield via the SPI interface.
We're running the display on Arduino Mega 2560. The Mega also has an Ethernet 2 Shield attached, and therefore we've been using the following pins for the display:
constexpr unsigned int LCD_CS = 7; // LCD Chip Select constexpr unsigned int LCD_BL = 14; // LCD Backlight constexpr unsigned int LCD_RST = 6; // LCD Reset constexpr unsigned int LCD_DC = 5; // LCD Data/Control constexpr unsigned int TP_CS = 3; constexpr unsigned int TP_IRQ = 2; constexpr unsigned int TP_BUSY = 1; constexpr unsigned int SD_CS = 53;
When testing the display with short breakout wires it seems to work fine (and also when used as shield), however we need a slightly longer cable (shielded sVGA type), and when using a longer cable we've found that the SD card doesn't want to initialize anymore - failing with error 1 (while it initializes normally when using short wires) using the normal Sd2Card class, even though the display works fine. We've also found that in our production environment the display sometimes blanks (whites) out permanently (this has never happened during testing in controlled environment). Has anybody had similar problems when using Display in combination with SD?
To emphasize, everything works until we replace wires with cable (VGA or CAT-5 just relaying wires). MISO/MOSI,CLK, SS is 50,51,52, 53 respectively. We've tested the cable and at least electrically it seems fine.
Any thoughts appreciated.