Issue with SD card module and TFT screen - no updates after SD init

Hi, I am struggling with a simple TFT display + SD card reader setup.
I am using a 1.47 inch LCD display from Waveshare and the standard SD card reader module. I tested the display with the test sketch and everything worked fine. Then I connected the SD card reader and the problem started. I can connect to the module and read files - no problem, but I can no longer update the TFT screen. I shortened the code to the absolute minimum (see below). After (!SD.begin(SD_CS)) interaction with the display is no longer possible. I tried setting the CS pins manually, but that had no effect. In another thread I read that the SD card module is quite power hungry, so I removed the USB connector and connected the breadboard to my power supply, but the problem persists.

I'm happy about any tip!

Arduino Uno (the old DIP version)

#include <Adafruit_GFX.h>     
#include <Adafruit_ST7789.h> 
#include <SPI.h>
#include <SD.h>
 
// For the breakout board, you can use any 2 or 3 pins.
// These pins will also work for the 1.8" TFT shield.
#define TFT_CS        10
#define TFT_RST        8 // Or set to -1 and connect to Arduino RESET pin
#define TFT_DC         7

// OPTION 2 lets you interface the display using ANY TWO or THREE PINS,
// tradeoff being that performance is not as fast as hardware SPI above.
#define TFT_MOSI 11  // Data out
#define TFT_SCLK 13  // Clock out

// OR for the ST7789-based displays, we will use this call
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

#define SD_CS    4  // Chip select line for SD card

void setup() {
  
  Serial.begin(115200);
  Serial.print(F("Hello! ST77xx TFT Test"));
  Serial.println(F("Initialized"));
  
  tft.init(172, 320);
  
// MY CODE
  tft.fillScreen(ST77XX_WHITE); // works
  tft.drawPixel(100, 105, ST77XX_BLUE);  // works

  Serial.print("Initializing SD card...");
  if (!SD.begin(SD_CS)) {
    Serial.println("failed!");
    return;
  }
  
  Serial.println("SD card is connected!"); // works
  
// digitalWrite(4, HIGH);
// digitalWrite(4, LOW);

// digitalWrite(10, HIGH);
// digitalWrite(10, LOW);

  tft.fillScreen(ST77XX_ORANGE); // display remains white...

}

UPDATE: added more info to the code snippet.

I'm not seeing any #include's or variable declarations in your code so I don't know what libraries you're using, and so this is pretty much a WAG. I'm going to assume that the display is also connected to the SPI lines? Is it possible that your "standard SD card reader module" isn't tri-stating the MISO line when it's not selected, and so the display can't respond to anything because the MISO line is tied up?

If I may add to what @van_der_decken posted:

Some SD card modules will not play well with other devices on the SPI bus. The problem is with the way the level shifter on the SD module is wired. The ones that do not work well have the MISO signal running through the level shifter. That causes the MISO signal to not be released so that the other devices can control it. The modules made by Adafruit (and some others) have the MISO signal going from the SD card straight to the MISO, bypassing the level shifter. Look at the schematic for the Adafruit module to see what to look for. DO (data out) is the MISO signal.

Some possible fixes for troublesome SD modules.

An alternative solution is to use hardware SPI for the devices that behave and a software SPI for the SD card reader. Here is an example using the SdFat library and soft SPI. >> https://github.com/greiman/SdFat/blob/master/examples/SoftwareSpi/SoftwareSpi.ino

You needed to tell us which Arduino you are using and which SD card module you are using.

Thanks for the tip to rewire the SD card module. It didn't fix my problem, but reading about the topic I found out that moving the tft screen SPI to other pins is possible.