/Henrik is correct.

This example may help.
http://www.picbasic.co.uk/forum/cont...USB-SD-LOGGING
I did comment out the pin alias in SDFS so I could change things around in my code without bothering with opening the include.