Hi there , I have here RFID-RC522 and a CATALEX MicroSD card module these two are working with SPI. I tested each of this module and works independently. When I combine both wiring up to arduino , also I hook up 330 ohm resistor from sd card to MISO pin of arduino. But still these two dont work together. The program below is just to verify that these two modules are working each other is there a problem with my code or is it me the problem itself kidding please help Im not good at programming, codes below are outsource from the examples and from forums. Sorry for the bad english
#include <MFRC522.h>
#include <SPI.h>
#include <SD.h>
#define CS_PIN 4Â // slave for sd card module
#define RST_PIN 9
#define SDA_PIN 10 // slave for mfrc522
byte readCard[4];
MFRC522 mfrc522(SDA_PIN, RST_PIN);
char str[32] = "";
File myFile;
void setup() {
 pinMode(CS_PIN,OUTPUT);
 pinMode(SDA_PIN,OUTPUT);
 Serial.begin(9600);
 SPI.begin();
 digitalWrite(SDA_PIN,LOW);
 digitalWrite(CS_PIN,HIGH);
 mfrc522.PCD_Init();
 digitalWrite(SDA_PIN,HIGH);
 digitalWrite(CS_PIN,LOW);
  if (!SD.begin(CS_PIN)) {
  Serial.println("initialization failed!");
  return;}
  Serial.println("initialization done.");
}
void loop() {
 ReadTAG();
 delay(2000);
 ReadSD();
 delay(2000);
}
void ReadTAG() {
 Serial.println("debug rfid");
 digitalWrite(SDA_PIN,LOW);
 digitalWrite(CS_PIN,HIGH);
 if (mfrc522.PICC_IsNewCardPresent() && mfrc522.PICC_ReadCardSerial()) { Â
  for (int i = 0; i < 4; i++) {
  readCard[i] = mfrc522.uid.uidByte[i];
  Serial.print(readCard[i], HEX);
  }  Â
  Serial.println(); Â
 array_to_string(readCard,4,str);
 Serial.println(str);
 mfrc522.PICC_HaltA();
 }
}
void array_to_string(byte array[], unsigned int len, char buffer[])
{
  for (unsigned int i = 0; i < len; i++)
  {
    byte nib1 = (array[i] >> 4) & 0x0F;
    byte nib2 = (array[i] >> 0) & 0x0F;
    buffer[i*2+0] = nib1 < 0xA ? '0' + nib1 : 'A' + nib1 - 0xA;
    buffer[i*2+1] = nib2 < 0xA ? '0' + nib2 : 'A' + nib2 - 0xA;
  }
  buffer[len*2] = '\0';
}
void ReadSD(){
  digitalWrite(SDA_PIN,HIGH);
  digitalWrite(CS_PIN,LOW);
  myFile = SD.open("test.txt");
  if (myFile) {
  Serial.println("TEST.CSV");
  // read from the file until there's nothing else in it:
  while (myFile.available()) {
   Serial.write(myFile.read());
  }
  // close the file:
  myFile.close();
 } else {
  // if the file didn't open, print an error:
  Serial.println("error opening test.csv");
 }
}