MMC/SD Card Pic18f2420

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
Soren
Posts: 12
Joined: Tue Jun 09, 2009 4:17 pm
Has thanked: 1 time
Been thanked: 3 times

MMC/SD Card Pic18f2420

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: MMC/SD Card Pic18f2420

Post 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?

Soren
Posts: 12
Joined: Tue Jun 09, 2009 4:17 pm
Has thanked: 1 time
Been thanked: 3 times

Re: MMC/SD Card Pic18f2420

Post 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

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: MMC/SD Card Pic18f2420

Post 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.

Soren
Posts: 12
Joined: Tue Jun 09, 2009 4:17 pm
Has thanked: 1 time
Been thanked: 3 times

Re: MMC/SD Card Pic18f2420

Post 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.

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: MMC/SD Card Pic18f2420

Post by Steve »

FAT is presumably FAT16. Ben should be able to help more with this problem.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: MMC/SD Card Pic18f2420

Post 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.

Soren
Posts: 12
Joined: Tue Jun 09, 2009 4:17 pm
Has thanked: 1 time
Been thanked: 3 times

Re: MMC/SD Card Pic18f2420

Post 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"

NickUS
Posts: 6
Joined: Tue Oct 13, 2009 4:40 pm

Re: MMC/SD Card Pic18f452

Post 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

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: MMC/SD Card Pic18f2420

Post 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.

Post Reply