SiskinEDGE 12 Posted April 2, 2012 Share Posted April 2, 2012 Here is a video of the music player in action:The code has the following functionality:Initilise the FAT16 filesystem from an SD card in a single command - ThinFAT_Init();Open Files on an SD card and allow you to test each filename with a callbackIndex Files by useing the same command as to open them with a callbackreturns data on if the filestream is activereturns data on how far the file has been read throughcallback for when end of the file is reachedOpen Folders on an SD card - Untestedand limitations:uses 54 bytes of ram approxdosen't support fragmented filesreads file end to closest sector, not byte (for performance reasons)reads FAT16 filesystems, not FAT32has no support for long filenames (it would be silly on these chips)I dont know if this fits within a 2K flashwhen implementing this on your own chip keep in mind you change which wire is the Chip select in the MMC.h fileit is based on the DIY Life Talking MSP430 Project.It has been designed for the MSP430G2352 but if you remove the CCR2 References it should work for other projects easily.Wireing:P1.2 - TA0.1P1.3 - Input for Playing and Changing Music FileP1.4 - TA0.2P1.5 - SMCLK out - SD Card Pin 5P1.6 - SDO - SD Card Pin 2 MOSIP1.7 - SDA - SD Card Pin 7 MISOP2.7 - CS - SD Card Pin 1 Card SelectVCC - SD Card Pin 3,6Ground - SD Card Pin 4the pins on the SD card are counted from the first contact after the recessed contact across, the recessed one is 9. you can check on wikipedia when your unsure. SD Media Player.zip pine, username, Vyan and 9 others 12 Quote Link to post Share on other sites
bluehash 1,581 Posted April 2, 2012 Share Posted April 2, 2012 Thanks Siskin and welcome to the Forums. Quote Link to post Share on other sites
thereza 1 Posted April 2, 2012 Share Posted April 2, 2012 I was trying to check our your code, but the zip file appears corrupt. I couldn't open it with winrar or windows explorer. Any chance you could re-compress and re-upload? thnx, reza SiskinEDGE 1 Quote Link to post Share on other sites
bluehash 1,581 Posted April 2, 2012 Share Posted April 2, 2012 I was able to open the zip file. Integrity looks ok. Quote Link to post Share on other sites
SiskinEDGE 12 Posted April 3, 2012 Author Share Posted April 3, 2012 if your having trouble extacting try 7-zip, it's always been very reliable for me. Quote Link to post Share on other sites
Rickta59 589 Posted April 3, 2012 Share Posted April 3, 2012 I was trying to check our your code, but the zip file appears corrupt. I couldn't open it with winrar or windows explorer. I also had problems extracting the files using Windows 7 explorer. However, the unzip util in the Cygwin package seemed to work fine. -rick SiskinEDGE 1 Quote Link to post Share on other sites
username 198 Posted April 3, 2012 Share Posted April 3, 2012 Very cool project! Must have been tricky getting nice clean audio using a breadboard, always had noise issues when doing that. I've always wanted to do this at some point in time. Thanks for sharing! Quote Link to post Share on other sites
oPossum 1,083 Posted April 3, 2012 Share Posted April 3, 2012 Windows 7 and WinRAR both can not decompress that zip file. SiskinEDGE 1 Quote Link to post Share on other sites
SiskinEDGE 12 Posted April 3, 2012 Author Share Posted April 3, 2012 I'll recompress without compression and reupload, it's less than a meg - hopefully it should be fine for you after that. Quote Link to post Share on other sites
bluehash 1,581 Posted April 4, 2012 Share Posted April 4, 2012 Rezipped. X-SD Media Player.zip SiskinEDGE 1 Quote Link to post Share on other sites
SiskinEDGE 12 Posted April 4, 2012 Author Share Posted April 4, 2012 I'm looking into write support at the moment, dose anyone know any examples of writing to a SD card on the MSP430? also with the SD card sheild it will be necessary in order to do proper write support to have some way to buffer 512 bytes at a time otherwise anything that was on the block previously would be erased. currently there are only two options about write support that dont need a 512 byte buffer: A) overwrite a empty pre-made container file's space save to a subdirectory, erase all other entrys in there and write one new file in there and write to a sector of empty space in the FAT (if avilable) I've still to work out how to write to the SD card a byte at a time through SPI as the MSP cant buffer a whole sector. I'm gonna look into some kind of ram chip or something that could do this mabey try and draw up something that could be useful to the SD booster pack developer people. might be worth a shot to try and do this in assembly or RTSC or something to save on flash space so all the value line chips can do the FAT16 thing as it's only just above the 2K flash limit on most of the value line chips at the moment. Quote Link to post Share on other sites
bluehash 1,581 Posted April 4, 2012 Share Posted April 4, 2012 There is this. I've sent Rickta a BoosterPack to get write working. All else is good. It works using the PetiteFS file library. The only caveat of the library is that you need to create a file before inserting the card in. Quote Link to post Share on other sites
username 198 Posted April 4, 2012 Share Posted April 4, 2012 I'd most certainly as well be interested in byte to byte write support. Let us know what you find out! Regarding memory space, the new launchpads ship with the G2553 which has 16KB of flash memory space. Considering this is becoming a very common value line chip I wouldn't worry too much about the 2kb msp430s. Overall, i'd just be nice to get something to work =) I'm looking into write support at the moment, dose anyone know any examples of writing to a SD card on the MSP430?also with the SD card sheild it will be necessary in order to do proper write support to have some way to buffer 512 bytes at a time otherwise anything that was on the block previously would be erased. currently there are only two options about write support that dont need a 512 byte buffer: A) overwrite a empty pre-made container file's space save to a subdirectory, erase all other entrys in there and write one new file in there and write to a sector of empty space in the FAT (if avilable) I've still to work out how to write to the SD card a byte at a time through SPI as the MSP cant buffer a whole sector. I'm gonna look into some kind of ram chip or something that could do this mabey try and draw up something that could be useful to the SD booster pack developer people. might be worth a shot to try and do this in assembly or RTSC or something to save on flash space so all the value line chips can do the FAT16 thing as it's only just above the 2K flash limit on most of the value line chips at the moment. SiskinEDGE 1 Quote Link to post Share on other sites
Arch_ETS 0 Posted April 7, 2012 Share Posted April 7, 2012 I don't know why, but my microSD died, I used microSD to SD adapter, double checked everything, but no success. Then I removed it, and non of readers detect it anymore. Quote Link to post Share on other sites
SiskinEDGE 12 Posted April 7, 2012 Author Share Posted April 7, 2012 you should check where you plugged in each of the wires on the SD card and also the voltge you was feeding your launchpad, not every SD card can handle the max 3.6 volts that the MSP430 can. I've never run it above 3V myself. with a micro-SD I think they use a lot less voltage and can go as low as 1.8V. it's porbably likely you've killed your card, before you get another just check how You've got it all wired up and make sure you got a capcitor on your SD card beetween Vcc and ground. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.