LPC55xx: configure non "true open-drain" pins for I2C bus

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC55xx: configure non "true open-drain" pins for I2C bus

905 Views
danielholala
Senior Contributor II

Hello,

I'm using two I2C-bus interfaces on the LPC5528, Flexcomm1 and Flexcomm4.

Relating to Flexcomm1, the data sheet states that P0_13 and P0_14 are "true open-drain pins. I2C-bus pins compliant with the I2C-bus specification" (see table 3 "pin description"). Further the manual states: "All pins are standard (MFIO) port pins except P0_13 and P0_14 pins which are combo I2C/MFIO port pins." , see section 15.2.

For the second I2C-bus interface, I'm using Flexcomm4 and pins PIO0_18 and PIO0_19. These are standard port pins

This gives rise to the following questions:

Should I configure standard ports pins to "open-drain mode" (by setting the OD bit in the respective ICON register)? It seems to me that without enabling open-drain mode, the I2C bus specification might not be met, e.g., maximum current for a slave to pull a signal to GND. 

What else do I have to consider to make these pins most compatible with I2C-bus specification?

Thanks.

 

Tags (3)
0 Kudos
7 Replies

864 Views
frank_m
Senior Contributor III

> What else do I have to consider to make these pins most compatible with I2C-bus specification?

As a side note, this is less about being compatible.

The I2C bus requires the attached signal pins to be open-drain to work at all.
For SDA, the slave must be able to pull down the signal to L during the ACK bit.
And for SCL, the clock stretching feature requires the same capability.

0 Kudos

858 Views
danielholala
Senior Contributor II

Hi Frank,

you are absolutely correct. I know that I2C bus relies on participants to use open drain output drivers.Thus I'm still puzzled why the I2C bus worked at all although I had "open drain" disabled on the I2C pins.  The I2C communication is fine, see my scope shots. Thus I had no need to actively enable open drain on these pins. 

I just checked using Peripherals+ view in MCUXpresso IDE: no matter how the open drain bit is configured, I2C works with  PIO0_18 (SDA), scope shows valid I2C protocol and slave is able to pull down SDA properly (to specified minimum low level). 🤷‍

danielholala_0-1684156054793.png

 

Tschüs
Daniel

0 Kudos

852 Views
frank_m
Senior Contributor III

> Thus I'm still puzzled why the I2C bus worked at all although I had "open drain" disabled on the I2C pins. 

A good question ...
Maybe because of protective circuitry, like snubber diodes.
Hardly any manufacturer really discloses the actual pin output circuitry, datasheet usually state "symbolic protective elements".
Though it would probably unwise to rely on such a feature.
Less because of the load (a few milliamps are not a problem), but because of functionality.

0 Kudos

881 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Regarding your question, if you the pins of the FlexComm as I2C pins execpt for PIO0_13/PIO0_14, you have to configure the pin as Open drain in IOCON register of each pin,and connect the pins to a pull-up resistor, note that the pull-up voltage is 3.3V, can not be 5V, the current of source/sink is 4mA, so the pull-up resistor must be greater than 3.3V/4mA=0.9K, so I suppose that you can use 5~10K pull-up resistor.

Hope it can help you

BR

XiangJun Rong

 

874 Views
danielholala
Senior Contributor II

Thanks, XiangJun, I will configure these "standard" pins as "open drain" now when used for I2C bus. This will be more standard compliant.

NB:

In my design only a single I2C EEPROM is connected to the I2C bus. Strangely enough, the I2C bus worked even without this configuration.

I wonder how the EEPROM managed to send ACKs  or data (by pulling down SDA) when the LPC never released SDA (as it was not configured as open drain). In fact, I see no difference regarding SDA signal on the scope whether configured as open drain or not through Pins Tool.

SDA pin #38 (PIO8_18) NOT configured as open drain:

01 Standard Pins - no OD configuration (read EEPROM).png

SDA pin #38 configured as ppen drain (OD = 1):

02 Standard Pins - OD=1 configuration (read EEPROM).png

0 Kudos

868 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Anyway, both the SCL and SDA signal must be in open drain configuration, maybe after you configure the pins as I2C in IOCON register, the pins will be in open drain automatically.

BR

Xiangjun Rong

0 Kudos

859 Views
danielholala
Senior Contributor II

Dear Xiangjun,

 

Thanks. I configured pins, clocks and i2c interface using Peripherals Tool. If anything sets the pins to be open drain, it wasn't me.

I'm beginning to suspect that it is sufficient to configure the pin function as SDA using IOCON and that the OD bit has no relevance while a I2C function is enabled (see my other posting).

Best regards,
Daniel

0 Kudos