Designing Flash Memory to USB Mass Storage bridge

flashmemorysdusb

I've been scratching my head at this for a while now. I'm trying to build a device that records audio using a VS1053 encoder IC to some sort of SPI flash memory. I want to be able to download the recorded files via USB to a computer.

Currently I'm using Adafruit's breakout board to record OGG audio to a microSD card which I can plug into a computer. I would like to eventually design my own board that has the encoder IC, SPI flash memory, and the USB bridge(?). Here are the questions I have:

  1. Can I use any type of flash memory IC like this one? 64Mbit will be enough for my application.
  2. Existing libraries for the audio encoder output data to an SD card. Can external flash memory be configured to appear as a very low capacity SD card?
  3. For the aforementioned USB capability I found a couple of memory controller ICs:
    -Maxims MAX145002: Probably too expensive for my application (~$20)
    -Microchip's USB4640: Reasonably priced (~$3)
    Will these memory controllers work with SPI flash memory?

Also if it helps to know, this is a for a prototype of a device that will enter low volume production (100s to 1000s).

Best Answer

  1. You can use any type of flash memory that allows you to write at least as fast as the encoder produces data. That one allows ~84kB/s to be written to it (3ms worst case write time, max 256 bytes per page program operation), which should easily deal with the maximum throughput of the VS1053.
  2. Most SPI flash doesn't deal well with PC-type file systems because the minimum erase size is usually several kB and the access speed is usually not great (e.g. 84kB/s write and the sector and block erase times are horrendous). There are minimalist embedded flash filesystems around that might do what you need, but they're so simple that it might be easier to just write your own rather than try to understand someone else's library.
  3. There are cheap ARM MCU's with USB support and at least 2 SPI modules (1 each for the VS1053 and SPI Flash). Given the small volume of data, USB2 Full Speed (12Mbps) is probably adequate for your purposes so something like an STM32F042 might do the job. $3-4 in small quantities.