sd card - mmc interfacing to and end - so i've got a better option

demonicpicaxeguy

Senior Member
it's been a long time going at it with different cards from different manufacturers, different voltage regulators , and various different circuits trying to get a reliable and repeatable read and write operation out of any of these cards

the sd specification is lousy at describing the 1 bit spi protocol in any real detail and the mmc specifications aren't much better

the vast majority of the cards i have tried, do not follow the 1 bit spi mode in any reliable way or at all to the specifications

now that i have officially given up on the whole sd card and mmc card idea i'm looking at alternatives that is much easier and simpler to interface to and i've got this in mind since i've had some experience with similar devices in the past:

The K9F8G08U0M-P by samsung is a 48 pin 8gbit(1gbyte) flash chip
the chip itself actaully only uses about 14 pins for operation and is built in a similar fashion to the old style parallel eprom memmory only extended a bit to accomadate the larger capacity

i'm looking into mounting these onto a pcb with a 3.3 regulator and a level shifter and if anyone is interested i'm willing to stick a reasonable price on them

anyone got any ideas ,thoughts ,coments and criticisms of the idea?

 
Last edited:

hippy

Technical Support
Staff member
A 14-pin interface doesn't sound that simple, but if it works and MMC/SD doesn't then it's hard to quantify. The appeal of MMC/SD is low cost, easy availability ( often already owned and re-usable elsewhere ), and simple ( in theory ) interfacing.

The K9F8G08U0M seems to also be quite complex to control and there's the issue with invalid blocks which cannot be avoided as it appears chips will be shipped with invalid blocks ( page 0 only guaranteed for up to 1K erase cycles ), and it's up to the programmer to work logical addressing around bad blocks.

1GB should be plenty, but if you don't actually need that much there are some quite large I2C/SPI Eeproms which can be stacked up to make large memories and the advantage of I2C is that it should be plug 'n' play with very little driver code needed.

For a specific solution I don't see anything as a bad choice, but for more general purpose use I'd say MMC/SD or I2C/SPI would be better.
 

demonicpicaxeguy

Senior Member
A 14-pin interface doesn't sound that simple, but if it works and MMC/SD doesn't then it's hard to quantify. The appeal of MMC/SD is low cost, easy availability ( often already owned and re-usable elsewhere ), and simple ( in theory ) interfacing.

The K9F8G08U0M seems to also be quite complex to control and there's the issue with invalid blocks which cannot be avoided as it appears chips will be shipped with invalid blocks ( page 0 only guaranteed for up to 1K erase cycles ), and it's up to the programmer to work logical addressing around bad blocks.

1GB should be plenty, but if you don't actually need that much there are some quite large I2C/SPI Eeproms which can be stacked up to make large memories and the advantage of I2C is that it should be plug 'n' play with very little driver code needed.

For a specific solution I don't see anything as a bad choice, but for more general purpose use I'd say MMC/SD or I2C/SPI would be better.
from where i'm sitting the problem with sd cards and mmc cards is different cards seem to have different electrical properties which makes designing a circuit to suit as many as possible almost impossible. the actaul 1 bit spi protocol that every mmc and sd card has to support isn't really implemented to the letter of the specifications or not at all the repeatability is yet another issue and reliable initialisation through the supposed 2.6 to 3.3v range is somthing that isn't evident with quite a few cards, if you look at the working sdcard and mmc card interfaces that do work that are out there you tend to find they will only work with a select few cards or reliable operation is more a form a luck than anything else

the K9F8G08U0M has a few draw backs and a very serious one in terms of invalid blocks which is somthing i'm concerned about how to deal with, interfacing to them can't be anymore complex and problematic that dealing with sd cards that don't appear to adhere to an international standard,

in essence i'm looking at it in terms of 1gbyte of storage with a similar interface i've used before vs 1gbyte of storage you can't use at all because of an interface that doesn't adhere to a standard...

as far as space goes even the 1mbit i2c flash chips aren't enough for what i need and speed is aslo an issue on them as well for what i need

the kind of space requirements needed by my pressure logger is 512mb and up - for those who wondering what i need that much space for , it's for a pressure logger that logs at 1500samples/sec and when coupled with another one can place sources of water hammer in water mains at distances of up to 3km apart depending on pipe size ,pressure and water hammer intensity
 
Last edited:

manuka

Senior Member
1500 samples/sec ? With a PICAXE? Tell us more.

FWIW, & as the SD theme is topical, I've just saved the day at a Xmas function by lo-tech rescuing a camera's "no-go" 1GB card with a thin strip of tape. These increasingly popular (& ever cheaper) SD memory cards have a tiny sliding lock switch, similar in action to write protection on floppy/VHS tape (-remember these?), but it seems the clearances on some budget/thinner SDs are rather too sloppy. Hence the "padding", which enables the device mechanical sensor to better register the slider as being ready for action. Naturally ensure the tape does NOT come adrift in the memory card slot of your camera/laptop etc ...

Few instruction manuals mention the function of this SD switch, & novice digital camera owners (many of whom are already gobsmacked with the technology!) are naturally spooked out when the LOCKED CARD message appears. Bravo-you can be the white knight with such a quick rescue, calming the anguish of "Argh- I've lost all my photos" & "My new camera is stuffed already" . It should be worth a few free drinks- at least!
 

Attachments

Last edited:

demonicpicaxeguy

Senior Member
for that kind of sample rate i use a raw pic but things are short lived due to data storage problems , hence the thread,

