33.1 Overview

The IO Pin Controller (PORT) controls the I/O pins of the device. The I/O pins are organized in a series of groups, collectively referred to as a PORT group. Each PORT group can have up to 32 pins that can be configured and controlled individually or as a group. The number of PORT groups on a device may depend on the package/number of pins. Each pin may either be used for general-purpose I/O under direct application control or be assigned to an embedded device peripheral. When used for general-purpose I/O, each pin can be configured as input or output, with highly configurable driver and pull settings. On PIC32CM SG devices, if the PORT peripheral is configured as mixed-secure in the H2PB, each pin can be defined as secure or non-secured, where secured pins can only be handled by secure accesses.

All I/O pins have true read-modify-write functionality when used for general-purpose I/O; the direction or the output value of one or more pins may be changed (set, reset, or toggled) explicitly without unintentionally changing the state of any other pins in the same port group by a single, atomic 8-bit, 16-bit, or 32-bit write.

Note: If AVDD < 2.5v, the user must enable analog charge pumps in SUPC.VREGCTRL.CPEN[2:0].