6.1.4 Open-Drain Configuration (ODCx)

Each I/O pin can be individually configured for either normal digital output or open-drain output. This is controlled by the open-drain control register, ODCx, associated with each I/O pin. If the ODCx bit for an I/O pin is a ‘1’, the pin acts as an open-drain output. If the ODCx bit for an I/O pin is a ‘0’, the pin is configured for a normal digital output (the ODCx bit is valid only for output pins). After a Reset, the status of all the bits of the ODCx register is set to ‘0’.

The maximum open-drain voltage allowed is the same as the maximum VIH specification. The ODCx register setting functions in all of the I/O modes, allowing the output to behave as an open-drain even if a peripheral is controlling the pin. Although, the user may achieve the same result by manipulating the corresponding LATx and TRISx bits, this procedure does not allow the peripheral to operate in the Open-Drain mode (except for the default operation of the I2C pins). I2C pins are already open-drain pins; therefore, the ODCx settings do not influence the I2C pins.