This post isn't here to ask for a solution, this is the solution.
(I am not in danger, I am the danger! For the ones who got it
)
I think a lot of people who have bought the 7-inch Touch Display from BuyDisplay (https://www.buydisplay.com/7-inch-arduino-touch-screen-shield-ssd1963-library-for-mega-due), have encountered the problem that you can not use the SD card and the touchscreen at the same time.
This is because the touchscreen uses software SPI and the SD Card uses hardware SPI, and both of them are connected on the same net.
I tried to contact the support of the BuyDisplay website, and I also got a response! Kind of...:
Dear Dario
It's not easy to solve this problem. Because the SD card can only support hardware SPI. Therefore, you have to change the resistive touch panel to hardware SPI. But we don't have time to modify the demo codes for hardware SPI touch panel.
Could you use ER-TFTM070-7 this one? This one can support both SD card and resistive touch panel hardware SPI.
So, they don't have time, don't really care to fix the problem, and wanted to sell me another display. So I had to do it by myself:
I have come up with two possible solutions to fix the problem:
- rewrite the UTouch and SD library so that both SPI's communicate on the same line, which is not very easy, or
- Do a hardware modification, to separate the two SPI and make two separate SPI lines. One for the touch panel and one for the SD card.
Option 2 is the one I chose. The obviously easier one. I have done the modification on the supplied Arduino shield that comes with the display (ER-AS-SSD1963):
These are the only new lines I added to the board, and I had to change a bit the Jumper configuration.
I have a schematic here that illustrates the whole circuit:
see that a few jumpers are connected (as shown in the schematic)
Important: This solution is for the resistive touch panel. I don't have the capacitive touch panel, therefore I don't know how to solve it for the capacitive one.
You don't have to change anything in the software to make this work, that's the cool part about this solution.
I hope this article helps for the people who also banged their head against the wall like me to fix this problem.
Have fun!
Regards
Dario

