Why logic High input is logic low on I2C data bus?

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

Why logic High input is logic low on I2C data bus?

Jump to solution
1,626 Views
anaseem
Contributor IV
NXP LPC11E68JBD48E Microcontroller I2C1 is Master.   I2C1 is in Master Transmitter Mode.
I2C1 peripheral is in chapter 13.  http://www.mouser.com/ds/2/302/UM10732-315822.pdf

NXP PCAL6416A I2C 16-bit I/O Expander is Slave. https://www.nxp.com/docs/en/data-sheet/PCAL6416A.pdf.
Master reads one byte from slave port 0.  On one board all Eight bits are logic 1's as expected.  On the other board Seven bits are logic 1's as expected
but bit 2 is logic 0.  The input pin connected to bit 2 is pulled up to 3.3V but it's logic 0 on I2C data bus.  Why?
                              D7 D6 D5 D4 D3 D2 D1 D0
Expected              1    1    1    1    1    1   1    1
One board           1    1    1    1    1    1   1    1
Another board    1    1    1    1    1    0   1    1
Explanation/Questions on attached scope screenshots:  Master sends slave address 0100 001(A6-A0), followed by write bit(logic 0).  Slave responds with ACK(logic 0).
Then, master send command byte 0x00(read byte from Input port 0).
Master sends start bit, followed by slave address, followed by read bit(logic 1).  Slave sends ACK.
On one board, slave send 0xFF as expected.  On other board, slave sends 0xFB, not expected. Master follow with a NAK.  Slave pulls data bus low before the stop
condition?  Why slave pulls data bus low?
The primary question is why is bit 2 logic 0 on the I2C bus when it's pulled up to 3.3V ?
Are we setting the I2C device properly?
INT pin(active low) is floating.
/* Enable selection of Pull Up / Pull Down on unused inputs */
    b = mIOExtender.PuPdEnablePort0(0x02);
    b = mIOExtender.PuPdEnablePort1(0x70);
/* Pull up unused inputs */
    b = mIOExtender.PuPdSelectPort0(0xFF);
    b = mIOExtender.PuPdSelectPort1(0xFF);
Labels (2)
1 Solution
1,505 Views
soledad
NXP Employee
NXP Employee

Hi, 

In my opinion this is a harward issue, please add pull-up external resistors and check the signals with an oscilloscope.

Regards 

Soledad

View solution in original post

4 Replies
1,504 Views
soledad
NXP Employee
NXP Employee

Hi, 

Are you using an NXP board?

Could you please share the connections you are using? 

Are you using external pull-up resistors?

Are you using LPCOpen?

Regards

Soledad

0 Kudos
Reply
1,504 Views
anaseem
Contributor IV

This code base has XPRESSO_BOARD compile time flags.  So, previously we were probably using NXP board.

Connections.  connections.jpg

No, we're not using external pull-up resistors on I2C port.  But we're using internal pull-up resistors.  Please review my settings of enabling and pulling up unused inputs on I2C port.

/* Enable selection of Pull Up / Pull Down on unused inputs */
b = mIOExtender.PuPdEnablePort0(0x02);
b = mIOExtender.PuPdEnablePort1(0x70);


/* Pull up unused inputs */
b = mIOExtender.PuPdSelectPort0(0xFF);
b = mIOExtender.PuPdSelectPort1(0xFF);

Yes, we're using LPCOpen because __USE_LPCOPEN is defined in our projects.

Regards,

Amer

0 Kudos
Reply
1,504 Views
anaseem
Contributor IV

Please note Port 0 bit 2 is correct value on SDA bus on One board but incorrect on different board.

0 Kudos
Reply
1,506 Views
soledad
NXP Employee
NXP Employee

Hi, 

In my opinion this is a harward issue, please add pull-up external resistors and check the signals with an oscilloscope.

Regards 

Soledad