1
\$\begingroup\$

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).

\$\endgroup\$
4
  • \$\begingroup\$ Both products you link assume flash memory in card format, e.g. flash in SD card format. That's not SPI. I'm also wondering what you plan to use as the flash controller - who's going to do wear leveling? Wouldn't it be easier to use an eMMC part? Both parts you linked can speak MMC and probably eMMC as well. \$\endgroup\$ – MSalters Sep 5 '14 at 13:27
  • \$\begingroup\$ What is wear leveling? For the application, there wont be much writing happening (maybe once a week), but reading will be 10 times more often. \$\endgroup\$ – Shubham Sep 5 '14 at 17:00
  • \$\begingroup\$ I also thought SD cards were a type of serial flash that could communicate over SPI? \$\endgroup\$ – Shubham Sep 5 '14 at 17:01
  • \$\begingroup\$ True, SD cards historically allowed SPI as a fall-back interface, but that's slow. So it is quite likely that the two chips will not use SPI to talk to the SD card. \$\endgroup\$ – MSalters Sep 5 '14 at 18:39
1
\$\begingroup\$
  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.
\$\endgroup\$
2
  • \$\begingroup\$ I see. So if I have this straight. I need tt put a filesystem on the flash, then use the microcontroller with USB support to connect the flash as a mass storage device to the computer? \$\endgroup\$ – Shubham Sep 5 '14 at 17:04
  • \$\begingroup\$ If you're only ever making a single recording then I wouldn't even bother with a filesystem - there's only one "file" so recording where it's located is redundant. If you wanted to make multiple recordings then you'd need a simple filesystem. \$\endgroup\$ – markt Sep 5 '14 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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