Lacto 2 Posted December 30, 2015 Share Posted December 30, 2015 Hello, 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 Quote Link to post Share on other sites
Rei Vilo 695 Posted December 30, 2015 Share Posted December 30, 2015 MSP430G2553 doesn't feature enough RAM to buffer one sector (512 bytes). Please take a MCU with more RAM. Quote Link to post Share on other sites
Lacto 2 Posted December 30, 2015 Author Share Posted December 30, 2015 Petit FatFs does not need 512 bytes of RAM. http://forum.43oh.com/topic/1427-petitefs-fatfs-sdcard-usci-code/ Quote Link to post Share on other sites
greeeg 460 Posted December 31, 2015 Share Posted December 31, 2015 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. http://forum.43oh.com/topic/1427-petitefs-fatfs-sdcard-usci-code/ @@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. agaelema 1 Quote Link to post Share on other sites
Lacto 2 Posted December 31, 2015 Author Share Posted December 31, 2015 I am aware of these limitations. They do not really harm my plans. As far a I understand it is no problem to write more than one block, correct? Quote Link to post Share on other sites
greeeg 460 Posted January 1, 2016 Share Posted January 1, 2016 @@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. http://elm-chan.org/fsw/ff/00index_p.html (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. 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.