Dedicated I2C Pad Control Registers

The PIC16 and PIC18 families dedicate specific I/O pins for use with each internal peripheral, including I2C. The stand-alone I2C module has dedicated control registers, RxyI2C, that configure the I2C slew rate, internal pull-ups, and input threshold levels for the dedicated default I2C pins. The Open-Drain Control (ODCONx) must be properly configured for each pin. Historically, the MSSP module did not include dedicated Pad Control registers, although they are now included on most new devices. When using the MSSP module that does not include the RxyI2C registers and the standard pins are used, open-drain control and I2C input level control is handled by the hardware automatically. Slew rate control is handled by the SMP bit of the SSPxSTAT register and the SLRCONx register, and SMBus input levels are handled by the SMbus Select (CKE) bit of the SSPxSTAT register.

Important: Devices that have the Peripheral Pin Select (PPS) feature allow for the default pins to be relocated to other pins. The RxyI2C registers are mapped to the individual device’s I2C pins; if the pins are relocated using PPS, the RxyI2C registers cannot be used. Instead, individual Weak Pull-Up (WPUx), Slew Rate Control (SLRCONx), ODCONx and Input Level Control (INLVLx) registers must be properly configured.

Slew rate control is handled by the SLEW bit of the RxyI2C register. When SLEW = 1, I2C specific slew rate limiting is enabled, while the standard pin slew rate limiting is disabled, and the SLRCONxy bit setting for the pin is ignored. When SLEW = 0, I2C specific slew rate limiting is disabled, and slew rate control is reverted back to the SLRCONxy bit.

I2C internal pull-up selection is handled by the Pull-Up (PU) bits of the RxyI2C register. The PU bits select either two times or ten times the current of the standard weak pull-up, or allow for the standard weak pull-up control to be enabled/disabled via the WPUxy bit associated with the pin. This feature allows the internal pull-up resistors to be used instead of external resistors. The MSSP module does not have configurable internal pull-ups, and it was not recommended to use the internal weak pull-ups in place of external resistors.

The I2C Input Threshold Selection (TH) bits of the RxyI2C register control the input threshold values. These bits allow for SMBus 3.0, SMBus 2.0, I2C specific, or standard I/O input levels to be used, depending on the application requirements. When the standard I/O input level is selected, threshold control reverts back to the INLVLxy bit associated with the pin. The MSSP module’s CKE bit controls the SMBus input levels. Instead, the bit only allows for either SMBus 2.0 or I2C specific levels.