SD Card - MISO doesn't release [Bad MISO, Bad MISO!!]

Will try an I2C communication for the sd card to fix the problem.

You can't connect I2C to the SD card. The MFRC522 can communicate with I2C but the library I know about is SPI.

SD.h does have a problem with MISO. You can cause MISO to go high-Z with SD.h by sending a byte like this while SD chip select is high. Any value will work since SD cards only need some clocks to release MISO.

SPI.transfer(0XFF);

SdFat causes MISO to go high-Z so that is not likely the problem. There are SD modules that won't share the SPI bus properly. The modules have a level shifter that causes a problem with MISO.

The problem with SdFat may be SPI clock rate. SdFat has a default clock rate of 8 MHz. The MFRC522 has a max rate of 10 MHz but may be marginal at that speed with the SD card. The default for the MFRC522 library will be 4 MHz. The MFRC522 library does not set the SPI clock rate before accessing the SPI bus.

You could try reducing the rate to 4 MHz for SdFat like this so both the SD and MFRC522 use 4 MHz SPI clock.

sd.begin(CS_PIN, SPI_HALF_SPEED);

You should not assume the problem is MISO unless you have proof. Just put a voltage divider on MISO using 10k or larger resistors, one to gnd and one to 5V. Do SD operations and then measure the voltage on MISO. With SdFat I get 2.5 volts as expected. I get 3.3 V with SD.h which is MISO high for an SD card.

You can fix SD.h by editing Sd2Card.cpp at about line 145 and making this mod. The file is located here:

arduino-1.0.6\libraries\SD\utility

//------------------------------------------------------------------------------
void Sd2Card::chipSelectHigh(void) {
  digitalWrite(chipSelectPin_, HIGH);
  spiSend(0XFF);  // <---------------ADD THIS LINE
}

You must also make this change at about line 222

  // set pin modes
  pinMode(chipSelectPin_, OUTPUT);
  digitalWrite(chipSelectPin_, HIGH);  //<-------  was chipSelectHigh();
  pinMode(SPI_MISO_PIN, INPUT);
  pinMode(SPI_MOSI_PIN, OUTPUT);
  pinMode(SPI_SCK_PIN, OUTPUT);