SD card interfacing with pic18f458

Discussion in 'The Projects Forum' started by Bushratariq, May 19, 2014.

  1. Bushratariq

    Thread Starter New Member

    May 15, 2014
    13
    0
    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
     
  2. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
    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.
     
  3. Bushratariq

    Thread Starter New Member

    May 15, 2014
    13
    0
    if there is no code its fine. i will work on it my self. please can you guide me on my queries in the above comment?
     
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
  5. Bushratariq

    Thread Starter New Member

    May 15, 2014
    13
    0
    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.
     
  6. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,394
    1,606
    1. Download the Microchip Libraries for Applications.

    2. Install the libraries.

    3. Browse down to ...\microchip_solutions_v2013-02-15\MDD File System-SD Card

    4. Select a device and open the sample project.

    There's an app note somewhere on Microchip's site too that may be helpful.
     
    absf and sirch2 like this.
  7. sirch2

    Well-Known Member

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

    But thanks for the link
     
  8. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,394
    1,606
    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.
     
  9. Bushratariq

    Thread Starter New Member

    May 15, 2014
    13
    0
    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: May 20, 2014
  10. Bushratariq

    Thread Starter New Member

    May 15, 2014
    13
    0
    There is a senior member of this forum named davebee. I dont know how to reach him. Private message option is not available.His answer on the following mentioned thread of 2010 makes me think he can guide me .
    CAn anyone reach him?


    http://forum.allaboutcircuits.com/showthread.php?t=36262
     
Loading...