I Have a 16GB Wi-Fi SD HC Card from Transcend. I try to initialize the card via SPI using an Arduino Uno, sending
CMD0, arg: 0 , CRC: 0x95
but the expected response is:
When i try the same process with an 2 GB SD (no SDHC) card, the response is:
as expected. So the initialization process itself can't be the problem.
Here you can see the Timings of the 2GB SD card analyzed with a logic analyzer:
Here you can see the Timings of the SDHC card analyzed by a logic analyzer:
The strange thing about it is, the SD card acts as expected using:
Mode 0 (CPHA=0,CPOL=0)
So the MISO value is always stable at the rising edge as i expected it to be: (Using MMC/SDC)
On the other hand, the SDHC card doesn't behave like this, and this might be the reason why the initialization process fails. The SDHC card seems to work in Mode 1 , so the MISO value is always stable at the falling edge.
Why is the SDHC card not running in mode 0, as I expect it too?
Update: I am using the sdfatlib which is waiting the required 74 clock cycles.
// must supply min of 74 clock cycles with CS high.
for (uint8_t i = 0; i < 10; i++) spiSend(0XFF);
And also the recorded behavior shows that there are more than 74 clock cycles until CS is set to low to send the init command.
Pulses: 79 ( up: 79, down: 80)