shari2643
Newbie level 4
- Joined
- Jul 27, 2013
- Messages
- 5
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 44
HTML:
COMPILER: HITECH C18 9.8
CONTROLLER: PIC18F4520
SIMULATION: PROTEUS ISIS
HTML:
CMD8 = 0x48 0x00 0x00 0x01 OxAA 0x87
HTML:
Response i should be getting is 05 . what i am getting is 04 (As proteus has no SD CARD SO I AM USING MMC CARD IN SIMULATION).Is 04 response ok?
kindly If anyone of you could spare a few moments and give a direction.
Code:
SS=0;
//CMD8
WriteSPI (0x48);
WriteSPI (0x00);
WriteSPI (0x00);
WriteSPI (0x01);
WriteSPI (0xAA);
WriteSPI (0x87);
ReadSPI();
save=ReadSPI();
//RESPONCE OF CMD8 is
USARTWriteLine(" ");
USARTWriteString(" THE RESPONCE OF CMD8 IS :");
USARTWriteInt(save,2);
USARTWriteString("\r\n");
if(save==0x1AA) //IF RESPONSE IS 0xAA
{
USARTWriteString("**SD CARD IS V2 OR HIGHER**");
}
else // IF RESPONSE IS 1
{
USARTWriteString("**CARD IS MMC OR SD CARD V1 **");
}
SS=1;