Page 1 of 1

MMC/SD Card Pic18f2420

Posted: Tue Aug 11, 2009 10:25 am
by Soren
Hi

I want to datalog to a sd card but can get it work
I have a HP488 an a eblock card reader board connectet to port C
The FAT16 customfile is in the componets folder
In Flowcode i have selectet the port C in the custom componet settings
when i run the program an put the card in it sais creating file an file exists
the card is empty it is formatet in Fat. I have tried 3 different cards with the same resault

can someone help me maybee i do something wrong???

Soren

Re: MMC/SD Card Pic18f2420

Posted: Tue Aug 11, 2009 3:14 pm
by Benj
Hello Soren

Is the card being detected ok by the HP488 board. Eg does the program complain if no card is present?

Once you have written the file to the card have you checked the card on the PC to see if the file has been created? For the component to report that the file has been created and opened it seems strange that you cannot see the files.

Just out of curiosity which operating system are you using?

Re: MMC/SD Card Pic18f2420

Posted: Tue Aug 11, 2009 8:40 pm
by Soren
Hi Ben

Yes the card being detected OK when i use the MMC.HEX test file
When i check the card on the PC is there no file. If i check the properties for the card is there 2MB used.

When i use the flowcode example Data_logger_simple_slow an the custom code the board can also detect the card.
If there is no card i sais "waiting for card" but it can not create a file on the card. There is no file an nothing used
when i check it on the PC.

I use Flowcode 3 on Windows XP

Re: MMC/SD Card Pic18f2420

Posted: Wed Aug 12, 2009 7:50 am
by Steve
I think the card needs to be formatted as FAT16 and not FAT32. Perhaps this is the problem? Also, some cards can be write-protected and this might cause problems.

Re: MMC/SD Card Pic18f2420

Posted: Wed Aug 12, 2009 8:25 am
by Soren
Hi Steve

I can only formate the card as FAT or FAT32. I have formatted the card as FAT
What is the difference between FAT an FAT16?

The card is not write-protected. The PC can write on the card.

Re: MMC/SD Card Pic18f2420

Posted: Wed Aug 12, 2009 8:34 am
by Steve
FAT is presumably FAT16. Ben should be able to help more with this problem.

Re: MMC/SD Card Pic18f2420

Posted: Wed Aug 12, 2009 8:39 am
by Benj
Hello Soren

The FAT setting stands for FAT16 so this should be correct. Your also using an 18F so the 512 byte buffer should be working correctly.

How big is the card and does it have muliple partitions? The FAT component scans for and uses the first valid partition it comes to.

Have you tried creating a file on the card using the PC and then creating a Flowcode program to try and stream the data from the file. There is a Read File example in the version 4 examples pack that should allow you to test this.

Re: MMC/SD Card Pic18f2420

Posted: Wed Aug 12, 2009 10:31 am
by Soren
Hi Ben

The card is a 512MB card an it dont have muliple partitions.

I tried to create the file on the PC an then open it with the board, same resault "error"

Re: MMC/SD Card Pic18f452

Posted: Mon Oct 26, 2009 1:49 pm
by NickUS
I need help using FAT, I need to create 3 text files, and append a string that's coming from ADC, I've tried to use the data logger simple slow, I just added more file to be created and it didn't work, does anybody have any experience with FAT and could help me ?? Thanks

Re: MMC/SD Card Pic18f2420

Posted: Mon Oct 26, 2009 2:36 pm
by Steve
Are you using Flowcode? If so, which version? If not, what development langauage are you writing in?

Have you tried any of the example programs we provide? These should be a good starting point for you.