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.

MicroSD / Transflash SPI Initialization

Status
Not open for further replies.

bishopd

Newbie level 1
Joined
Sep 16, 2005
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,290
microsd spi

I am interfacing a MCU to a microSD / transflash card using the SPI bus, but ran into some problems. I start by sending 160 clock with the chip select de-asserted (high) and the asserted the chip select and send CMD0 and correctly got the reponse 0x01. I then followed up by sending a CMD1 to take the card out of idle mode, but the idle bit is still set when I get the reponse 0x01. I then send another CMD1 to try to get the idle bit set to 0, and card stops talking. I have also tried send CMD55 and the ACMD41, but it does the same. I noticed the current draw is raised from ~1mA to ~20mA when I send the CMD1. Sending any command will again drop the current to ~1mA. Any ideas on what I am doing wrong????
 

microsd initialization

Hello bishopd,

After CMD1 send a dummy byte out , say $FF, then check if the card is out of idle in the next spi bus interrogation.

Use somenting like this:

Repeat
Low SD_PIN_CS ; select card
CMD1
SPI $FF ; send a dummy byte on spi bus
SPI $FF ; send again and
Until Inbyte = 0 ; you NOW check for $00
SPI $FF ; dummy byte again
High SD_PIN_CS ; release card

That should work.
HTH

Best regards,
mgf
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top