CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

TESTERS NEED! SD CARD FAT16 LIBRARY

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
diegonet



Joined: 13 Sep 2005
Posts: 4

View user's profile Send private message

TESTERS NEED! SD CARD FAT16 LIBRARY
PostPosted: Sat May 06, 2006 4:43 pm     Reply with quote

Hi to everyone.
In my search of a good and FUNCTIONAL SD Card FAT16 library I found
one from the circuit cellar 176, autored by Ivan Sham.

This one has been write for a mps procesor, so I do the convertion's to work with a PIC microcontroller.
The connection is quite simple (I also attached a schematic of my test platform with a 18F6722).
Any other micro with 1024 bytes of RAM would be ok.

I could write and succefully read a file to the root directory of a 512 megs FAT16 card.
I dont' test the directory support.

I have problems writing a big quantity bytes of data. Small packet's are writting without problem.

So I requesting help to solve this. Also I don't have clear how the writtings are managed, as the card's
need 512 writes, do the library read a sector, update with the new data and write all the 512 bytes again?
Are this function working ok?

I believe that this could very usefull for everyone. The code is well commented, so I hope that many users would
contribute to do the finals touchups.

Thank's!

Link to files:
http://rapidshare.de/files/19805520/ByDiego.zip.html
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sat May 06, 2006 10:18 pm     Reply with quote

From memory (I may be wrong) this code does not have support for subdirectories. I think you will find it was a "wet your appetite" type of article so you will check out their full stack and buy it. The code needs more than just touching up, the remaining 60% or more needs to be developed.

Writes to SD/MMC cards are in 512 bytes blocks. If you wanted to modify just a single byte of an existing sector you must read in the entire sector to ram, make the mod in the ram, and then write out the 512 byte block to the media and then update all relevant director entires (in 512 byte blocks)

If you want to be able to have several files open at a time you really need to add some additional memory to the PIC. A FRAM FM25256 is a good choice as it offers a low pin count interface (SPI) and coexists with the SD card.

In addition to the optional memory, the SD/MMC circuit needs more work:
1. It needs a level converter from the SDO of the SD/MMC card to the SDI of the PIC. If you look at the guarenteed switching level inputs for detection of a logic on on the PIC and the guarrenteed logic 1 output level from an SD/MMC card you will see you are actually out of spec. It may work in most situations - they again, it might not. One way to solve this is to put a TTL level gate in line between the SD/MMC card and the PIC.

2. The circuit shows a decoupling capacitor on the MAX232 chip but none on the PIC or on the SD/MMC card - both required decoupling.

Here is a link to a design interfacing a PIC with a SD/MMC card, a FRAM and an ENC28J60 Ethernet controller.
http://www.brushelectronics.com/download/BE_LDR_Ref_HW.zip
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Sun May 07, 2006 11:29 am     Reply with quote

A word of caution FAT is fully owned by Microsoft. Working with FAT in any capacity including testing without purchasing a permission from Microsoft may well be unlawful. Permissions from Microsoft can cost a maximum of $250,000.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun May 07, 2006 12:11 pm     Reply with quote

The actual unit license is 25 cents (US) per unit. The $250K number
is the maximum total royalites that will ever be charged to one
manufacturer.
See this microsoft page
http://www.microsoft.com/mscorp/ip/tech/fat.asp
Most people have the opinion that this doesn't affect 8.3 FAT but
does affect Long Filenames. If you do a web search, you'll find
lots of discussions on this. Example:
http://www.gripe2ed.com/scoop/story/2003/12/9/13137/1197
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group