Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. 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

Member
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);
 

Attachments

  • lpc11e68_Master_reads_from_pcal6416_slave_port0_good.PNG
    lpc11e68_Master_reads_from_pcal6416_slave_port0_good.PNG
    8.4 KB · Views: 195
  • lpc11e68_Master_reads_from_pcal6416_slave_port0_Not_Good.PNG
    lpc11e68_Master_reads_from_pcal6416_slave_port0_Not_Good.PNG
    9.4 KB · Views: 190
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top