Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

sd card reponse...plz help

Status
Not open for further replies.

ranjitneo

New Member
hi all

Am trying to make my laptop recognize an virtual SD card (sd card adapter connected to the spi of my microcontroller(PSOC controller)). I have seen many projects where in people have integrated the sd card with microcontroller. but i was not able to make out the response that the sd card is sending back.

One of it says expecting R1 but then what is R1 in terms of value.??

i went through the sandisk manual V1.9 which has he details in some of its registers like csd and csr. how ll i be able to emulate this.??

there is a format for R1 and then are things like payload and the crc.do i need to calculate and send it with every response.??

what are the commands that i should expect and what should i reply to make it recognize it as a SD card.

Plz consider this thread...any help regarding this will be greatly appreciated.

thnks a lot brothers...:)
 
There are two types of responses that the SD card can send, R1 and R2. They are simmilar, but for the most part you only need to worry about R1 (R2 is only returned on a couple of bulk commands I believe).

If you are using the SPI protocol, then you probably won't need to worry about CRCs unless you want to (it can be activated, but is not by default). The SDIO protocol, which is the newer/faster protocol that most commercial devices will use but it is significantly more complex.

Also, there are two specifications for the SD card. They recently (as a couple of years ago) took the complete specification out of public domain, and I suspect that you have the simplified specification. Have a look at the more detailed spec, which you can find here (hosted on my own site):

https://www.electro-tech-online.com/custompdfs/2007/09/ProductManualSDCardv22final.pdf

Good luck, it can be challenging, but is well worth the effort. If you need more help, let me know what specific problem your having and I'll see if I can help. I have working C source somewhere that I wrote for a PIC18F if you'd like I can dig it out.
 
hi...:)

thanks for the reply it was really helpful...

i checked for the data i am getting over the spi..
first i checked for cmd0 that is

cmd_00[] = "0x40,0x00,0x00,0x00,0x00,0x95,0x00,0x00,0x00,0x00";
(plz correct me if i am wrong)

then if matching then i send the response R1 that is 0x00

then i check for the following

cmd_55[] = "0x77,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00";
Acmd_41[] = "0x69,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00";
cmd_17[] = "0x51,0x00,0x00,0x01,0xBE";

each time if i get these packets then i send R1 which is 0x00;

then i send the boot packet which is

unsigned char boot_table[] = "0xEB,0x00,0x90,0x50,0x52,0x4F,0x01,0x00,0x00,0x00,0x00,0x20,0x00,0x01,0x01,0x00,0x02,0x20,0x00,0x20,0x20,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x29,0x31,0x39,0x38,0x35,0x50,0x52,0x4F,0x01,F,A,T,1,6,0xAA,0x55";

but nothing happens after this...i am totally struck...plz help
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top