Jump to content

Simple FAT32-SD-Project

Recommended Posts


I would like to start using SD-cards in my MSP430-projects. I have read there is Petit FatFs ported to the MSP430g2553. I already checked the files and found the code quite messy and difficult to guess how to use it. There is an example in the forum including temperature logging but also sending the temperature to the computer. Does anyone has a SIMPLE program/project what is just opening a file, reading a something from the file and saving something (maybe the temperature)?


PS: I am using CCS and a MSP430G2553

Link to post
Share on other sites

MSP430G2553 doesn't feature enough RAM to buffer one sector (512 bytes). Please take a MCU with more RAM.


Petit FatFs does not need 512 bytes of RAM.




@@Lacto, You are right, petietFS does not NEED a sector buffer. (requiring 512 bytes of RAM.)


However be aware that there are many limitations due to this restriction http://elm-chan.org/fsw/ff/pf/write.html


  • Cannot create file. Only existing file can be written.
  • Cannot expand file size.
  • Cannot update time stamp of the file.
  • Write operation can start/stop on the sector boundary.
  • Read-only attribute of the file cannot block write operation.

These are some serious limitations. Especially for a datalogger. So while it IS possible, it's not without it's limitations.


A major disadvantage is this point "Write operation can start/stop on the sector boundary."

This means you need to write in blocks of 512 bytes, otherwise the blocks are zero padded to reach the boundary.



Typically petietFS is used for applications only requiring read operations, due to these limitations.

Link to post
Share on other sites

@@Lacto Yes, Once one block has been written it will start writing to the next one.


That's good to hear that you're application will work with these limitations, However most projects I've seen with FatFS, including my own experience, Just spend a few extra dollars on a larger MCU. So it may be hard to find many examples.


The Petiet FatFs library is actually a very well structured and documented library.



(There is some example application code at the bottom of this page)

I would recommend reading the example code for the generic example. It shows how easy the API is to use, and shows examples of Reading and Writing.

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.

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...