7,7 → 7,7 |
#include "printf_P.h" |
#include "crc16.h" |
|
#define _SD_DEBUG |
//#define _SD_DEBUG |
|
#define CMD_GO_IDLE_STATE 0x00 /* CMD00: response R1 */ |
#define CMD_SEND_OP_COND 0x01 /* CMD01: response R1 */ |
140,9 → 140,9 |
SSC_Disable(); // disable chipselect. |
SSC_PutChar(0xFF); // dummy to sync |
SSC_Enable(); // enable chipselect. |
_delay_loop_2(200); |
//SDC_WaitForBusy(500); // wait 500ms until card is busy |
|
SDC_WaitForBusy(500); // wait 500ms until card is busy |
|
for (a = 0;a < 6; a++) // send the command sequence to the sdcard (6 bytes) |
{ |
SSC_PutChar(cmd[a]); |
152,7 → 152,7 |
do |
{ |
r1 = SSC_GetChar(); // get byte from sd-card |
if (timeout++ > 1000) break; |
if (timeout++ > 500) break; |
}while(r1 == 0xFF); // wait for the response byte from sd-card. |
#ifdef _SD_DEBUG |
printf("-->R1=%02X", r1); |
312,7 → 312,7 |
SSC_Init(); |
printf("ok"); |
|
_delay_loop_2(1050); |
//_delay_loop_2(1050); |
|
printf("\r\n SDC init..."); |
SDCardInfo.Valid = 0; |
518,10 → 518,10 |
switch(SDCardInfo.Version) |
{ |
case VER_1X: |
printf(" SD-CARD V1.x"); |
printf("\r\n SD-CARD V1.x"); |
break; |
case VER_20: |
printf(" SD-CARD V2.0 or later"); |
printf("\r\n SD-CARD V2.0 or later"); |
default: |
break; |
} |