Jump to content
venkatesh223

MSP432P401R SD card interface

Recommended Posts

hello there,

Ive been trying trying to interface an sd card to msp432p401r but i get many errors. my task is top build a data logger where the sensor readings will be stored in a text file. So i tried basics first.

First i tired to serial print the sd card info but had lot of errors (screenshot can be seen below).

the files i used is attached in the rar file "SD", in that i tried the Card info example. Please can someone help me what is wrong with this code.

Thanks

Screenshot (30).png

Screenshot (31).png

SD.rar

Share this post


Link to post
Share on other sites

Thanks for the above link, had no issues compiling.

I connected the SD cad as shown in the screenshot below and yes i did change the CS pin to 13 as per msp432 but still in the serial monitor it says not initialized. And yes i did check the sd card in pc it did work and formatted it with fat32.

Can you tell me what can be done? to make it work?

Screenshot (32).png

Screenshot (33).png

Share this post


Link to post
Share on other sites

Maybe I am thinking of the PetiteFS way of using an SD card but doesn't that SD card need to be first formatted on a PC and have a file created as well?

Then, the MSP430 would access the SD card, open up the pre-existing file, and then write to it?

I would verify the SD card on a PC first by formatting it then creating an empty text file on it. Then, get the MSP430 to see it then open it.

Double check the wiring of the card.

And make sure that you have a really good +5V power source for that SD card. I have read that they want a bunch of current to operate properly. And, I suspect the dev board cannot supply that much current on the +5V line. Gotta verify that too.

 

Share this post


Link to post
Share on other sites

@zeke : SD cards are rated for 3.3V (1.8V for some - with 3.3V init), 5V will kill them?

Lately I have accessed cards via FatFS on MSP432E401Y and TM4C1294 LaunchPads with power supplied from the BoosterPack header without problems.
Up to 500mA can be supplied via the LDO on the MSP432P401R LaunchPad, and I believe enough is left for a SD card (draw is typ. 20-100mA according to wikipedia).

The code I used was from the TI SDKs.

Share this post


Link to post
Share on other sites

Thank you for your reply.

@terjeio Can you please provide me the link of SD card example on the TI SDK. And it would be helpful if you can tell me the pin configuration with the msp432p401r . Will give it a try using CCS and see is it the same or not.

Share this post


Link to post
Share on other sites

I tried the same code and the same SD card with Arduino uno, the card was detected. So what might be the possible reasons for not getting detected with MSP432P401R ??, even though the connections are right.

Share this post


Link to post
Share on other sites

@venkatesh223

The TI SDKs are downloads, I do not know if the individual examples are available for browsing online. However, there is no SDK driver/example for the MSP432P401R that I am aware of.

IMO the connection diagram you posted above should be correct.

A couple of issues I had:

microSD does not have the same pinout as a regular (large) card.

I could not access a 64GB card as the FatFS driver I used did not support exFAT.

So perhaps these questions are relevant for your problem:

What size and type is the SD card(s)?

Did you try more than one card, preferably of different makes and sizes?

Is the SPI bus shared with other devices?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×