Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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

Status
Not open for further replies.

jani12

Advanced Member level 4
Joined
Oct 30, 2014
Messages
108
Helped
0
Reputation
0
Reaction score
1
Trophy points
1,298
Activity points
2,536
NXP LPC11E68JBD48E Microcontroller I2C1 is Master. I2C1 is in Master Transmitter Mode.
I2C1 peripheral is in chapter 13. https://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);
lpc11e68_Master_reads_from_pcal6416_.PNG
lpc11e68_Master_reads_from_pcal6416_.PNG
 

Attachments

  • lpc11e68_Master_reads_from_pcal6416_slave_port0_good.PNG
    lpc11e68_Master_reads_from_pcal6416_slave_port0_good.PNG
    8.4 KB · Views: 76
  • lpc11e68_Master_reads_from_pcal6416_slave_port0_Not_Good.PNG
    lpc11e68_Master_reads_from_pcal6416_slave_port0_Not_Good.PNG
    9.4 KB · Views: 81

To troubleshoot I2C communications, without headaches or confusion, you require either a logic analyzer or a scope with integrated decoding. I2C is such an ubiquitous standard that even the lowest cost analyzers will include it on their decoding protocols.
 

>> you require either a logic analyzer or a scope
I posted scope screenshots in my original post
 

you require either a logic analyzer or a scope with integrated decoding
You forgot bolded part!

BTW I2C master usually has open drain output, so with pullup resistors I2C bus is idling HIGH (by voltage), and it represents logic ZERO. Accordingly, when pin is pulled LOW (by voltage) it represents logic ONE.
 

There 's no answer clear based on the given information.

You should not see a low bit if 1. the port pin is actually floating high, you 2. did not configure additional registers that might change the behaviour, e.g. polarity inversion and 3. the chip hasn't been damaged.

Unfortunately we can check none of the three conditions. You have reported cases of mysterious IC behaviour before which turned out as ordinary circuit failure, if I remember right. You can't do anything but thorough cross checking.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top