bluehash 1,581 Posted December 21, 2013 Share Posted December 21, 2013 Tutorial is up. Enjoy! http://43oh.com/2013/12/interfacing-the-launchpad-to-an-sd-card-a-walkthrough/'>Interfacing An SD-Card To The Launchpad calinp 1 Quote Link to post Share on other sites
Rei Vilo 695 Posted February 13, 2014 Share Posted February 13, 2014 If the SD-card reader features card detection, here's the code for a basic implementation: #define CARD_DETECT PA_2 void setup() { pinMode(RED_LED, OUTPUT); pinMode(GREEN_LED, OUTPUT); pinMode(CARD_DETECT, INPUT_PULLUP); } void loop() { if (digitalRead(CARD_DETECT)) { digitalWrite(RED_LED, HIGH); digitalWrite(GREEN_LED, LOW); } else { digitalWrite(RED_LED, LOW); digitalWrite(GREEN_LED, HIGH); } delay(500); } The green LED lights on when a card is inserted, otherwise the red LED is on. Quote Link to post Share on other sites
Thorvard 14 Posted February 22, 2014 Share Posted February 22, 2014 Hi, i just wanted to report that the library won't compile with Energia release 0101E0011 and the F5529 Launchpad because "DIR" is already defined in \energia-0101E0011\hardware\tools\msp430\msp430\include\msp430f5529.h line 3900: /* USBCTL Control Bits */ #define DIR (0x0001) /* USB - Data Response Bit */ renaming all "DIR" references in the Petit-FATFS library and examples to "_DIR" works as a workaround. regards, Nick OzGrant and Rei Vilo 2 Quote Link to post Share on other sites
PTB 27 Posted March 21, 2014 Share Posted March 21, 2014 @@calinp Was just wondering if there is a list of return codes and their meaning for this library. eg. Fail with rc=6 I've looked and it just seems to elude me completely. Cheers PTB Quote Link to post Share on other sites
bluehash 1,581 Posted March 21, 2014 Share Posted March 21, 2014 @@calinp Was just wondering if there is a list of return codes and their meaning for this library. eg. Fail with rc=6 I've looked and it just seems to elude me completely. Cheers PTB @@PTB In src/ff.h typedef enum { FR_OK = 0, /* (0) Succeeded */ FR_DISK_ERR, /* (1) A hard error occurred in the low level disk I/O layer */ FR_INT_ERR, /* (2) Assertion failed */ FR_NOT_READY, /* (3) The physical drive cannot work */ FR_NO_FILE, /* (4) Could not find the file */ FR_NO_PATH, /* (5) Could not find the path */ FR_INVALID_NAME, /* (6) The path name format is invalid */ FR_DENIED, /* (7) Access denied due to prohibited access or directory full */ FR_EXIST, /* (8) Access denied due to prohibited access */ FR_INVALID_OBJECT, /* (9) The file/directory object is invalid */ FR_WRITE_PROTECTED, /* (10) The physical drive is write protected */ FR_INVALID_DRIVE, /* (11) The logical drive number is invalid */ FR_NOT_ENABLED, /* (12) The volume has no work area */ FR_NO_FILESYSTEM, /* (13) There is no valid FAT volume */ FR_MKFS_ABORTED, /* (14) The f_mkfs() aborted due to any parameter error */ FR_TIMEOUT, /* (15) Could not get a grant to access the volume within defined period */ FR_LOCKED, /* (16) The operation is rejected according to the file sharing policy */ FR_NOT_ENOUGH_CORE, /* (17) LFN working buffer could not be allocated */ FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > _FS_SHARE */ FR_INVALID_PARAMETER /* (19) Given parameter is invalid */ } FRESULT; PTB 1 Quote Link to post Share on other sites
PTB 27 Posted March 21, 2014 Share Posted March 21, 2014 @@bluehash Awesome. Thanks! I could not find that for the life of me. Cheers PTB Quote Link to post Share on other sites
Rei Vilo 695 Posted June 2, 2014 Share Posted June 2, 2014 Best solution is to use modern collaborative tools and share a repository. I've created the SD_TM4C repository for SD Library for LaunchPad LM4F / TM4C and pushed my code. Feel free to contribute and add support for other LaunchPad boards . calinp 1 Quote Link to post Share on other sites
aimepinto 0 Posted July 8, 2014 Share Posted July 8, 2014 For who keep having the rc=6 problem with a sdcard holder pcb (bought from ebay), try to change mosi and miso position. I guess that the indications on the SD card holder are indications for the launchpad connections, So you have to put input with input (miso with miso) and not input with output. Quote Link to post Share on other sites
roadrunner84 466 Posted July 9, 2014 Share Posted July 9, 2014 For who keep having the rc=6 problem with a sdcard holder pcb (bought from ebay), try to change mosi and miso position. I guess that the indications on the SD card holder are indications for the launchpad connections, So you have to put input with input (miso with miso) and not input with output. Contrary to UART, SPI does not have such an ambiguity. In UART there is a Tx and an Rx pin, which mean one pin is receiving and one pin is transmitting. To have two devices chatting to eachothter, one should have the transmitting pin from party A connected to the receiving pin of party B and vice versa. In SPI on the other hand, the pins are explicitly described by their role. The Master In, Slave Out (MISO) pin is the receiving pin on the master, but the transmitting pin on the slave. In the same fashion the Master Out, Slave In (MOSI) is the transmitting pin on the master but the receiving pin on the slave. The only thing to figure out now is which party is the slave and which the master. This is (in my view) obvious; the controller is the master, the card is the slave. aimepinto 1 Quote Link to post Share on other sites
aimepinto 0 Posted July 10, 2014 Share Posted July 10, 2014 Has anyone tried to implement a create file function in the Petit FatFs? I tried to use the FatFs in the g2553, but there is not enough memory. Quote Link to post Share on other sites
bluehash 1,581 Posted July 11, 2014 Share Posted July 11, 2014 Has anyone tried to implement a create file function in the Petit FatFs? I tried to use the FatFs in the g2553, but there is not enough memory. @@aimepinto You cannot create a file in Petite FatFs. You have to create it externally on a PC and write to the file on the chip. FatFs is too large for the 2553. You may try running it on the higher end Launchpads. Quote Link to post Share on other sites
OzGrant 22 Posted October 25, 2014 Share Posted October 25, 2014 G'day, Getting errors when I compile with E13 for a 5529 device, Did the _DIR change in the include files etc. Is there anything extra to change when using this setup. When device is 2553 all ok. Grant Quote Link to post Share on other sites
stasundr 0 Posted October 27, 2014 Share Posted October 27, 2014 Hello, everyone! So I've connected SD card to launchpad (g2553). When I'm trying to execute PFatFsFileTest I'll get something like: Press button to start... Failed with rc=6 The only file on sdcard is "SD card test.txt", but I can't open it (probably because of spaces in the filename? or mb I did something wrong. idk). And... I've soldered sdcard, so I can't write any new file in there T_T Is it possible to do smth to make things work or I need to unsolder it first? Thanks a lot in advance. Quote Link to post Share on other sites
Rei Vilo 695 Posted October 28, 2014 Share Posted October 28, 2014 Forget about SD with a MSP430G2553. This MCU hasn't enough RAM for buffering a sector. Try instead another MSP430 like the F5529 or even better the Tiva C TM4C123. Quote Link to post Share on other sites
stasundr 0 Posted October 29, 2014 Share Posted October 29, 2014 All I need is just log date and temperature, so I do hope that MSP430G2553 will be enough... 2553 actually is only thing I have. 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.