Well, something I just did to allow a pic to bootload off an MMC/SD is to do the following: 1. Format the card on the PC. 2. Write a single file with the bootload data (I am bootloading with the hex file). Include a line of identifying text at the start of the file. I used the company name, copyright, product model, etc. 3. When the PIC reads the card, it just looks for the identifying string at the start of the file, then reads the file sector by sector. It's possible there will be bad sectors that will be marked in the FAT, which we are skipping, but I have not seen the problem as yet. I was doing a compact bootloader in asm, so I didn't want to get into the FAT (which I do in the application in C). By formatting the card before putting the file on there, we SHOULD have the file in a bunch of sequential sectors. We just have to figure out where it starts, so I used the string search. The start of the file is always at the start of a sector, so you can just do a string compare of your sector buffer to the string (you don't need to see if the string starts in the second byte of the buffer, then the third, etc.). In my bootloader, I search for the string, then run through the hex code checking checksums of each line, looking for end of file record. If it passes, I find the start of the file again, then bootload. Harold > Is there a way (and if so what is the best way) to access a memory > card without a filesystem from Windows (or Linux or Mac)? Something > programmatic I'm thinking - so I could just write data to a card with > a PC with custom software and simply stream it off with a PIC without > worrying about files or filesystems (or vice versa). > > -n. > > > On Nov 7, 2006, at 2:31 PM, peter green wrote: > >> >> >> >>> -----Original Message----- >>> From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]On >>> Behalf >>> Of Harold Hallikainen >>> Sent: 07 November 2006 19:03 >>> To: Microcontroller discussion list - Public. >>> Subject: RE: [PIC] Interfacing a PIC to a microSD or TransFlash card >>> >>> >>> >>>> >>>>> FAT32 goes up to 32GB in actual implementations >>>> i have a 160 gig fat32 hard drive in an external caddy running >>>> just fine >>>> with XP, i just had to format it using a win98 box. >>>> >>> >>> Is the "limitation" how many sectors are allowed per cluster? >>> Microsoft's >>> FAT Overview says BPB_SecPerClus is one byte. Supposedly, for >>> FAT16 (which >>> is what I'm most familiar with), this could allow 255 sectors per >>> cluster >>> times 512 bytes per sector times about 65,535 clusters or 8.55e9 >>> bytes per >>> disk. This would be a cluster size of 262,144 bytes. The Microsoft >>> document also says the cluster size must be a power of 2, so the >>> maximum >>> would then be 128, or 65536 bytes per cluster. It ALSO goes on to >>> say you >>> cannot have a cluster size greater than 32kBytes. >> IIRC NT allowed you to break that rule and have 64k clusters, I >> remember the 98 resource kit saying that 98 could read and write >> fat16 partitions over 2 gigabytes but none of its disk utilities >> were comaptible with them. >> >> >>> Is FAT32 similar, but with a larger FAT table, and with 32 bit >>> cluster >>> identifiers in that table? >> i think that is the gist of it but i belive there are some other >> minor changes too. >> >> according to wikipedia >> >> "In order to overcome the volume size limit of FAT16, while still >> allowing DOS real-mode code to handle the format without >> unnecessarily reducing the available conventional memory, Microsoft >> decided to implement a newer generation of FAT, known as FAT32, >> with cluster counts held in a 32-bit field, of which 28 bits are >> currently used." >> >> so that would mean 256 megaclusters >> >> which keeping the 32K cluster size limit would mean 8 terabytes >> >> i don't know why wikipedia says the actual limit is 2 terrabytes >> and i don't have any ms docs handy to compare but either way its >> big enough not to be a worry for most hard drives just yet. >> >> >> -- >> http://www.piclist.com PIC/SX FAQ & list archive >> View/change your membership options at >> http://mailman.mit.edu/mailman/listinfo/piclist > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- FCC Rules Updated Daily at http://www.hallikainen.com - Advertising opportunities available! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist