正常初始化后在发送CMD17准备读取SD卡中的数据时一直得不到0XFE的响应。各位帮帮忙~~谢谢
串口发送出来的结果:
THIS IS A TEST!
CMD0'S RESPONSE IS 1
CMD55'S RESPONSE IS 1
CMD55'S RESPONSE IS 1
THIS IS A TEST!
CMD0'S RESPONSE IS 1
CMD55'S RESPONSE IS 1
CMD55'S RESPONSE IS 1
CMD55'S RESPONSE IS 1
CMD55'S RESPONSE IS 1
ACMD41'S RESPONSE IS 0
SD CARD INITIALIZE IS DONE!
CMD16'S RESPONSE IS 0
CMD17'S RESPONSE IS ff
CMD17'S RESPONSE IS 0
THE END CMD17'S RESPONSE IS 0
WAIT FOR THE 0XFE RESPONSE IS ff
WAIT FOR THE 0XFE RESPONSE IS 0
WAIT FOR THE 0XFE RESPONSE IS ff
WAIT FOR THE 0XFE RESPONSE IS 0
WAIT FOR THE 0XFE RESPONSE IS ff
WAIT FOR THE 0XFE RESPONSE IS 5
WAIT FOR THE 0XFE RESPONSE IS ff
----------------------------------------------------------------代码如下-----------------------------------------------------------------------------------------------------------BYTE SDRDDATA[SD_DATA_SIZE];
BYTE SDWRDATA[SD_DATA_SIZE];
BYTE SDCMD[SD_CMD_SIZE];
BYTE CODE[1]={0XFF};
void SPI_INIT(void) SPI初始化{
PINSEL1=0X00A8;
IODIR0=SPI_SEL;
IOSET0=SPI_SEL;
SSPCR0=0X0707;
SSPCR1=0X02;
SSPCPSR=0XFE;
}
void SPI_SEND(BYTE *buf,DWORD LENGTH)
{