2
\$\begingroup\$

I am using a PIC18f25k80 microprocessor and I want to transfer data on an SD card over SPI. The compiler I am using is MPLAB X XC8. Could you please provide an example of how I can initialise the SD card and SPI and how I can create a file where I can store the data. Even a pseudo code would be really appreciated if the task is too complicated!

I have already tried to find examples, but I am really confused on how to put all these together.

Thank you

\$\endgroup\$
2
\$\begingroup\$

there is the microchip Application note number 1045 that can help you with that:

an1045

and for come code exemple, I took this to start:

SD + PIC24F

\$\endgroup\$
1
\$\begingroup\$

I don't know if you have managed to resolve that issue, The easiest way is to use FatFs library, it works well with MPLAB XC8 compiler and it easier to implement. Microchip Library for application File I/O (SD Card library ) doesn't support 8-bit PIC Microcontrollers at the moment, the last supported version released in 2013 was made for the old MPLAB 8 compiler, it's a hassle to make it work with XC8 compiler. I would advice you to use FatFs library. here is a working example using PIC18F45k22: http://www.studentcompanion.co.za/interfacing-sd-card-with-pic-microcontroller-xc8/

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.