Mikroelektronika MIKROE-442 Datenbogen
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
279
Compact Flash Library
The Compact Flash Library provides routines for accessing data on Compact Flash card (abbr. CF further in text). CF
cards are widely used memory elements, commonly used with digital cameras. Great capacity and excellent access
time of only a few microseconds make them very attractive for microcontroller applications.
In CF card, data is divided into sectors. One sector usually comprises 512 bytes. Routines for file handling, the
Cf_Fat
routines, are not performed directly but successively through 512B buffer.
Important:
- Routines for file handling can be used only with FAT16 file system.
- Library functions create and read files from the root directory only.
- Library functions populate both FAT1 and FAT2 tables when writing to files, but the file data is being read from the
FAT1 table only; i.e. there is no recovery if the FAT1 table gets corrupted.
- If MMC/SD card has Master Boot Record (MBR), the library will work with the first available primary (logical)
partition that has non-zero size. If MMC/SD card has Volume Boot Record (i.e. there is only one logical partition and
no MBRs), the library works with entire card as a single partition. For more information on MBR, physical and logical
drives, primary/secondary partitions and partition tables, please consult other resources, e.g. Wikipedia and similar.
- Before writing operation, make sure not to overwrite boot or FAT sector as it could make your card on PC or digital
camera unreadable. Drive mapping tools, such as Winhex, can be of great assistance.
Library Dependency Tree