I'm using FTDI C232HM USB->SPI cable using Windows10
The issue is: once I send CMD41 to SanDisk 4GB microSD card, it replay with "1" then doesn't replay to any other command
the init commands are the
- Set CS pin HIGH (deselects the slave)
- Toggle clock 80 times
- Set CS pin LOW (selects the slave)
- Send
CMD0
:0x40,0x00,0x00,0x00,0x00,0x95
(response:0x01
) - Send
CMD8
:0x48,0x00,0x00,0x01,0xAA,0x87
(response is0x01; 0x000001AA
) - Send
CMD55
:0x77,0x00,0x00,0x00,0x00,0x00
(response:0x01
) - Send
ACMD41
:0x69,0x40,0x00,0x00,0x00,0x00
(response:0x01
) - Send
CMD55
:0x77,0x00,0x00,0x00,0x00,0x00
(response:0xFF
) loop forever
Any ideas ?
Thanks, Roy
Added DUMMY 0XFF
before any Send SPI command
Added DUMMY 0XFF + 0xFF
before any Send SPI command
SD_PowerOn();
Sleep(100);
SD_SendCmd(CMD0, 0);
if (SD_SendCmd(CMD0, 0) == 1)
{
Timer1 = 100;
if (SD_SendCmd(CMD8, 0x1AA) == 1)
{
do {
if (SD_SendCmd(CMD55, 0) <= 1)
{
n = SD_SendCmd(CMD41, 1UL << 30);
if(n == 0)
break; /* ACMD41 with HCS bit */
}
} while (Timer1--);
if (Timer1 && SD_SendCmd(CMD58, 0) == 0)
{
for (n = 0; n < 4; n++)
{
ocr[n] = SPI_RxByte();
}
type = (ocr[0] & 0x40) ? 6 : 2;
}
}