bluehash 1,581 Posted November 16, 2011 Share Posted November 16, 2011 Edit: July 6th, 2014 Please also note that Pabigot maintains BSP430 which has an example for the msp430. He also tracks any changes done to the ElmChan library with patches made to the example. Refer this post. --------------------------------------- First version. It's very untidy as I just got it to work. Works on USCI on the MSP430G2553. Supports Read/Listing. The monitor code does not have write yet. It works on the SDCard Boosterpack. I also used Rickta's serial code to reduce file size. I'll update to the next version once I have time and a clean it up to. Also need to add more features.Usage in screenshot.di : disk initializefi : mount diskfl : list filesfo filename: open file name.Latest Code:http://www.43oh.com/forum/viewtopic.php?f=10&t=1883&start=20#p18738'>Code Rev 0.2Member Contributed Code:Jazz_ys - http://forum.43oh.com/topic/1427-petitefs-fatfs-sdcard-usci-code/page__st__20#entry24449'>Link SDCARD_PetiteFS_2553_v0.01.zip SDCARD_PetiteFS_2553_v0.02.zip robmal1, larsie, xpg and 12 others 15 Quote Link to post Share on other sites
bluehash 1,581 Posted November 16, 2011 Author Share Posted November 16, 2011 Forgot to add: P2.0 -> CS P1.5-> CLK P1.6-> MISO P1.7-> MOSI Also, is there any interest for a Booster Pack? I can whip one up. Setup: Quote Link to post Share on other sites
Rickta59 589 Posted November 17, 2011 Share Posted November 17, 2011 Thanks bluehash! I couldn't get it to work with my SanDisk 1GB microSD card. However, with a few small tweaks to spi.c, I got it humming: /* Initialize and enable the SPI module */ void spi_initialize( void ) { P2DIR |= BIT0; // CS Line UCB0CTL1 |= UCSWRST; //UCB0CTL0 |= UCMSB | UCMST | UCMODE_0 | UCSYNC; UCB0CTL0 = UCCKPL + UCMSB + UCMST + UCMODE_0 + UCSYNC; UCB0CTL1 = UCSSEL_2 | UCSWRST; UCB0BR0 = 0x02; // 8MHz UCB0BR1 = 0x00; P1SEL |= BIT5 | BIT6 | BIT7; // P1.5, P1.6, P1.7 option select P1SEL2 |= BIT5 | BIT6 | BIT7; UCB0CTL1 &= ~UCSWRST; P2OUT |= BIT0; // CS high } -rick Quote Link to post Share on other sites
bluehash 1,581 Posted November 17, 2011 Author Share Posted November 17, 2011 Awesome.. is this for the 2553 series? I tested a 32mb and 4gb disk. I'll incorporate your changes and make a release. Quote Link to post Share on other sites
Rickta59 589 Posted November 17, 2011 Share Posted November 17, 2011 Awesome.. is this for the 2553 series? I was actually using an msp430g2533. I think is the same as a 2553 without a comparator. -rick Quote Link to post Share on other sites
single 1 Posted November 21, 2011 Share Posted November 21, 2011 How much code memory does it need? Will it fits in msp430g2452? Quote Link to post Share on other sites
bluehash 1,581 Posted November 21, 2011 Author Share Posted November 21, 2011 Not much I'm afraid. Use the 2553 if you can or sample it from TI. If you want it to work on the 2452 you will have to change the base driver to support USI. 2452 does not have USCI. Quote Link to post Share on other sites
lastaid 15 Posted November 25, 2011 Share Posted November 25, 2011 I have not used this code as of now, but could you tell me how much flash and ram it uses? might be interesting for projects involving audio or whatever anyone can come up with. Quote Link to post Share on other sites
bluehash 1,581 Posted November 25, 2011 Author Share Posted November 25, 2011 I have not used this code as of now, but could you tell me how much flash and ram it uses?might be interesting for projects involving audio or whatever anyone can come up with. On the MSP430G2553, no write support yet MSP430: Program loaded. Code Size - Text: 3410 bytes Data: 220 bytes Quote Link to post Share on other sites
gssmahadevan 2 Posted December 6, 2011 Share Posted December 6, 2011 Thanks bluehash! I will use your code for 2553 chip with lanunchpad. Quote Link to post Share on other sites
kenemon 29 Posted December 9, 2011 Share Posted December 9, 2011 Awesome way to beef up the MSP. I have a couple of questions: what kinds of commands can be used to utilize this as a data logger? can you shoot sensor values through the ADC to an open file on the SD? I assume you can access the SD through interrupts? please pardon my ignorance of this...... Thanks Quote Link to post Share on other sites
bluehash 1,581 Posted December 9, 2011 Author Share Posted December 9, 2011 what kinds of commands can be used to utilize this as a data logger? - Open/Read/Write File - Delete file - Seek file can you shoot sensor values through the ADC to an open file on the SD? Yes I assume you can access the SD through interrupts? Should be. please pardon my ignorance of this...... Pardoned. Now go party. kenemon 1 Quote Link to post Share on other sites
gssmahadevan 2 Posted December 10, 2011 Share Posted December 10, 2011 Bluehash, I am able to run your code on MSP430G2253 with 512MB FAT16 Transcend Micro-SDCard on Launchpad. I had following niggling issues : * Disconnect J5 jumpers (I have to carefully watch your picture) * Configure Termite to send CR-LF after every entry * Add a change in main.c:get_line to make the for-loop to exit when it recieves '\n' also. Here is my change (in bold-underlined line): static void get_line(char *buff, BYTE len){ ... if (c == '\r' || c == '\n') break; ... } So next trial would be for writing Regards mahadevan Quote Link to post Share on other sites
gssmahadevan 2 Posted December 12, 2011 Share Posted December 12, 2011 Bluehash, Your FAT-FS code uses SW-Serial-Port for Rs232 communication. As MSP430G2553 contains serial port, why you have not used HW-Serial-Port-Communication(apart from the reason that being portable for other MSP430 MCUs where no HW serial ports are available)? Thanks & regards mahadevan Quote Link to post Share on other sites
bluehash 1,581 Posted December 12, 2011 Author Share Posted December 12, 2011 As MSP430G2553 contains serial port, why you have not used HW-Serial-Port-Communication(apart from the reason that being portable for other MSP430 MCUs where no HW serial ports are available)? 1. For the above reason mainly. 2. Software UART code was already made by Rickta. I did not want to spend time on setting up the serial port and buffers. 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.