Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SD Card Initilization & dislplay Char through serial port

Status
Not open for further replies.

w_bwr

Member level 3
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.

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();
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top