PDA

View Full Version : Writing to an SD Card/PIC18F2480



divisionbyzorro
- 16th March 2007, 17:45
Hello all!

I'm an uber newbie here, so bear with me. For my senior design project at Texas A&M University, we're trying to build a circuit that will receive messages from a CAN network and write those messages to some sort of external device which can be interfaced with a PC. We're currently trying to write to an SD card, but we're having pretty much zero luck with it so far.

So I'm looking for any help I can with writing a program that will write files to an SD card in a FAT16 or FAT32 file system so that I can simply plug it into my SD card reader and get the information to my PC. I'd also like any information on how to build the circuit to do this; can I simply connect my PIC outputs to the SD card leads and use SPI to talk to the card? Or will I need some sort of external device to aid in this interface?

Thanks,
Sam

skimask
- 17th March 2007, 04:30
Hello all!

I'm an uber newbie here, so bear with me. For my senior design project at Texas A&M University, we're trying to build a circuit that will receive messages from a CAN network and write those messages to some sort of external device which can be interfaced with a PC. We're currently trying to write to an SD card, but we're having pretty much zero luck with it so far.

So I'm looking for any help I can with writing a program that will write files to an SD card in a FAT16 or FAT32 file system so that I can simply plug it into my SD card reader and get the information to my PC. I'd also like any information on how to build the circuit to do this; can I simply connect my PIC outputs to the SD card leads and use SPI to talk to the card? Or will I need some sort of external device to aid in this interface?

Thanks,
Sam

Oh boy....another 'SENIOR PROJECT'....

For starters...what other projects have you built...that have worked? Give me an idea of what you know or rather...what you don't know...'cause I can think of 3 different ways to handle this...1 not so easy, and the other 2 relatively hard...

Interfacing with CAN is NOT a newb project...nor is interfacing with an SD card. Flashing an LED is a newb project...

sougata
- 17th March 2007, 05:21
Hi,
Interfacing to the CAN is not a newbie project. So you must concentrate on the CAN part.
When done with the CAN controller part then I suppose you are through with the learning curve. To make your task easier you can use a 128 bytes array on your PIC and periodically dump it to an external eeprom rather than using a SD Card. This would be an advantage using the page write funtion of the EEPROM say a 24C512. Then you can have a routine that formats (puts strings, linefeed, Bin2ASCII etc) and dump on the PC via serial port. However I am not discouraging the use of an SD card. It is only limited by the project timeline you have. As MisterE says "Learning Oppertunities". Hey Steve thanks this has always inspired me.

rhino
- 17th March 2007, 16:36
THIS (http://www.compsys1.com/workbench/On_top_of_the_Bench/MMC_Project/mmc_project.html#SD9) site seems to have some good information to get you started. They also have FAT16 code you can purchase at a reasonable price.... Although, since this is for a school project I'd strongly discourage you from buying a solution. There's some good information at the bottom of the page.

BobK
- 17th March 2007, 18:23
Hello,

Here is another site that sells an SD recorder that takes input from RS232 devices. www.roguerobotics.com/products/electronics/ummc. Seems reasonably priced. But like the earlier replies, this will be a complicated project if you haven't done anything like this before.

HTH,

BobK

rhino
- 17th March 2007, 20:46
HERE'S (http://www.sparkfun.com/commerce/product_info.php?products_id=7956) a hardware solution I've been wanting to try.

Angus Anderson
- 19th March 2007, 15:02
Hi-
There is a 2 part article on the use of multimedia cards in the Nov and Dec issues of everyday Practical Electronics (www.epemag.com). You can buy the back issues as PDF files. They even have demo files.

Hope you come right with your project

regards

Angus Anderson