3
\$\begingroup\$

I'm about a to choose a chip to store a mp3 file (few mo) in it. But I don't really know how to well choose such a memory. Should I go for a flash memory? Eeprom? Nand? Nor?

What kind of parameters should I consider in my choice?

While consulting some distributor online shop, I figure out that SPI communication is widely use instead of I2C or UART. Is there a reason for that?


The memory will store only one file of few mo. The idea of the design is to load a part of the file in the MSP430 (the µC I'll use), process the data and then send it to a DAC. Since MP3 file have a sampling rate of 44100 Hz, I think the transfer speed has to be 4 or 5 time greater. I never use a memory or even audio conversion (from Digital or Analog) so I don't exactly know the require speed.

\$\endgroup\$
  • \$\begingroup\$ Way too broad a question. Which type of processor? Running what type of software? Number of files and size per file? How fast do you need to be able to copy them? As for why SPI rather than I2C - UARTs are designed around single bytes of data not bulk transfers, I2C is slow. SPI is far faster and lower overhead. And then there are all the non-serial connection options. \$\endgroup\$ – Andrew Jun 2 '17 at 8:15
  • \$\begingroup\$ @Andrew Let me edit the question to bring some more informations then \$\endgroup\$ – M.Ferru Jun 2 '17 at 8:17
  • \$\begingroup\$ Will you be decoding the MP3 in the MSP340? \$\endgroup\$ – Roger Rowland Jun 2 '17 at 8:26
  • 1
    \$\begingroup\$ @Anonymous Agreed, a FAT format SD card is the way I'd go too assuming the overhead isn't an issue (if he wants to decode MP3s then he'll need all the RAM and CPU power the MSP can give him). If size, mechanical robustness (SD cards can fall out) or CPU/RAM overhead are an issue then an SPI FLASH chip soldered down may be a better choice. \$\endgroup\$ – Andrew Jun 2 '17 at 8:40
  • 1
    \$\begingroup\$ @M.Ferru Any specific reason why you are going for this method of playing an MP3 from flash? There are dedicated MP3 playback chips which would make your life a lot easier if that's all you need to do. Some even have built in flash for holding the audio. \$\endgroup\$ – Andrew Jun 2 '17 at 8:42
3
\$\begingroup\$

Basing on the discussion let me compile the answer -

  1. EEPROM/flash solution seems to be the easiest one, and MSP430 is having built-in interface for them, but there're several drawbacks: you will need to implement manual error handling/correction; chip is not removable; and finally it may wear (you may need to implement wear leveling stuff).
  2. I recommend to focus on the slightly different architecture:

    • use SD-card as a storage through SPI; it will perform all low level tasks for you, is removable, and intended for frequent rewrites, and in general more convenient;
    • however you will need to implement file system handling of the volume, I came across Elm-Chan's Generic FAT file system module with sample code to control MMC/SDSC/SDHC (FatFs), I did not use it myself but heard positive feedback about it; it seems to support your MCU;
    • you may consider using special IC for MP3 decoding - it will free computing power of the MCU for something more useful than doing MP3 decoding. I know about VLSI Oy from Finland, I am sure you will find more manufacturers (through e.g. Digikey). Note that these chips are having MP3 and other codec licence with them, thus you will be legally clean in this respect, if at some point of time you will decide that you device it good to be sold on the market.

Edit: @AndrewMorton pointed to MP3 press release stating "licensing program for certain mp3 related patents ... has been terminated", if you follow the further link you can see

However, the end of the mp3 licensing program does not automatically mean that all mp3 technology is available license-free now. Apart from the core mp3 patents included in the licensing program, there might still be some implementation–specific patents (or patents for other functional enhancements) that have not expired. Thus, manufacturers will have to check the situation regarding their intended products first before including mp3.

Thus there might still be a legal risk.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

When choosing a memory you may have several specifications.

  • Type. Volatile/non-volatile.
  • Size. How many bits.
  • Speed. Eg: Writing RAM will be faster than an FLASH/EEPROM.
  • Endurance. How many write cycles.
  • Interface. How fast to read/write?
  • Price. On large quantity with one-time write data ROM might be cheaper.

You want to store several MB of MP3, and you want to store it long term. Probably not changing it often.
Following above list, you'd want: large, fast read, few-times programmable non-volatile memory.

This excludes EEPROM, FRAM en (battery backed up) SRAM, since all of them are small memories that are designed to be able to write to often (high endurance). Any RAM is random-read-write, EEPROM is word or page erasable, takes some time, but is still flexible to use.

FLASH on the other hand has slow erase, since it involves entire pages, but is still reads fast and is cheap to make in large quantity (size). You can't indefinitely re-write FLASH, as you can with RAM or FRAM.
EEPROM is technically still FLASH, but then byte or word erasable.

You will need FLASH. To play an MP3 you will need some throughput. This is where the interface comes in. I2C will be the slowest, single SPI is faster, quad SPI is even better. And parallel flash will be the fastest you'd be able to get.

I think you can do what you want to do with a SPI FLASH chip. Like an SD card. But you could also use an flash chip solution on the market. As long as you can interface it.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ If I am not mistaken, the eMMC card no longer support SPI interface. They require instead a special MMC interface. \$\endgroup\$ – nickagian Jun 2 '17 at 8:40
  • \$\begingroup\$ @nickagian you are correct. \$\endgroup\$ – Jeroen3 Jun 2 '17 at 8:46

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.