SD Card driving recipe desperately needed / SanDisk problems

Hey all,

I am having problems using Sandisk SD cards in my embedded application. (SPI mode, one data line, interfacing consists of CS,CKK,DI,DO) Many other makes (eg Kingston) work fine here, but the customer wants Sandisk (due to better distributor connections) and of course (SNAFU) they refuse to work. I read around a lot about that topic and found many notes on Sandisk but did not find the real clue up to now.

Eg I found the tip to keep CS asserted all the time - but I can't as there are other partners on the SPI bus as well ..

The SD spec itself (

formatting link
) says one should issue a cmd called ACMD41 right after power on, (and provide permanent CLK at 100-400 kHz !!) but I NEVER found that cmd and clk handling everywhere in sample code on the web.

So if an SD god should read this, I'd be glad for some tips how to get those fu###ing Sandisk cards to work

tia w.b.

Reply to
analox
Loading thread data ...

Find a different customer..

I also have developed (and probed) the various SD cards via SPI, and simply put, no two cards behave in exactly the same manner.

Sandisk wrote the standard, yet they themselves don't adhere to it!!!! I know, I share your views, it's really frustrating.

Kingston seem to be the manufacturer which most closely meets the standard, and the cards are fast too.

If your customer is being so difficult that they can't understand what these companies are like with their standards, then that's a cause for concern.

Kingston are by far the best. And I've tested cards from about 15-different sources now. You can even have cards from the same manufacturer that follow different standards.. Since the company names just bulk buy in the cards then rebrand them. Fuji are a particular example of that here, I tested 4 Fuji cards which were all made by different sources and all behaved slightly differently. Two were both 64-MB cards with identical labels and stock numbers, yet were two completely different cards!!!! *rants*

Kingston by far seem the most consistant. I don't work for Kingston by the way, just that I spent months farting about with SD-cards via SPI... I now strictly supply only certain cards as having been tested. If the customer uses a card that I haven't tested, then I won't support them.

Kingston. Time to put this argument across to your customer. If they won't budge, drop them. It really will be less hassle in the long run. They'll find out eventually when they keep on running into weird unexplainable problems.

Reply to
Aly

Im not using the SD/SPI protocol , i am using simpler .

I dont "format" the SD , i simply map it as flat RAM , but with a serial # , to make it unique . If it has non-data , then it has a place in Op Sys , so it will drop in precisely . First sector and all sectors , aprox 10% deeper are Dir/system .

SD will never boot any of my hardware ! Thats a job only for the h/w ! I dont use any of the "modern" protocols , far too complicated .

USB is bidiectional , peer to peer , no more control packets ! If you want to "command" anything you must put it in a packet . Packets can be very long ! This allows much higher speed . There is no more "hi-speed" , its decided in h/w as data is moving .

Reply to
werty

Hi, I had a problem like yours The problem was bad SPI signals (too high frequency) : they looked likes sines rather squareq...

Try to drop the SPI bus frequency.

Yvan

**********************
formatting link
**********************

"analox" a écrit dans le message de news: snipped-for-privacy@l53g2000cwa.googlegroups.com...

Reply to
Yvan BOURNE

Have you also read the Sandisk MMC docs? These discribe the the SPI mode pretty well.

With MMC I have had a problem of my card detecting transitions in \CS. The card would only detect them if the clock was kept runnning for at least another byte (or more?) after the transition. Never had the problem before as we had used the MMC previously on a chip that would always keep the SPI clock running.

In hindsight we could find this requirement in the timing diagrams, but it was not so obvious.

--
Stef    (remove caps, dashes and .invalid from e-mail address to reply by mail)
Reply to
Stef

Please do not top-post. Your answer belongs after, or possibly intermixed with, the material to which you reply, after snipping anything not germane to that reply.

--
Some informative links:
  
 Click to see the full signature
Reply to
CBFalconer

Reply to
Ramses

I trying to interface with a SD card in SPI Bit-banging. I succes to sen the CMD0 to the card(I think) i'v got the same osciloscope capture the the one in this pdf with the R1 response.

formatting link

But when it's time to read my function give me 0xFF al the time.

If someone can help me with this I going crazy.

Here my function:

unsigned char SDresponce( void ) { unsigned char n, DataIn = 0xFF; unsigned int count = 256;

CS = LOW; mSCK = 0; //Make sure clock is low

Reply to
lp987

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.