View previous topic :: View next topic |
Author |
Message |
johnny85
Joined: 26 Aug 2010 Posts: 3
|
Datalogger with 18f4553 and sd/mmc card SPI |
Posted: Thu Aug 26, 2010 3:27 am |
|
|
I want help for my thesis. I want to make a datalogger and I want to save all the data in mmc card in text format. All the project has been made, the only problem is the storage! Can someone help me!
Thank you in advance! |
|
|
andrewg
Joined: 17 Aug 2005 Posts: 316 Location: Perth, Western Australia
|
|
Posted: Thu Aug 26, 2010 4:29 am |
|
|
Have a look at "ex_fat.c" in the CCS Examples folder. _________________ Andrew |
|
|
johnny85
Joined: 26 Aug 2010 Posts: 3
|
|
Posted: Thu Aug 26, 2010 11:56 pm |
|
|
this example has a lot of things inside, i am a little bit confused!
do you have a simple example?
the only thing that i want is something like this:
1.take data from sensors(done)
2.write to sd(not done) |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Aug 27, 2010 12:17 am |
|
|
ex_fat.c has more than you need, but when you browse through it there is a lot you can learn from it. Just throw away all the things you don't need.
Basically all you need is shown in the function AppendFile(). This opens a file, writes data to it and then closes the file.
Potential problems are in the details. You can only write data to the card when it is formatted as FAT (either FAT16 or FAT32). Formatting can be done by the ex_fat example code or on your PC. I recommend using the format command from the example code because the CCS FAT driver is known to have problems reading Master Boot Records (MBR) when formatted on some PC's. |
|
|
johnny85
Joined: 26 Aug 2010 Posts: 3
|
|
Posted: Fri Aug 27, 2010 12:18 am |
|
|
Thank you a lot!
I will try it! |
|
|
andrewg
Joined: 17 Aug 2005 Posts: 316 Location: Perth, Western Australia
|
|
Posted: Fri Aug 27, 2010 7:07 am |
|
|
ckielstra wrote: | the CCS FAT driver is known to have problems reading Master Boot Records (MBR) when formatted on some PC's. |
...and I've posted a thread with the simple fix for that. _________________ Andrew |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1908
|
|
Posted: Fri Aug 27, 2010 7:12 am |
|
|
Throw it in the Code Library too. Easier to find stuff like this there, and it definitely deserves to be there. |
|
|
andrewg
Joined: 17 Aug 2005 Posts: 316 Location: Perth, Western Australia
|
|
Posted: Fri Aug 27, 2010 7:16 am |
|
|
newguy wrote: | Throw it in the Code Library too. Easier to find stuff like this there, and it definitely deserves to be there. |
Done. I probably should have just posted it there in the first place. _________________ Andrew |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Sat Aug 28, 2010 5:41 am |
|
|
johnny85 wrote: | this example has a lot of things inside, i am a little bit confused!
do you have a simple example?
the only thing that i want is something like this:
1.take data from sensors(done)
2.write to sd(not done) |
You may be interested in my FAT file system implementation. It has been used by several students for their thesis (with permission from their supervisors). The driver includes a full featured data logger. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
|