This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR5739: Interfacing MSP430FR5739 with microSD card for data logging in 2023

Part Number: MSP430FR5739
Other Parts Discussed in Thread: MSP-EXP430FR5739

Developing prototype to log sensor readings to text file on microSD card via SPI. Documentation to achieve this is little to non-existent in 2023. Would anyone have experience or knowledge on how to go about this today? I am also unsure as to what sizes of SD card and whether they are “SD” or “SDHC” are important to keep in mind.

My application requires a “line of text” to be stored on the card once per second for up to 8 hours per day and up to 30 days before having to remove the card for data retrieval and/or power source replacement. I believe that this is possible within the span of a 1 or 2GB microSD card (perhaps even smaller, but I need to double check my math on the size of all 30 days worth of text, etc that is stored on the card before I order it). In 2023, it’s pretty hard to find cards of this size on Amazon or whatnot.

We are currently prototyping with an MSP-EXP430FR5739 board before developing final solution.

  • So far as you are concerned, there are two sizes of SD card. Those that use byte addresses or block (512 bytes) addresses. (High Capacity) It is easy to write code to be compatible with both.

    You do not want to write a line of text per second as that is power hungry. Better is to buffer the data until you have a full block (512 bytes) and then write the block.

    Writing code to interface with a micro-SD card via SPI isn't that hard to do. The SD (Simplified) specification has everything you need to know. A version for the MSP430 that I wrote can be found here: http://davesrocketworks.com/electronics/msp430/eforth/index.html

  • Thanks David for responding.  Allways appreciated.

    Hi Preetham - David really knows his stuff so follow his advice ;)

    There is a microSD library that comes with the MSP430FR5994 Launchpad "out of box experience".  Don't try to order this Launchpad because as of 2022, we discontinued populating the microSD.

    Since you are asking about the MSP4303FR5739, I copied the section of the users guide related to the microSD.  This shows you the required connections, but you will need to determine pins on your MCU.

    You download all the documentation for this device and the Launchpad, including the PCB files and schematics (if those are helpful to you) from the TI resource explorer.

    This is what you should see.  Click on the "out of box experience" to see the example and note the SDCardLib is there just below it.

  • Dennis,

    Thank you for your reply! I will def take a look at the out of box demo for the 5994 and see if I can't port it to work for the 5739. Since I did not specify it in my primary post, we are utilizing a MicroSD card breakout board from Adafruit [ADA 254] that offers SPI interface.

    I will spend the next few days attempting to fiddle around with the software side of things. Currently waiting on some further components to arrive including the actual microSD card we decide to use. Would you happen to have any advice as far as the TI SD driver library compatibility with todays microSD cards? For my use case, I believe a <= 2GB standard SD card would suffice, however like I mentioned earlier nowadays almost everything is SDHC and higher capacity (such as the 32GB one I have on hand right now).

    Once again, thank you for your response!

    Preetham

  • David,

    Thank you for your response! Dennis commended your skills so I'll def try to pay attention. That is good advice regarding the frequency at which I write to the card. I will wait until I have the full block of data to be written before writing it. I have taken a look at your msp430 project you linked to, however I must admit that I have difficulty following through with the assembly. Would you happen to have a rough idea of the power consumption of a typical microSD card being written to with a full block of data? Like I mentioned to David, we are utilizing a MicroSD card breakout board from Adafruit [ADA 254] with our MSP430.

    Once again, thank you for your response

    Preetham

  • I don't know about the minimum power consumption since my use tends to be toward the high speed of things. A couple of examples of that are on my web pages. First (in C) for the SparkFun Logomatic which also has a rump FAT16 system. Then (in eForth) the most recent for a Teensy 3.6 (ARM) that skipped a file system. The eForth isn't easy to follow even if you understand Forth. But as I said, everything you need to know is in the SD specification. (the SPI section of course)

    For really slow data rates you would want to power down the SD card between writes. But that would be a trade with the long time required to initialize the card each time.

  • Hi Preetham,

    It's been a while since we have heard from you, so I'm going to assume you were able to move forward with your project.
    I will mark this posting as RESOLVED, but if this isn’t the case, please click the "This did NOT resolve my issue" button and reply to this thread with more information.  If this thread is locked, please click the "Ask a related question" button, and in the new thread describe the current status of your issue and any additional details you may have to assist us in helping to solve your issues.

  • Hi! So I've been working on this project on and off for the last month or so, however, I'm still running into issues. When debugging my project, it always seems to freeze up. Any assistance with debugging would be greatly appreciated. The code freezes within the initFileSystem function, specifically when it hits the f_open routine.

    https://github.com/ECE4805-Fall22-Group9-NAVAIR/sdCardMSP430

  • Hi Preetham,

    Can you refresh or check the link you provided.  I get error 404

**Attention** This is a public forum