SD card interfacing with pic18f458

Thread Starter

Bushratariq

Joined May 15, 2014
13
hey i am Bushra . I am a student. I have a project to read/write data to sd card using pic. i am using pic18f458 for this purpose. I am very new to all this stuff and needed some help. I am uisng picc sofware. In it i have seen libraries like mmcsd, mmcsd-spi, fat16 etc. now i am confused which one to use to write to the card. The data i will be writing to the card will be either text file or image. and i want to access that data when i connect the card to computer.
I dont know which library to use. What each library can do. I am using 8gb micro sd card. should i use fat32??

CAn you please help me with this? anyone has some running small simple code functional with sd card. Just to see if my circuit and everyting else is fine
 

sirch2

Joined Jan 21, 2013
1,037
I too would love to see a straight forward example of how to read/write FAT type files from a PIC using MPLAB X with the code in C. I know there is example code provided by Microchip but compared to what is available for Adruino (i.e. connect pin N to SD card pin X, run this code, voilà) it is a steep learning curve.
 

Thread Starter

Bushratariq

Joined May 15, 2014
13
This book is not in my library. i tried to download it but its not fully available for download. Only the third chapter is available. And that chapter was not very helping. Am still confused. So i posted on this forum that may be someone has worked on this and could guide me accordingly.
 

sirch2

Joined Jan 21, 2013
1,037
Looks like the path has changed, mine is in [MLA InstallDir]\apps\fileio\sd_card_demo\firmware

But thanks for the link
 

ErnieM

Joined Apr 24, 2011
8,377
Sure thing. Yes it looks like I was looking at the older MLA, I wish they would stop moving things on me like that. :D

I've used their (older) libraries many times to good use. Basically all you need do is define the SPI pins along with the CS and WP lines, and off you go.

I believe the "fileio_config.h" or some such lets you add or delete functions of the library, akllowing you to customize it for just your needs. That can save some code space. AFAIK you need around 5K of ROM for a PIC18 series device.
 

Thread Starter

Bushratariq

Joined May 15, 2014
13
THank you for you reply. But i am very new to all this stuff. What do you mean by this line?

"AFAIK you need around 5K of ROM for a PIC18 series device."

Also can the data written to sd card later be accessed by pc. . text file or what ever it is? Do i have to use fat32 for this?

Can anyone please explain me the difference of the following libraries in picc software.
mmcsd, mmcsd-spi, FAT

I am using this software. What should i do? How should i do?

I am very confused. Anyone please guide me.
 
Last edited:
Top