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 CCS Technical Support

Ask for help Writing data to the sd card.

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



Joined: 23 Nov 2013
Posts: 1

View user's profile Send private message

Ask for help Writing data to the sd card.
PostPosted: Sat Nov 23, 2013 3:29 pm     Reply with quote

I am doing a project on the datalogger. It will need to collect data from sensor and save it on sd card using microcontroller pic 18F8722, which I've never done this before. Wanted to get advice or help from you guys

Thank you Very Happy
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat Nov 23, 2013 5:36 pm     Reply with quote

OK, I suggest using the forum search feature.
search for datalogger. Lots of ideas there.

There have also been numerous posts on SD cards lately...
_________________
Google and Forum Search are some of your best tools!!!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Sun Nov 24, 2013 1:53 am     Reply with quote

Key thing is you are making it harder for yourself, by using a 5v PIC.

Successful SD card implementations, involve one of:

1) Using a 3.3v PIC. Direct connection to the card, with the required pull up resistors. Much the easiest hardware to get going.
2) Using a 5v PIC, with proper level translator chips.
3) It is 'just' possible to get a 5v PIC to talk to a SD card, at low speeds, using resistive dividers, software SPI, and PIC input pins supporting TTL buffer levels. This is the least reliable, and won't work with hardware SPI.

Unfortunately, '3', is the commonest circuit published on the web, often with questions about "why they can't get code to work"....

If you are happy to work with 2GB or less cards, then the CCS drivers (with the two patches from the code forum), and the '1', or '2' for the hardware, will work. If you want real flexibility (any size card supported), then buy the Brush Electronics drivers. I had SD working with the modified CCS drivers, and wanted to go to larger cards, looked at writing these myself, and then looked at the Brush drivers, and decided that the latter were going to be much cheaper/less work. They were...

The Brush site also has 'example' circuits showing the buffering necessary for the 5v to 3.3v interface (2).

The author posts here.

Best Wishes
temtronic



Joined: 01 Jul 2010
Posts: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Nov 24, 2013 6:25 am     Reply with quote

also...

4) once you've lost a lot of time and hair trying to get '3)' running.....

you might consider using a Vinculum based USB flash drive interface module.

If this project is a 'one off, home use' the Vdrive is a quick and painless solution.100% 5 volt compatible,100% compatible with ANY PC with USB,100% compatible with ANY flash drive,100% compatible with ANY PIC, simple serial interface and coding.
You can be 'storing data' in 2-3 hours.If you store the data in CSV format,Excel will 'autoload' your data into a spreadsheet.
Yes, the cost is higher,modules are about $30 vs. a proper SD card module($20) but what is your TIME worth ?

just another option

jay
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