Building a media player with an MSP430

A media player based on an Arduino and SD card has been done to death several times over, but that doesn’t mean we can’t appreciate [Matt]’s MSP430 audio player. It’s a very nice piece of work that supports a FAT16 file system and only takes up 54 bytes of RAM.

To make his dream of a 430 media player a reality, [Matt] based his work on the DIY Life Talking MSP430 project. Unlike this previous attempt to play music with a ‘430 and SD card, [Matt] threw in a full FAT16 file system, allowing him to drag and drop audio files on his computer to the SD card.

Right now [Matt]’s build can play a stereo audio file through its speakers, but the sound quality over a mono file is greatly reduced. The maximum sample rate is 16kHz; a ‘good enough’ sample rate if you’re listening with terrible headphones. In the video after the break, [Matt] plays this awesome Symphony of Science on his homebrew media player. We’re guessing his camera doesn’t do his project justice, but it’s still impressive nonetheless.

[youtube=http://www.youtube.com/watch?v=g_SGHgO7Hus&w=430]

Comments

  1. thatcherc says:

    54 bytes??? That’s crazy!

  2. kendall14 says:

    54 bytes!? It’s easy to have a comment that is larger!

  3. Faelenor says:

    54 bytes? Data read from the SD card is not buffered?

  4. FrankTheCat says:

    54 bytes?? I hardly knew ‘er!

  5. uC says:

    From “ThinFAT.h”

    //*****************************************************************************
    //
    // Title : Thin FAT File System
    // Author : Matthew Rogan
    // Created : 22/03/2012
    //
    // This code is distributed under the GNU Public License
    // which can be found at http://www.gnu.org/licenses/gpl.txt
    //*****************************************************************************

    #include "mmc.h"
    #include "ThinFAT.h"

    // total ram use 54 bytes

    // Current Loaded File System 14 bytes
    struct sThinFAT16FS {
    unsigned long BootSector; // First sector of FAT16 Partition
    unsigned char FatSector; // Sector of first FAT
    unsigned int RootSector; // Sector of Root Directory
    unsigned int FirstCluster; // Sector of First Cluster
    unsigned char ClusterSize; // Sectors in Each cluster
    unsigned char ClusterShift; // power of 2 of the cluster size
    unsigned int RootEntrys; // Count of entry's in Root Directory
    unsigned char SDStatus; // SD card status
    } ThinFAT16FS;

    // Current Streaming File 27 bytes
    struct sThinFAT16File {
    unsigned char Filename[8]; // Name of file
    unsigned char Extension[3]; // File Extension
    unsigned char Attributes; // File Attributes
    unsigned char mode; // status of Filesystem
    unsigned int CurrentByte; // current byte
    unsigned int FirstSector; // First Sector
    unsigned long CurrentSector; // current Sector
    unsigned long LastSector; // last Sector
    ThinFATFileEnd EndOfFile; // Callback when file ends
    } ThinFAT16File;

    // Current Directory 6 bytes
    struct sThinFAT16Folder {
    unsigned int StartCluster; // Starting cluster of directory
    unsigned long FolderSize; // Last byte in directory
    } ThinFAT16Folder;

    // Temp files of ThinFAT16 7 bytes
    struct sThinFAT16Temp {
    unsigned char A;
    unsigned int B;
    unsigned long C;
    } ThinFAT16Temp;

    Hell yeah! Nice work.

    • uC says:

      The memory footprint for the FAT file system is itself is 54 bytes. Which is pretty impressive, even if it is just a read only file system.

  6. nxpguy says:

    MSP430 have their own sound, quite different from tubes

  7. Matthew Rogan says:

    I’m going to give a shot at getting writing support working I’ve also got a Instructable up so people can get this implemented on their own MSP430 chips easily since this morning:
    http://www.instructables.com/id/Running-FAT16-on-the-Ti-Launchpad/

    it should be able to get 32kHz sampling in mono if I ran it at 16MHz instead of 8MHz, but that would use a 3.3v minimum instead of 2.2v.

    the problem with writing is that it requires a lot of different code, so to fit on a 4K flash it might be necessary to choose beetween reading or writing.

    thanks again for putting my project on your site, I’ve been reading it every day for 2 years. next time I should have better pictures if I can borrow my little sisters DSLR.

  8. why always a video says:

    All i heard was how much he likes the sound of his own voice. Just think of the excess over 54 bytes wasted in a video instead of text.

  9. Isaac says:

    That’s really cool. I have that msp chip at home on a breakout, will definitely have to try this out.

  10. tipok says:

    WTF? Why just don’t use new TI AudioBooster Extension Pack? Just from TI eStore: https://estore.ti.com/430BOOST-C55AUDIO1-000-Audio-Capacitive-Touch-BoosterPack–P2941.aspx

    • Matthew Rogan says:

      beacuse some people with microcontrollers want to know the hardware and develop something they can deploy to a end product instead of sitting in a dev board and booster blahs.

      I developed this for a reason, I have a younger brother that loves music. he’s got a learning disability and he has trouble with music players so people need to set them up for him but he cant even choose his music on them. then one day macdonalds do a bunch of one button music players that do 10 seconds of music and he was able to use them.

      thing is he used them near every minute of every day and they all ran outta juice. so I started working on this with this specific micro to meet several important design considerations for him:
      low power for constant use – MSP430
      sealed, no batterys – use solar panel
      waterproof – use capcitive touch, no buttons
      play music – use an SD card

      I’m still waiting for the panel and the orthodynamic driver for outputting sound. I’ve also been looking around for a nice see through box that fits nice in a hand 24 hours a day. enginnering is all about meeting design considerations. that is why.

  11. Raguel Suhoski says:

    Not sure if this is your issue, but make sure Step 2 is performed with the Power’ button (top of device), not the Home’ button. I made this mistake first time and couldn’t figure out why Voice Control kept launching…

Speak Your Mind

*

Related Hacks in Microcontrollers

  • Morse Code interpreter
  • One wire reads the keypad from the APRS radio mic
  • Level conversion with plenty of options
  • Music visualization generator with a Propeller
  • Hackaday Links May 9th 2012