View previous topic :: View next topic |
Author |
Message |
halibatsuiba
Joined: 12 Aug 2009 Posts: 30
|
fat.c / ex_fat.c: SD card, contents messed up. |
Posted: Wed May 26, 2010 8:28 pm |
|
|
Yet another datalogger-project where data is supposed to be stored in SD-card so it could be analysed in PC.
I format SD card with PC, create some directories and files.
Then I move card to my test circuit and use ex_fat.c to see the contents of card (with "dir"-command).
Listing is messed up, there is directory/file names in 8+3-format but names are all messed up. Example:
hÌ*Äáí.kÈ
\ÌfÄeâvb.k"
Äíd\$f'â.eÙ
¸Édìd¼.da;
I can create/remove directories and files, append data to files, cat files etc. with PIC but they do not show when I connect card to PC. Everything created earlier with PC is ok.
Files/directories created with PIC are ok if I check them with PIC.
What could possibly be wrong?
Not likely a hardware problem because I can create and delete files with PIC.
Source code: ex_fat.c
Only changed buffer sizes in main()-function and pin assignments for SD card connection.
char buffer[255] -> char buffer[64];
char opt_buffer[255] ->char opt_buffer[64];
PIC: 18F2550
Compiler: PCH 4.099
SD-card: Canon 8MB, Kingston 128MB microSD, Kingston 2GB microSD (tried with FAT32) |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Thu May 27, 2010 1:45 am |
|
|
You might want to try my drivers. It works with all these cards. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
halibatsuiba
Joined: 12 Aug 2009 Posts: 30
|
|
Posted: Thu May 27, 2010 8:57 am |
|
|
Guaranteed to work? Money back if not working as expected?
What is the writing speed to SD card with your drivers in kilobytes per second? |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Thu May 27, 2010 9:11 am |
|
|
halibatsuiba wrote: | Guaranteed to work? |
Yes - provided the data structures on the media are valid
Quote: | Money back if not working as expected? |
No. The drivers are in source code form - you can't stuff a genie back in the bottle. However I have lots of CCS customers using this driver. Why not ask on the forum the experience of other users of the driver?
Quote: | What is the writing speed to SD card with your drivers in kilobytes per second? | I don't know. The fastest I have tried for a production application was 12 (24?) bytes every millisecond but that was with a PIC24 with the C30 compiler. I have not speed tested the CCS PIC18F implementation. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
johanpret
Joined: 23 Oct 2006 Posts: 33 Location: South Africa
|
Pic24FJ256 SD Driver PCWHD Compattible? |
Posted: Fri May 28, 2010 12:47 am |
|
|
Andrew ,
I want to use the CCS compiler (PCWHD) on the Pic24FJ256 and use your SD Driver did you ever test it on this configuration to see if it work? I see you have it for the PIC18 and CCS. It should work I can't see any reason why not but would like to know if you testes it?
Johan |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
Re: Pic24FJ256 SD Driver PCWHD Compattible? |
Posted: Fri May 28, 2010 12:58 am |
|
|
johanpret wrote: | Andrew ,
I want to use the CCS compiler (PCWHD) on the Pic24FJ256 and use your SD Driver did you ever test it on this configuration to see if it work? I see you have it for the PIC18 and CCS. It should work I can't see any reason why not but would like to know if you testes it?
Johan |
I have not tested the driver on recent versions of the CCS compiler. The driver did not work on PCD. There were a number of issues related to SPI ports, pointers and heap that prevented it from working. It is on my to do list but it has sat there for a few months now... _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
SpoonBilly
Joined: 25 May 2010 Posts: 16
|
Re: fat.c / ex_fat.c: SD card, contents messed up. |
Posted: Sat May 29, 2010 7:30 am |
|
|
halibatsuiba wrote: | Yet another datalogger-project where data is supposed to be stored in SD-card so it could be analysed in PC. |
Working on similar thing. Use similar PIC too. I m using PIC18F2553.
http://www.ccsinfo.com/forum/viewtopic.php?p=132795#132795
mmcsd.c reads and writes using logical address. There is an offset between logical and physical sectors. I modified mmcsd.c to scan the offset such that mmcsd_read_data() is able to read correct information from the boot sector (Physical address 0x0 ~ 0x1FF). Did you do the same? or you found better solution?
However, mmcsd_read_data() is still unable to read the correct Next_Free_Clust (Physical address 0x3EC ~ 0x3EF). The reason is that it is located inside the reserved sector and somehow, mmcsd_read_data() isn't able to read correctly from reserved sector. Have you seen the same problem?
Thanks. |
|
|
halibatsuiba
Joined: 12 Aug 2009 Posts: 30
|
|
Posted: Wed Jun 02, 2010 7:32 am |
|
|
Can you give a list of PIC cpus and SD-cards you have tested your software with?
Also it would be nice to get general hw and sw requirements, like how much RAM and EEPROM it uses, which CCS compiler you have tested it with etc.
+++++++++++++++++++++++
Please discuss sales issues of products by PM or email.
Ref. forum rules #7, #8
-- Forum Moderator
+++++++++++++++++++++++
asmallri wrote: | halibatsuiba wrote: | Guaranteed to work? |
Yes - provided the data structures on the media are valid
Quote: | Money back if not working as expected? |
No. The drivers are in source code form - you can't stuff a genie back in the bottle. However I have lots of CCS customers using this driver. Why not ask on the forum the experience of other users of the driver?
Quote: | What is the writing speed to SD card with your drivers in kilobytes per second? | I don't know. The fastest I have tried for a production application was 12 (24?) bytes every millisecond but that was with a PIC24 with the C30 compiler. I have not speed tested the CCS PIC18F implementation. |
|
|
|
|