Re: Closest thing to a 42S-II Message #16 Posted by Dale Reed on 27 June 2012, 10:53 p.m., in response to message #15 by Eric Smith
I used FatFS on my "sound effects box" project. It has lots of compiler options to include features you need and exclude features you don't. I was using a Freescale micro with 32kB flash and 2kB RAM to basically play MP3s off the card, and I didn't need to save anything to the card. So I was able to go read-only (which reduces the code immensely!), and unbuffered (reducing the RAM footprint to under 600 bytes). And I still had FAT32 support, so I can use a 32GB SDHC card! I think the latest version of FatFS even has long filename support...
Basically you just need to provide a few low-level I/O routines: read a block, write a block, card status (card detect, write protect detect, etc.), that sort of stuff. The standard SPI interface (synchronous serial with read data, write data, clock and chip select) works with every SD card I've tried, even though support of the SPI interface is "optional" in the SDCard standard.
You can also use FatFS with IDE (P-ATA) and CompactFlash cards just as easily -- only the six low-level I/O routines really change.
I'll be happy to provide my ugly (but functional, and reasonably documented) source (for Freescale MC9S08QE32) in C if anyone needs it. (I tend to brute-force code stuff, rather than do fancy interrupts and callbacks and all that fancy stuff!.) I have the init, block read and card status stuff. (Didn't write a block write routine -- not required for read-only compile option...) Just mail me via the forum. Especially willing to trade if you have documented code for USB mass storage device or human interface device on MCF51JM128!
Dale
|