Jump to content
ryanf11

Trouble Porting Arduino SD Card Library to Energia

Recommended Posts

Hello everyone,

 

I'm basically trying to port over Arduino's SD card library (which utilizes SPI communication) to Energia, and am starting by testing whether I am able to properly initialize the SD card or not.  First,  I made sure that the Arduino library worked on an AT Mega 2560 and SD card that I have (it did).  I then moved on to porting the library for Energia.  I changed the pin mapping and the SPI settings to work for the F5529 and so far I can prove with a logic analyzer that the SD initialization function commands the CS, SCLK, MISO, and MOSI SPI lines in the exact same manner for the MSP430 as for the Atmel, byte for byte.  Basically, the information coming in to and out of each mircrocontroller is exactly the same so I know that all the SD card information is there for me

 

However, the problem is that the information does not seems to be received by the MSP430 in the same manner as the Atmel and causes the initialization to fail.  I think the roots of this issue involve differences between the way the Atmel device

DataloggerArduino.zip

DataloggerEnergia.zip

Share this post


Link to post
Share on other sites

Much to my excitement, I put the SD_TM4C library into the MSP430 libraries and it recognized my SD card connected to my F5529LP without needing any changes!  I'm frustrated that I spent so much time working on porting my own library, but it's good to know that I can move onward.  One thing I did notice, line 56 of CardInfo.ino has the parameters switched which causes a failure. It should read if (!card.init(chipSelect, SPI_HALF_SPEED)).  Thanks for the help.

Share this post


Link to post
Share on other sites

I ran into that very same error on that sketch last night, for the connected launchpad I had to swap if (!card.init(SPI_HALF_SPEED, chipSelect))   for   if (!card.init(chipSelect, SPI_HALF_SPEED, 2))  and christ this font switching gets annoying

Share this post


Link to post
Share on other sites

Hi @@ryanf11 ! I am trying to use SD_TM4C library with my MSP430F5529. Could you please tell me the SPI pins you used in your board ? Your help would be very appreciated. I am almost three months searching and trying to make the connection with the SD Card.

 

Thank you a lot !

Share this post


Link to post
Share on other sites

i am using energia with msp432p401r launchpad...i have interfaced a sensor which is bosch bme 280 via i2c with the lauchpad and have showed the output via sharp lcd boosterpack...now i have to store the data which is temperature, pressure and humidity in a sd card ...can anyone help pleases ?

Share this post


Link to post
Share on other sites

The SD_TM4C is a port of the SD Library for LaunchPad LM4F / TM4C.

 

?As the MSP432 and the CC3200 are Cortex-M4 based just like the LM4F / TM4C, there shouldn't be any particular difficulties to use the library.

 

Feel free to contribute to the GitHub repository!  :)

Share this post


Link to post
Share on other sites

I tried to configure above library, but not able to configured, There is no any error, But i am get confused with wire configuration, Can you please correct me.

Please provide me wire configuration for MSP432P401R

Currently using 

CS - 5.0
SLK -1.5
VCC - 5V
MDSI - 1.6
MISO - 1.7
 

But not able to access the SD card please help me

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...