Interfacing SD-Card and LCD display (ST7735-lib by Bodmer) using SPI

I'm trying to access a SD-card mountet on the back of this display while writing data to the display.

The "CardInfo" sketch from the SD library works just fine and I can also display things on the display but when trying both at the same time I can't access any file on the SD-Card.

My wiring for the SD-Card:
MOSI -> D11
MISO -> D12
CLK -> D13
CS -> D4

My wiring for the display:
SCL -> D13
SDA -> D11
RS/DC -> D9
RES -> D8
CS -> D10

As you can see, D13 and D11 are used for both "devices".
Is this the reason for my problem (I don't know much about SPI)?

And if so, how can I change this?

In the setup-file from Bodmer's ST7735 library you can only change the CS, RS/DC and RST pins. (I already un-commented the "SUPPORT_TRANSACTIONS" wich at least let me access the display after "SD.begin")
Is there something similar in the SD library?

Your link (and the manual) do not show a photo of the pcb.
So I can't identify it.

When you say Bodmer, do you mean TFT_eSPI for ESP8266, ESP32, STM32 boards ?

Or do you mean TFT_ST7735 ?
which can run on Uno, Mega, Due, ... but must have 3.3V logic signals.

Seriously. The display will run fine with SD on the hardware SPI bus if you have 3.3V logic.


Here is an image of the PCB (not from me).

I'm using the display with an Arduino Nano on 5V with this library.

I found a solution:

call "SD.begin" each time I'm trying to access the SD card.

Thanks for your help!

Let me know if there is a better way :slight_smile:

Personally, I would not use this display with 5V logic. e.g. your Nano.

However VR1 is a 220R Resistor Pack. Which might offer some limit to substrate diode current.

Have you tried all of the library examples ?
Do they all work 100% ?
Bodmer does not seem to have an SD picture example.

What library sketch are you using with the SD ?
What kind of images do you want to display?


I’ve used this example and then just changed the “setWindow” in the “bitmap_functions” file to “setAddrWindow”.

Since I don’t need the support for .bmp files I only included the drawRAW function in my sketch (see attachment)

For all people with the same problem:
I included a step by step guide how to use this display with the card-reader (6.79 KB)

Thanks for the links and your actual sketch.

I took the TFT_HX8357 example. Modified for TFT_ST7735. i.e. constructor(), SD_CS, setAddrWindow()

It displayed a BMP just fine. But then ceased.
Likewise, I could display a RAW file just once.

So there is a problem somewhere. (It is my bedtime)

Anyway, I compiled your sketch. Worked fine. i.e. it repeats ok.