Page 1 of 1

FatFS implementation for PIC32

Posted: Fri Mar 04, 2011 1:54 pm
by Cannibal
Hi All,

I got tired of a FatFS implementation not being available for PIC32 so I spent a day figuring out how to adapt the other examples and came up with something that should be easier to learn from.

It targets the CPU on the sparkfun PIC32 board as commented in the archive.

Here is a link to my post on the microchip forums which includes some comparative benchmarks to the microchip provided MDD library:

Hope this saves someone some time.

Re: FatFS implementation for PIC32

Posted: Sun Mar 06, 2011 2:41 pm
by Cannibal
Two more notes:

1) I'm still learning to use the file access controls like CREATE_ALWAYS etc. - the main.c in the rar archive doesn't properly do what I intended (create a new log file at each startup) - the updated main.c is attached, so it actually creates a new file at each startup for a logging application.

2) I forgot to mention that I disabled the timeout timer aswell, so while I haven't seen a read or a write timeout yet, there's no protection against this in the current code - originally ChaN indicates that 2 timer counters should be used that are decremented at 1kHz in a timer interrupt, but I just left them.

Hope these haven't tripped anyone up.
--An updated main.c is that addresses no.1 is attached.