CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Datalogger with 18f4553 and sd/mmc card SPI

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
johnny85



Joined: 26 Aug 2010
Posts: 3

View user's profile Send private message

Datalogger with 18f4553 and sd/mmc card SPI
PostPosted: Thu Aug 26, 2010 3:27 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Thu Aug 26, 2010 4:29 am     Reply with quote

Have a look at "ex_fat.c" in the CCS Examples folder.
_________________
Andrew
johnny85



Joined: 26 Aug 2010
Posts: 3

View user's profile Send private message

PostPosted: Thu Aug 26, 2010 11:56 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Aug 27, 2010 12:17 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Aug 27, 2010 12:18 am     Reply with quote

Thank you a lot!
I will try it!
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

PostPosted: Fri Aug 27, 2010 7:07 am     Reply with quote

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: 1901

View user's profile Send private message

PostPosted: Fri Aug 27, 2010 7:12 am     Reply with quote

andrewg wrote:
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.


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

View user's profile Send private message Visit poster's website

PostPosted: Fri Aug 27, 2010 7:16 am     Reply with quote

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: 1630
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sat Aug 28, 2010 5:41 am     Reply with quote

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!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group