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.
to a lower value, like 1000000 (1 million rather than 20 million). If that works, then the cable is likely the issue.
Cat 5 is twisted pair, so putting two signal lines on one pair may cause problems. With only eight wires (4 pairs), it would be hard to separate things properly. Do you have a ribbon cable you could try?
MHotchin:
It sounds like the cable is either picking up outside signals (like an antenna) or the capacitance won't run at the speed the library specifies.
The first thing to try would be to run things at a lower frequency. In the CPP file for the library, change:
to a lower value, like 1000000 (1 million rather than 20 million). If that works, then the cable is likely the issue.
...
I've lowered the frequency significantly (even up to 250kHz). The SD was still not initialized. I might be wrong, but I'm very surprised that the cable would still be picking up outside signals. What did you mean when you said...
or the capacitance won't run at the speed the library specifies
... did you mean that rising edge harmonics might be causing the problem? Would you add a cap between MISO/MOSI/CLK and ground?