Professional Documents
Culture Documents
Microchip PIC24F Peripheral Library
Microchip PIC24F Peripheral Library
Getting Started
Using the Peripheral Libraries - PIC24F Family
These libraries provide a set of common interface functions to initialize and use peripheral modules on Microchip 16-bit
microcontrollers. The libraries have been optimized for code size efficiency.
The library files are of the form libpPIC24Fxxx-elf.a or libpPIC24Fxxx-coff.a (depending on executable/object file
format selected during the compile operation). These library supports all the variants of PIC24F devices as given under
the “Devices Supported†heading.
The header files are of the form peripheral.h, where peripheral is the name of the particular peripheral being used
(e.g., pwm.h for PWM Module). There is also a header file GenericTypeDefs.h which consists of easy-to-use typedefs
and frequently-used data types.
When linking an application, the library file ( libpPIC24Fxxx-elf.a or libpPIC24Fxxx-coff.a) must be provided as an
input to the linker (using the --library or -l linker switch) such that the functions used by the application may be
linked into the application.The .a file to be added to the Project window under Library files. When compiling an
application, each header file must be referenced (using #include) by all source files which call a function in the library
or use its symbols or typedefs.
Each constant included in any of these AND-ed expressions corresponds to the 16-bit mask for a possible selection for
a certain bit or bit-field in a Special Function Register (SFR). Each argument, in turn, typically corresponds to the
value written to an entire SFR. Thus, by logically combining chosen values for every bit-field in the SFR, the complete
initialization value of the SFR is obtained.
To use the AND-OR mask setting, you will need to define the macro (#define USE_AND_OR) at the beginning of