i've noticed that quite a few of the cheaper cards are quite badily assembled the little switches on the side somtimes binds on the sd sockets some are just that little bit too thick, i've even got one that had excess plastic stuck to the edge from where it has been moulded... how did that get past quality control...?
 
Last edited:

demonicpicaxeguy

Senior Member
What about one of these:

http://www.dontronics-shop.com/4d-uDRIVE-uSD-G1-Tiny-Disk-Drive-Data-Storage-Module-p-16692.html


$39.00 and only needs 5 pin serial connection for microcontrollers - VCC, TX, RX, GND, RESET.
i have tried these modules before and getting some of them to work let alone at the advertised speed for some of them can be problematic yet some of them work flawlessley,

they aren't bad for basic data logging to a simple text file

the problem though using them for commercial applications is that the costs can add up especially for really simple data loggers that only contain upto $20 worth of parts yet the module costs 2 thirds more again,

these nand chips are pretty much whats in sd cards anyway the sd cards just have a controller chip in there as well ,i've also now got a price on a 2gb nand chip $10.00usd for 1 and then there are some very very heavy discounts that reduce the price down very quickly thats not a bad price for 2gb of data storage,

also looking at the protocol in more depth it's actaully a very simple protocol i'm guessing it'll only take maybe around 15 to 20 lines for a read and write procedure,
 

hippy

Technical Support
Staff member
from where i'm sitting the problem with sd cards and mmc cards is different cards seem to have different electrical properties which makes designing a circuit to suit as many as possible almost impossible. the actaul 1 bit spi protocol that every mmc and sd card has to support isn't really implemented to the letter of the specifications or not at all the repeatability is yet another issue and reliable initialisation through the supposed 2.6 to 3.3v range is somthing that isn't evident with quite a few cards, if you look at the working sdcard and mmc card interfaces that do work that are out there you tend to find they will only work with a select few cards or reliable operation is more a form a luck than anything else
I can't believe MMC/SD cards are as problematic as that or I'd expect to hear far more tales of woe from consumers than we do. There always will be some problem cards and those which diverge from the spec but when more don't work than do I suspect there's a more fundamental problem.

If there were such serious incompatibilities they'd have never become the success they are. If there are problems, it seems many companies have solved them or overcome them to a good degree.

interfacing to them can't be anymore complex and problematic that dealing with sd cards that don't appear to adhere to an international standard
Famous last words :)
 

ylp88

Senior Member
Unfortunately, I've got relatives over and have been displaced from my room and thus have not been able to do any refinements or changes to the SD interface code I posted a month or so back.

Anyhow, if the chips were easy enough to acquire, I'd give it a go just to see how things turn out. Although there are some hurdles to overcome (of all the chips out there, there are probably precious few which don't have some kind of hurdle to overcome...) judging by my personal attempts to get the SD card interface working as well as the attempts of others, things are not always left to be as easy as it initially appears, and luck might play a big part in success!

What about one of these:

http://www.dontronics-shop.com/4d-uDRIVE-uSD-G1-Tiny-Disk-Drive-Data-Storage-Module-p-16692.html

$39.00 and only needs 5 pin serial connection for microcontrollers - VCC, TX, RX, GND, RESET.
I did have a brief look at this module at one stage but then one problem arises for me that my personal application for the SD card requires a much higher bandwidth than that provided by a traditional (and easy to implement, and usually use) RS232 serial interface. My application is probably looking close to 200-300kbps. That said, I don't expect my PICAXE SD card interface to achieve those speeds but I am primarily doing it as a bridge to familiarise myself with the interface (its complexities!) and then somehow port/convert it to a plain PIC.

ylp88
 

demonicpicaxeguy

Senior Member
I can't believe MMC/SD cards are as problematic as that or I'd expect to hear far more tales of woe from consumers than we do. There always will be some problem cards and those which diverge from the spec but when more don't work than do I suspect there's a more fundamental problem.

If there were such serious incompatibilities they'd have never become the success they are. If there are problems, it seems many companies have solved them or overcome them to a good degree.



Famous last words :)

i've got doubts that they will be the last words,
my other main motivation for resorting to using the nand memmory directly is that i had some good success before with two of the older ones i pulled from an old mp3 player the chip's were km29u128t the pinouts i don't think have changed much since then and niether has the protocol infact i think if anyones got the time to go looking you'll probably find the protocol is roughly the same as the older parallel eeproms used to use


i suspect that there is more than meets the eye with whole sd/mmc specification and the spi 1 bit mode

i'm betting that the majority of the companies that make devices like digital cameras, mp3 players + various other things that want the high speed transfer capabilities have just forked out the money for the sd specifications which is probably why there isn't greater compatibility issues after all i don't imagine sd/mmc card manufacturers putting too much time and effort into supporting a protocol that they don't think will actaully get used that much

i've also found out somthing interesting the xd cards are actaully just the same kind of nand chip inside a fancy casing with all the required pins exposed for use, not a bad way to go and they are smaller than the sd/mmc cards as well
 

Dippy

Moderator
I've only skimmed this as I've had far too much brandy butter on my Christmas Pudding (am I allowed to say Christmas these days?? I think it's been banned at a lot of poofy UK Councils).

We've done a number of codings for SD interfacing and rarely had trouble with data. And it's usually a clocking/timing issue. Older/smaller MMCs have given problems, however, when trying to make a general interface using SPI, which is a useful option for SDs and similar.

Remember, all/most(?) cameras that use memory cards have a fast internal memory buffer which transfers slower to SD or CF.

Try not to blame the SD too much, it's usually the coder :)

Right, I'm off to bed....
 
Top