FatFS implementation for PIC32

Have you got the greatest 48 bit multiplier ever conceived? Prove it - post your code here.

Moderator: phalanx

Post Reply
Cannibal
Posts: 322
Joined: Sat May 20, 2006 9:10 pm

FatFS implementation for PIC32

Post by Cannibal » Fri Mar 04, 2011 1:54 pm

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:

http://www.microchip.com/forums/m563218.aspx


Hope this saves someone some time.
Attachments
PIC32FatFS.zip
FatFS running on the sparkfun PIC32 board
(196.1 KiB) Downloaded 308 times

Cannibal
Posts: 322
Joined: Sat May 20, 2006 9:10 pm

Re: FatFS implementation for PIC32

Post by Cannibal » Sun Mar 06, 2011 2:41 pm

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.
Attachments
main.c
Updated main.c to make the new file creation work properly at each startup.
(4.96 KiB) Downloaded 232 times

Post Reply