Electronic – SD card emulation

msp430sdspi

Problem description:

I've built a MSP430F2370 based 15693 RFID tag reader/writer .
The main board has a daughter board, shaped as a SD card,
which connects to a SD card holder/reader.

We were planning to communicate with a Windows Mobile 6 handheld
via SD card interface using SPI. Our software team told us this was technically impossible,
or at least would take a couple of months to implement. We got three weeks to finish all of it.

So, the ball returned to me. Now I was asked to emulate a SD card
with the MSP. This includes all the SPI communication and FAT16 emulation as well.
This has been done before, afak not with a MSP though.

Question:

After some search, I was unable to find previous works
using MSPs to emulate SD cards. Is there any info/work done about it?
Also, I have a handfull of thick SD card specifications PDFs, but I can't seem
to find timing diagrams telling what a happy SD card should send to a host.
If someone could also please address me to a more concise, good documentation on this,
it'd be very nice.

Best Answer

Your task is certainly not impossible, but I think you would have 90+ hour weeks for those three weeks to get something you might be able to use.

There isn't a single "ZOMG" part of the design; there are a number of smaller blocks that are pretty compartmentalized and straightforward on their own. For example, there's the physical interface: SD cards are essentially (up to) "four-lane" SPI buses, and you can limit yourself to SPI mode to start to make things easier. This isn't terribly complex to do, especially if you have a SPI slave peripheral in hardware that you can use. Supporting enough of the SD protocol to fake out the Windows side probably won't be difficult either, especially if you can limit yourself to emulating an MMC card instead, which is less complex. Emulating a file system is also not terribly difficult. I think where things will get hairy is in the details of interconnecting these blocks and then spending a LOT of time working out the odd little thing that doesn't work.

Like the saying goes... the devil's in the details. From a high level perspective this is doable, although I think your timeframe is unrealistic. Nobody can work 90h weeks and maintain focus and clarity of thought.

And like my favourite saying goes... The difference between theory and reality is that in theory, there is no difference.