4
\$\begingroup\$

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.

\$\endgroup\$

5 Answers 5

6
\$\begingroup\$

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.

\$\endgroup\$
5
  • \$\begingroup\$ Hehe, I always knew it as: "In theory there's no difference between theory and practice, but in practice there is." \$\endgroup\$ Commented Mar 30, 2012 at 20:33
  • 3
    \$\begingroup\$ I agree with this answer. If you can complete this in 3 weeks, you deserve a Nobel Prize. \$\endgroup\$ Commented Mar 30, 2012 at 20:34
  • 4
    \$\begingroup\$ He mentioned that he has a software team for the Windows Phone part of the project. With 3 or 4 people working on it, your estimate of 270 hours in 3 weeks isn't bad at all. If they're Visual C# developers (For WP7), they're minutes away from being able able to write some bad C code if you ask them to. Also, consider that there's no need to implement a generic MMC card or filesystem; he only needs to emulate a single-size card, one filesystem containing one file and no folders, and a single file whose size doesn't need to change. \$\endgroup\$ Commented Mar 30, 2012 at 20:35
  • 2
    \$\begingroup\$ Minutes away from writing some bad C code... I like that. It sounds like a terrible idea that too many people will be ready to take you up on. \$\endgroup\$
    – AngryEE
    Commented Mar 30, 2012 at 21:55
  • 2
    \$\begingroup\$ Or the name for a great starting C book! \$\endgroup\$
    – AngryEE
    Commented Mar 30, 2012 at 22:02
3
\$\begingroup\$

I don't really have an answer for you, but when working with SD cards and FAT16 on the MSP430, I have found the following two resources helpful:

SD Cards with the MSP430

FAT16 for the MSP430

\$\endgroup\$
2
\$\begingroup\$

We were planning to communicate with a Windows Mobile 6 handheld via SD card interface using SPI.

Unforunately, the SD host decides which protocol to use. For a Windows mobile device I would expect it to use the faster SD protocol and not SPI. So you'd need to implement SD protocol, which is 25 MHz: Waaay too fast for you MSP MCU, the one you mentioned tops at 16MHz.

To implement a SD card you'll need a fast MCU (ususally ARM based) with hardware SD protocol support or a ridiculuos high clock >>100 MHz.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Or a small FPGA to handle the fast interface and buffer it for a slower MCU. the SD protocol has built-in rate limiting so you could take advantage of that. \$\endgroup\$
    – akohlsmith
    Commented Apr 1, 2012 at 14:24
1
\$\begingroup\$

If doing it at all is more important than how you do it, then doing it with whatever is easiest (maybe because code is available) and then communicating between your MSP430 and he separate system would probably be easiest. Overall the task is more complex, but if ghe hardest part has been achieved for you already you win.

\$\endgroup\$
1
\$\begingroup\$

A similar solution was done in 2006 as part of a Circuit Cellar Design Challenge. The entire project software and hardware can be found here. This solution pumps data into a picture book, but yours is a similar concept.

\$\endgroup\$
2
  • \$\begingroup\$ This should be a comment on the answer you point to. \$\endgroup\$
    – user17592
    Commented Feb 10, 2013 at 15:18
  • \$\begingroup\$ On the SE system we prefer answers to be self contained and only use external resources. If you would like to write an answer, please summarize what you are linking to so if that link breaks your answer is still an answer. When you gain more rep on the site you can write comments and just leave something like this as a comment to another answer/question. \$\endgroup\$
    – Kortuk
    Commented Feb 10, 2013 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.