TOP Contributors

  1. MIKROE (2642 codes)
  2. Alcides Ramos (347 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136222 times)
  2. FAT32 Library (69489 times)
  3. Network Ethernet Library (55708 times)
  4. USB Device Library (45992 times)
  5. Network WiFi Library (41639 times)
  6. FT800 Library (40789 times)
  7. GSM click (28789 times)
  8. PID Library (26332 times)
  9. mikroSDK (26056 times)
  10. microSD click (25141 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Library

Fat

Rating:

24

Author: dany

Last Updated: 2016-02-28

Package Version: 3.1.0.0

Category: Storage

Downloaded: 13089 times

Followed by: 6 users

License: MIT license  

Several libraries for Fat16 and Fat32:
- Fat16Dir (findfirst, findnext) (only P18)
- Fat16DirLFN (Fat16Dir for long filenames) (only P18)
- Fat32_,1 Fat32_2; single and multiple Fat32 device(s) for P18, PIC24, dsPIC and PIC32
- IDE for P18, PIC24 and dsPIC.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Fat" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Fat" changes.

Do you want to report abuse regarding "Fat".

  • Information
  • Comments (21)

Library Blog

Libraries:

* Fat16 Directory and Long file names handling (only P18):

- Fat16Dir

- Fat16DirLFN

* Fat32 filesystem implementation (only P18, PIC24 and dsPIC):

- Fat32_1  - only one file in one directory - see short documentation - full documentation

- Fat32_2 - multiple files in multiple directories - see short documentation - full documentation

- Fat32_1_MD: same as Fat32_1, but more than one Fat32 device possible, still only one file in one directory per Fat32 device. Documentation.

- Fat32_2_MD: same as Fat32_2, but more than one Fat32 device possible. Documentation.

Examples: Fat32_Find_Example.zip, Fat32_Multi_File_Example.zip (only for Fat32_2), Fat32_Random_Access_Example.zip, Fat32_Sequential_Access_Example.zip, Fat32_1_md_SDMMC_USB_Stick_Example.zip and Fat32_2_md_SDMMC_USB_Stick_Example.zip.

Fat32 Documentation: Fat32 File System Specification, filename: "fatgen103.doc", and Fat32 structure information.

* IDE driver (only P18, PIC24 and dsPIC):

- IDE  - IDE (harddisk) driver -

The zipfiles have the same content as the packages.

Have fun!

----------------------------------------------------------------------------------------------------------------------------------------------
2012-01-22: Version 2.0 published:
An extra version of the Fat32 library is added: Fat32_2, which is capable of handling more than one open file simultaneously (the files can be in different directories).
Additionally a "CopyFile" function has been added.

Have fun!

---------------------------------------------------------------------------------------------------------------------------------------------
2012-01-28: The Fat32_cf, Fat32_ide, Fat32_2.cf, fat32_2.ide and Ide libraries for PIC24 are added.

-------------------------------------------------------------------------------------------------------------------------------------------------
2012-06-08: The help section in the package and zip file has been updated.

------------------------------------------------------------------------------------------------------------------------------------------------
2012-07-23: Library version 2.100:

Only one version (hardware independant) of Fat32_1 and Fat32_2 exists from now onwards, the separate mmc, cf and IDE versions are gone.
All routines in the libraries also lost their "hardware" (e.g. "mmc_") prefix.

In return the using software must provide the "hardware dependancy" in the form of 2 routines:
function Fat32_Dev_Read_Sector (Sector: DWord; var Buffer: array[512] of byte): boolean;  // returns true when successfull
function Fat32_Dev_Write_Sector(Sector: DWord; var Buffer: array[512] of byte): boolean;  // returns true when successfull


I personally think this approach to construct the library is much better than the previous one (wich was simply a mistake...)

Have fun!

-------------------------------------------------------------------------------------------------------------------------------------------------
2012-08-01:
- Deleted an error in "MakeNewFile". (sorry for the possible inconvenience).
- Changed the signature and usage of "Fat32_Delete": the file needs not to be open before deletion. The name of the file to delete is required as function argument now.

-------------------------------------------------------------------------------------------------------------------------------------------------
2012-08-02: Changes are made to the "Fat32.." libraries:


Fat32_1:

Added the following routines:

  •     Fat32_Read_File_Sector
  •     Fat32_Replace_File_Sector
  •     Fat32_Write_Sector
  •     Fat32_Get_File_Size_Sectors
  •     Fat32_CopyFile

Fat32_2:

  • Uses only one SectorBuffer now: avoids writing conflicts in the same directory area. Saves a lot of ram when more than one file is handled.
  • The routine "Fat32_Write_File_Sector" has been renamed into "Fat32_Replace_File_Sector" (more appropriate)
  • The routine "Fat32_Write_Sector" has been added (same as "Fat32_WriteBuffer" but for whole sectors only).

------------------------------------------------------------------------------------------------------------------------------------------------
2012-08-05:

Fat32 and Fat32_2:
Added the routines "Fat32_RmDir_All", "Fat32_Delete_All" and "Fat32_Delete_Files"

------------------------------------------------------------------------------------------------------------------------------------------------
2012-08-16: Added extended documentation for the Fat32(_1 and_2) libraries. Also examples were added.

------------------------------------------------------------------------------------------------------------------------------------------------
2012-08-18: In the Fat32 and the Fat32_2 libraries: Changed the result of the Fat32_xxxSpace_GB routines to type real (too much rounding down errors otherwise).

------------------------------------------------------------------------------------------------------------------------------------------------
2012-08-29: made "Fat32_Read_File_Sector" faster (Fat32_1 and Fat32_2 libraries).

------------------------------------------------------------------------------------------------------------------------------------------------
2012-08-30: streamlined the Fat32_Read_sector and Fat32_Write_Sector procedures in the Fat32_1 and Fat32_2 libraries:
Added "Fat32_Seek_Sector" and "Fat32_Read_Sector"

Removed "Fat32_Read_File_Sector" and "Fat32_Write_File_Sector" (replaced by "Fat32_Read_Sector" and "Fat32_Write_Sector")

------------------------------------------------------------------------------------------------------------------------------------------------
2012-09-02: Added "Fat32_Append_Sector" to the "Fat32_1" and "Fat32_2" libraries.

-------------------------------------------------------------------------------------------------------------------------------------------------
2012-10-03:
- The "Fat32" library has been rename to "Fat32_1". This is done to avoid name clashes with the Fat32 mE library in the IDE's library manager.
- The "ReadBuffer" routine in the Fat32_1 and Fat32_2 libraries is made faster for 512 byte reads on a file sector boundary.

------------------------------------------------------------------------------------------------------------------------------------------------
2012-11-12: The microBasic package(s) ha(s)(ve) been added.

Only the .mcl files are available as "library" files: they are copied from the mikroPascal version (the mP and mB .mcl files are compatible - luckely - ).

If you want to see some sources: look into the mP versions.

The example files are still in mP, not in mB. (I do not have an mB licence, so I can not compile them).

Some of the helpfiles are also still referring to mP, but all library "interfaces" are available in the mB language.

-------------------------------------------------------------------------------------------------------------------------------------------------
2012-12-07: Fat32_2 has been updated, the file is now compiled with the SSA switched on (gave a problem when used with mBasic).

------------------------------------------------------------------------------------------------------------------------------------------------
2013-01-26:  Replaced "Delay_ms" and "Delay_us" by routines available in the Delays lib.
"Delay_ms" and "Delay_us" are inline routines and cannot be used in libraries if they are to be used without source (e.g. non Pascal compilers).

-------------------------------------------------------------------------------------------------------------------------------------------------
2013-02-07: Made the dsPIC packages available.

--------------------------------------------------------------------------------------------------------------------------------------

2013-10-01: Added the "Fat32_Format" routine to the Fat32_1 and Fat32_2 units.

Those units now use the units "SDMMC_Utils" and "BitUtils" (see http://www.libstock.com/projects/view/39/utilities) for the Fat32_Format routine.

The Fat32_Format routine formats the medium from scratch in contrary to "Fat32_QuickFormat".

---------------------------------------------------------------------------------------------------------------------------------------

2013-10-05: Changed the "Examples": deleted a "delay_ms(1000);" in the beginning of their main file to prevent weird problems with the initialisation of SD/MMC cards.

---------------------------------------------------------------------------------------------------------------------------------------

2013-10-08:

- Added some extra checks to make sure Fat32_Init detects a Fat32 volume (and only that) properly.

- Added the creation of the FAT entries 0,1 and 2 to the Fat32_Format routine (was mistakenly ommitted).

- Adapted the "Calculate Sectors per cluster" code according to the findings of Serkan (thanks!)

2013-10-09: - Removed an error in the "Fat32_Format" routine.

----------------------------------------------------------------------------------------------------------------------------------------

2014-03-13: The mikroBasic files and zip files have been updated. All mB sources are present now (not tested if compilable though).


2014-10-24: Added both in Fat32_1 and Fat32_2 the routine "Fat32_MkDir_ChDir_FP". It changes the current directory to the lowest level in the directory path specified, while in the mean time creating missing directories.


04-11-2014:

- Made "MakeNewFile" more time efficient (better short file name generation)
- Changed the usage of "StrAppendPre": only used on a non empty string (string lib problem)


05-11-2014: Changed the routine "MakeShortFileName" to be more efficient (code & time) and more according the Microsoft specification.


2014-12-25: Added the Fat32_1_MD library: is the same as Fat32_1 (only one open file per Fat32 device at one time), but now capable of handling more than one Fat32 device (e.g. SDMMC card and USB Stick) simultaneously.

An example of its usage can be found in the examples folder: project Fat32_1_dw_SDMMC_USB_Stick_Example.zip.
The example is for PIC24, since it shows the usage of SDMMC card and USB stick together. The latter needs the USB host library.

The documentation is not adapted yet, and the Fat32_2_MD library is under construction.


2014-12-27, Version 3.0: - simplified the interface of "Fat32_init" and "Fat32_QuickFormat" in library "Fat32_2"
- Added library "Fat32_2_MD", capable of handling multiple Fat32 devices, with multiple files/directories in each device. The documentation is adapted.


2015-01-26: Replaced the mB files: all mB files are compilable now (which e.g. means that all "with" statements are dealt with). I could however not link and test the libraries (no mB licence).


2015-02-17: Added the mP for PIC32 libraries. Only compiled, not tested.    


2015-03-23: added now in the documentation the circuit diagram how to use more than one SDMMC card toghether with the Fat_x_MD libarries.

-----------------------------------------------------------------------------------------------------------------------------------

2016-02-28: Version 3.1: Added the routine "Fat32_Truncate".

ALSO FROM THIS AUTHOR

Seven Segment

5

Library to drive 4 seven segment digits with common anode. High level routines are provided, next to the low (raw) level ones. Nothing fancy...

[Learn More]

USB_OA

26

USB libraries (HID, CDC, MSD), original architecture: only 1 kind of USB device, no composite device. -- for P18's or P24's with USB -- . Additionally: the CDC_Twin library (P18 only), which creates 2 virtual COM (CDC) devices.

[Learn More]

TempSensors Ds1820 LM35

16

The basic functions for the DS18(S/B)20 (onewire digital temperature sensor), including string output, ready to display. A routine to convert a more than 9 bits temperature read from a DS18B20 to a string (to e.g. display on an LCD) is also present. Including Parasite Power and Configuration routines. The LM35 basic functions, code efficient.

[Learn More]