I know this topic been here for a while, and i studied it as well as the code posted by users... now here is something strange going on.
First of all let me show u my hardware schematic, here it goes in attachment:
the thing is..before i was just running standard Microchip's application - MDD File System-SD Card, and the strange thing is, after i runned it, and then took out my SD card and put it into PC, i saw just FILE1.TXT was created but nothing was written inside... so i guess... if it was created then my hardware schematic is OK
interesting thing is even after creating file it returned NULL pointer....if the file wouldnt been created then i would guess soemthing is wrong...but it DID create file...but did not write anything in it...
and the funniest thing now is...without any modification, now it doesnt create file at all

very strange... i have formatted SD card both as FAT16 and FAT32...no luck...
any ideas where the problem might be?
thank you