w_bwr
Member level 3
- Joined
- Feb 4, 2010
- Messages
- 66
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Location
- Karachi, Pakistan
- Activity points
- 1,810
I am trying to interface SD card with ST10276e controller.
During Initializing SD card don't go to IDLE State. SD card returns a 8bit data to every command send, which tells the status of the command.
I have declared a character type variable "ucStatus" to hold the returned token.
I want to display it on my screen through serial port.
I have tried SerialPrint(ucStatus); but it prints an alien character.
How can i display it.
During Initializing SD card don't go to IDLE State. SD card returns a 8bit data to every command send, which tells the status of the command.
I have declared a character type variable "ucStatus" to hold the returned token.
I want to display it on my screen through serial port.
I have tried SerialPrint(ucStatus); but it prints an alien character.
How can i display it.
Code:
unsigned char SD_Init(void)
{
unsigned int i; unsigned int retry=0;
unsigned char ucStatus, SDVersion;
for (i=0;i<10; i++)
SPITransmit(0xFF);
CS_low();
do
{
ucStatus = SD_SendCommand(GO_IDLE_STATE,0);
if (retry++ > 0xFF)
{
SerialPrint("Failed to be in Idle State\r\n");
SerialPrint(ucStatus);
return 1;
}
}
while (ucStatus != 0x01);
CS_high();