OzGrant 22 Posted January 20, 2013 Share Posted January 20, 2013 G Quote Link to post Share on other sites
Rei Vilo 695 Posted January 20, 2013 Share Posted January 20, 2013 SD cards on SPI mode require a buffer with the size corresponding to a sector size = 512 bytes. As a matter of facts, the MSP430G2553 only features 512 bytes of SRAM. For more information, please refer to the thread PetiteFS FATfs SDCard USCI code bluehash 1 Quote Link to post Share on other sites
OzGrant 22 Posted January 20, 2013 Author Share Posted January 20, 2013 Rei, I am using Petit FatFS that was uploaded into the Energia Library on Jan 15 by Calinp. So on the surface it appears that we can SD read/write using a MSP430(2553). Has anyone used this library on a 2553. Grant Quote Link to post Share on other sites
calinp 24 Posted January 21, 2013 Share Posted January 21, 2013 Hi Grant, I can think of several issues that you might have: - Arduino I/O is at 5V so all shields that interface to SD cards use some sort of level conversion to 3.3V. It is possible that your shield has resistive dividers and in this case the voltage on Launchpad I/O will be about 2V - The SPI clock setiing in the library is 8MHz and this may be too high for some cards and shields. I will make some changes to the library so the user can set a lower clock. - I updated the file usci_spi.cpp in my SPI library with the one patched by Rei Vilo here (spi_send() function is fixed): https://github.com/energia/Energia/blob/issue_164_SPI_SRAM/hardware/msp430/libraries/SPI/utility/usci_spi.cpp I connected the card using wires of ~10cm (4 inches) and an adapter similar to the first one in this link: http://www.43oh.com/2011/02/five-cheap-breadboard-prototyping-tips-and-tricks-list-2/ and had no troubles running at 8MHz. I soldered also a 10uF cap on the supply pins of the card. Regards, Calin Quote Link to post Share on other sites
OzGrant 22 Posted January 21, 2013 Author Share Posted January 21, 2013 Calinp, My first fix was using another SD card, it now works OK when my booster card is plugged into a Stellaris, but still fails in a 430 (But the suspect SD works OK with the arduino) The two SD have the same properties when viewed under windows, so have put this down to bad-luck, e.g. a marginal SD card. Now do a check on the FatFs.begin and get a 6, that means "NOT_ENABLED (Check file system)" ------------------------------------------ myres=FatFs.begin(cs_pin); ..... case 6: Serial.print(" NOT_ENABLED (Check file system)"); ...... ----------------------------------------- Am not too worried at this time, as I ran out of program space and had to use a stellaris. But it would be nice to solve for other energia forum guys that only use the 430. Grant Quote Link to post Share on other sites
calinp 24 Posted January 21, 2013 Share Posted January 21, 2013 Hi Grant, Thanks for your feedback. As per Rei Vilo findings, a divider of 2 for SPI clock yields 8 MHz for MSP430 and 4MHz for Stellaris so probably the higher clock is causing issues. I will make the updates to the library so the clock can be adjusted. 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.