Configuring Internal Pull-ups on Default I2C pins

Newer device families feature dedicated I2C pads that provide the ability to reconfigure certain GPIO characteristics to better meet the I/O requirements of I2C communication. The weak pull-ups on standard GPIO pins are typically not strong enough to be used on the I2C bus and instead external pull-up resistors of the appropriate values are typically incorporated into the design. The I2C specific pads allow users to program the weak pull-ups on those pins to allow either twice or ten times the standard weak pull-up current for a GPIO. In many applications, these stronger internal pull-ups can sufficiently drive the I2C bus and can be used in place of external pull-up resistors.

Table 9-1 compares the standard GPIO weak pull-ups to the higher current configurations that are available on the dedicated I2C pads. For the calculations, the typical weak pull-up current value of 140 µA was used from the PIC18F57Q43 electrical specifications. It can also be assumed that for the purposes of these calculations, the operating voltage VDD is equal to 3.0V. These calculations are meant to serve as an approximation and can be different for each application, depending upon many other factors, such as operating voltage and the specified weak pull-up current.
Table 1. Calculating Internal Pull-ups based on the I2C Pull-up Selection Bits - PU[1:0]
PU[1:0] I2C Pull-up Selection Bits Internal Pull-up Value (RPU)
11 Reserved Reserved
10 10x Current of Standard Weak Pull-up
RPU=VDDIPUR=3.0V10×140μA=2.1
01 2x Current of Standard Weak Pull-up
RPU=VDDIPUR=3.0V2×140μA=10.7
00 Standard GPIO Weak Pull-up
RPU=VDDIPUR=3.0V140μA=21.4

The internal pull-ups on I2C dedicated pads can be controlled by writing to the PU[1:0] bits of the I2C pad Rxy Control (RxyI2C) register. In order to use the PU[1:0] bits for internal pull-up selection, weak pull-ups must be enabled by setting the corresponding WPUx bits. Once weak pull-ups have been enabled on the I2C dedicated pins being used for SDL and SCL, they will default to the standard GPIO weak pull-up strength. If the user wishes to use the internal pull-ups as opposed to external pull-ups on the bus, the PU[1:0] bits would need to be set accordingly to adjust the strength of the internal pull-ups to either twice or ten times the current.