This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Need to Read/Write SD Cards & others

Hello everyone,

I would like to write an embedded code to implement the FAT system. My aim is to Read/Write SD Cards and other similar storage media. I have been working with PIC Microcontrollers for some time now, and intends to use this chip.

I have done a lot of reading and downloaded a lot of info on the FAT system, but I just can't seem to put it all together. Basically all the examples that I come across, are written in C Code. And I only use Paralax Mnemonic to write my codes.

If I could know what to send (data,command), when to send, what response to expect and how to interpret the response, I would be ok.

So I would be very very grateful if someone could give me step-by-step instruction on how to Implement the File Allocation Table system to read/write the mentioned devices. I am ok with the USB communication.

Thanks very much.

  • Note that this is a Keil forum, mostly concerned with the keil compilers for 8051 and ARM devices, not much about PIC's here.

    Seems to me you need to know what a FAT file system looks like, how to read and write to an SD card, and how to implement these two thing on your device.

    If you look at and truly understand the example code you have found, it should be (sort of) trivial to convert that knowledge to your language and architecture.

    Specific questions about Keil stuff, come on back, otherwise you may want to bring your question to a more appropriate forum.

    ND

  • "I am ok with the USB communication."

    You've confused me.

    What has USB communication gotto doing with accessing SD cards?

    Are you planning on using a USB SD card reader to access the memory card?

  • have a look at Keil's examples for a mass storage device. they all contain a byte array called "DiskImg" that adheres to FAT12 format. some of them also contain the SCSI command interpretation to manipulate the file system. above all: read about the structure of FAT12.