The input/output (I/O) pins on the microcontroller package are organized into groups of up to 16 pins. Each group is called a port. Ports are named in aphabetical order: Port A ... Port G. Each pin is tied to a bit in an internal register of the microcontroller. The registers are, in turn, mapped to memory locations within the CPU address space. This practice is called memory-mapped I/O.
The association between the pin names and corresponding bit locations is shown below, for Port D.
The development board in the PIC32 Starter Kit has three LEDs and three switches connected to pins in Port D as shown:
The peripheral library is a high-level, C-language interface between the programmer and the peripheral devices of the PIC32 microcontroller.
The following include statement should be used to access the peripheral library. The file p32xxxx.h is automatically included as well.
The following documents the basic macros and functions for using digital output and input pins:
Maintained by John Loomis, last updated 18 July 2008