LPC2138 with sd card using SPI

command for sdcard,

example:

CMD0 we sent data (0x00 & 0x3F)|0x40 to SPI

r ok?

and

i have problem in the initailized sd card.

i sent CMD0 have response , CMD55 , ACMD41 haven’t response from SD Card.

i didn’t pull up resister at MISO,MOSI

i am beginning. thank for explaination.

don’t worry,there is no need fpr pull up resister at MISO,MOSI

You can try this way:CMD0–>CMD1–>…

if CMD1 has no response,then it’s the problem of SD_Init.

thank u

i try to CMD0—>CMD1—> CMD55---->ACMD41

it’s ok.

in fact,as CMD0–>CMD1,what u need to do is to set how many byte SD card send to you per time.after this,if SD card works well,thenyour driver function is OK.Maybe something wrong with your ACMD functions?

check it out. :smiley:

i write block(single block) by this step

  • cmd24 and address of sd card

  • wait response

  • send cmd[0] = 0xFE and data

  • send cmd[0] = 0xFF, cmd[1] = 0xFF

*-wait response = 0x05

*this problem,it dosen’t response = 0x05;

i’m not sure is correct.