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.

need help in microSD card interface

Status
Not open for further replies.

karthi_keyan

Junior Member level 2
Joined
Sep 17, 2009
Messages
20
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Location
coimbatote
Activity points
1,419
hai all,

I am using 2GB transcend card & am trying to interface with PIC24F series mirocontroller(3.3V).when am trying to send (CMD0 -RESET)the pin out SDO gives low level voltage data(1.7V) and i pull up that pin with (10k(or)100k) it went to high state.so am getting some other response instead of 0X01 .please any one help me to fix this problem.

regards,
KARTIKN
 

hello

i think u dont have to pull up the output pin or any pin of the card of ur sdcard as ur microcontroller and the sdcard are working with the same voltage level

2- the response 0x01 when recieved that mean ur card is not detected so u may tast ur board conection by the softwate (turn on led when the response not equal 0x01)

3- check that ur SPI is working well

this is the reset command example

/* now send CMD0 - go to idle state */
// all the arguments are 0x00 for the reset command
x=SPI(0x40); // send reset command
x=SPI(0x00);
x=SPI(0x00);
x=SPI(0x00);
x=SPI(0x00);
x=SPI(0x95); // precalculated checksum as we are still in MMC mode

if (SDC_response(0x01)== 1) return 1;//SDC Not detected

porta.f2=0;//led on

hope this answer will help u

reda
 

thanks reda....
actually the problem with SPI modes.i kept the SCK ,SMP bits high and tested with minimum datarate....it gives correct response.these steps will help those trying SD interface.

if ur init cmd fails to give 0x01..u cant go further .the following steps will help you,
step1:u ll not get the response at first pass.. so write like this,
do
{
if((Command(0x40,0x00,0x00,0x00,0x00,0x95) == 0x01)) // CMD0 to reset and to bring CRC none //ned
break;
}while(++k<100);
Step:2
use command to define ur block length,minimum 512.
do
{
if((Command(0x58,0x00,0x00,0x00,0x00,0xff)) == 0x00) // CMD to bring out from idele mode
break;
}while(++k<100);


NOTE:Command function process 6 bytes
byte 1:cmd num
byte 2-5:32 bit address
byte 6:CRC
you no need to worry about 32 bit address. it can be define directly by block number.like this.....
Address=512*block_number;
AddMH = Address>>24;
AddML = Address>>16;
AddLH = Address>>8;
AddLL = Address;(always 0x00)
Regards,
KARTIKN.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top