??? 11/13/05 02:22 Read: times |
#103639 - Some SD/FAT answers Responding to: ???'s previous message |
Jeff Corr said:
I know Craig said in the 8-bit computer forum that he had some success with them Indeed, in my free time I'm currently working on an SD-card-based FAT12 system. The SD communication is a done deal and I'm just writing the routines to handle FAT/directory navigation/file read/writes using typical function names such as fopen, fclose, etc. 1. Is it possible to access the cards at a "low level"; IE : No filesystem. If so, I assume the cards cannot be read from in your standard card reader. Any suggestions on transferring this data to a windows PC? Yes, you read and write to an SD card in 512-byte sectors. You can write anything you want with any structure you want but, as you said, you won't be able to read it in a PC card reader if you don't conform to one of the FAT file systems. If you want to communicate with a PC, I'd recommend using a FAT system. 2. When using a filesystem, I have read that the cards are very slow to write - that they must update the FAT every 512 bytes. Is this true, and would it be possible to skip updating the FAT until the end of the write process was completed? That's totally dependent on how you implement it and it's a question of the FAT file system you use, not anything to do with the SD cards themselves. The reason for updating the FAT after every sector is so that if your process dies before it finishes, the data won't be lost. Updating the FAT and/or directory more frequently assures that you won't lose any data in the system powers-down before completion. This is really a matter of cacheing and, like with computers, you run the risk of data loss if you cache too much and power down the computer without flushing the cache. That said, you don't have to update the FAT after every sector but generally after every cluster which typically is 32 sectors (since the FAT only has cluster resolution there's no need to update the FAT unless the file has extended to a new cluster). The directory entry for the file, on the other hand, may benefit from being updated after data writes since the directory entry holds the length of the file. 3. I've seen links to projects that have used AVRs to do this; but for the most part it seems as if there is along of "finger pointing", that is everyone has links but nobody from these forums have actually done it. Before too long (I'm thinking within two weeks or so) I'll be publishing SD/FAT12 file system code in 'C'. This should offer all common file system features and functions such as fclose, fopen, fread, fwrite, floc, fseek, etc. Regards, Craig Steiner |
Topic | Author | Date |
SDcards and filesystems | 01/01/70 00:00 | |
Some SD/FAT answers | 01/01/70 00:00 | |
no FS | 01/01/70 00:00 | |
Also... | 01/01/70 00:00 | |
Even more... anybody got any ideas? | 01/01/70 00:00 | |
SD command structure | 01/01/70 00:00 | |
datasheet | 01/01/70 00:00 | |
SD card communication | 01/01/70 00:00 | |
transmission block | 01/01/70 00:00 | |
Push | 01/01/70 00:00 | |
Won't work | 01/01/70 00:00 | |
CRC | 01/01/70 00:00 | |
Thats called a file system | 01/01/70 00:00 | |
Look Here![]() | 01/01/70 00:00 |