This was exactly my approach also. Using a PC, you can format a CF card, and start a simple text file, for example. By following along with the Microsoft paper, you can program the PIC to read the FAT, find that particular file name, go to the starting sector for that file, and follow the file through various sectors. While reading the file with the PIC is easier than writing to the file, writing can be done also, but requires a little more overhead as far as changing the other bytes of information pertaining to that file, once it has been modified (i.e. next sectors, file size, etc.). The whole initialization process can also be done using the PIC itself, by streaming a known FAT, byte-by-byte, onto a new card, but this would definitely require using some external memory to store that data block which needed to be written. As far as the buffer inside the CF Card goes, you can start a write operation, then just fill the buffer sequentially as each byte becomes available. Once the write operation has started, as long as no other commands are sent, data can be written to the buffer with practically no time requirements. Once the buffer is full, the data is written to the particular sector previously designated. -Mark At 09:46 AM 2/15/01 -0500, you wrote: >Sometimes you can come up with a subset of the specification >that is compatible enough to get the job done. For example, >in the bad old days of CP/M I wrote a routine for a >datalogger that allowed it to read and write data to a >SINGLE file that had a FIXED name and even a fixed starting >position on the disk. Since this was the ONLY file on the >disk, the file allocation table was easy to build and use, >as I basically stored the data in sequential blocks. This made >the writing of the file at the datalogger side very simple. >The cpu used for the datalogger was a Z80, and I used a >Western Digital floppy controller chip for the interface. > >I kept things standard enough that a computer running CP/M >could read the single file with no problems. The CP/M >computer was also used for creating the formatted disk >and placing the initial empty file onto the disk. > >This resulted in a minimum amount of hassle, and a product >that was standard enough to be useable on any CP/M >machine that was equipped to read 5 1/4" disks. > >I would think that a single file on a datalogger would >be OK for most applications. Does anyone know if the >RAM buffer in the CF cards is addressable by the host? >If so, you would not need too much RAM on the PIC side. >If not, then you might still get away with minimal ram >so long as you can feed the data in serial fashion to >the CF card's buffer as it is generated. Either way >I wouldn't think it would be too difficult to come up >with a subset of the file system that you could handle >on a PIC with relative ease. > >Fr. Tom McGahee > >----- Original Message ----- >From: Peter Betts >To: >Sent: Thursday, February 15, 2001 3:57 AM >Subject: Re: [PIC] CompactFlash to PIC interface > > > > This is exactly what I currently do but I was wondering how I could save > > data onto the FlashCard in a format that would look like a FAT32 file under > > windows etc. i.e. plug in the FlashCard to the PIC hardware, store my > logged > > data, then take it out and load it up to a PC by just dragging and dropping > > the file from the FlashCard to the PC. > > > > I also know I could just use WinHex or something similar to just suck > up raw > > data but Mark suggested that you could format the FlashCard in a PC and > then > > add to it with compatible FAT32 files rather than raw data in your PIC > > hardware. > > > > I tried posting this but the MailBox was full. > > > > http://www.compactflash.org/specdl1.htm. > > > > http://209.67.75.168/hardware/fatgen.htm > > > > Regards, > > > > Pete > > > > > > > You already can read a CompactFlash, and just about any other > > > flash media, > > > from a PC/laptop. My digital camera uses CF and I have a > > > PCMCIA adapter to > > > plug into my laptop to read directly off the card as though > > > it was another > > > drive. Only cost $15 too. They also make USB adapters for > > > all the flash > > > medias, but they probably cost more. I know SmartMedia USB and PCMCIA > > > adapters cost more. > > > > -- > > http://www.piclist.com hint: To leave the PICList > > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > > > > >-- >http://www.piclist.com hint: To leave the PICList >mailto:piclist-unsubscribe-request@mitvma.mit.edu ------------------------------------------- Mark Samuels ARMA Design Tel:(858) 549-2531 Fax:(858) 549-2594 Email: mark@armanet.com Web: www.armanet.com The information contained in this electronic message is private and may contain privileged, confidential or inside information. Any distribution, copying or forwarding or use of this communication by anyone other than the intended recipient(s) is strictly prohibited and may be unlawful. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu