[SOLUTION] BuyDisplay 7" use touchscreen & SD card at the same time

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 :wink: )

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:

  1. rewrite the UTouch and SD library so that both SPI's communicate on the same line, which is not very easy, or
  2. 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

1 Like

Go on. The obvious solution is use a HW_SPI library. e.g. XPT2046_TouchScreen.h

I suspect that BuyDisplay provide obsolete versions of Henning Karlsen's UTFT.h and UTouch.h

You would get much faster performance with a different TFT library.
And anything is better than the SW_SPI URTouch.h / UTouch.h which was intended for the Mega2560 Shields and Adapters that route XPT2046 to GPIO pins D3 .. D7

David.

Hi David, thanks for your message.
I'm afraid that you can't take both components (SD & Touch panel) on the same SPI, because the SD card doesn't release the SPI line. So the touch panel can't pass any values.
At least that was the case for me, and also for others on the forum.
That's why I decided to do the hardware modification.

Regards
Dario

I don't have your Display nor the Adapter Shield.
I would be pretty confident that there are separate Touch_CS, SD_CS, FONT_CS, FLASH_CS signals. But I have not studied the Adapter schematic.

I would also be confident that EastRising / BuyDisplay have suitable solder-bridges to select things like brain-dead Touch wiring.

However you have developed your own solution.

David.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.