I2C Comms

I'm trying to connect an I2C 16x2 display (PCF8574T) to a nucleo-L476RG


Circuit Diagram

Code i'm trying to run

I2C Scannr Code

Output of printf

RUN 0x0 ACK 0x1 ACK 0x2 ACK 0x3 ACK 0x4 ACK 0x5 ACK 0x6 ACK 0x7 ACK ... Continues for all addresses 0x7f ACK


This is what I would expect the board to do when nothing is connected to the SDA / SCL pins, the same response happens each time with or without LCD and with or without the external 2K2 pullup resistors, why is every address coming back as ACK?



  • 1
    \$\begingroup\$ What are the waveforms you see at the pins with an oscilloscope? \$\endgroup\$ – CL. Mar 9 '17 at 9:38
  • \$\begingroup\$ Scop on either SDA or SCL pins just shows constant 3v3, perhpas the pinout isnt correct then for the I2C_SDA or I2C_SCL pins \$\endgroup\$ – theguitarfreq Mar 9 '17 at 9:43
  • \$\begingroup\$ What are your expectations? You have a loop where you start(), write(shift left i by 1), print to PC(ACK i), stop(). What other result can your program produce, than that you got? \$\endgroup\$ – Marko Buršič Mar 9 '17 at 9:51
  • \$\begingroup\$ The write is in and if block - only on successful transaction will the printf write to the serial port. Therefore my expectation is that i should only get an ACK to connected devices \$\endgroup\$ – theguitarfreq Mar 9 '17 at 10:01

The GND pins of the two devices are not connected together, so there is no common reference for voltage levels.

When running at 5 V, the PCF8574T requires high-level signals of at least 3.5 V, so the pullups to 3.3 V result in signals that are outside the allowed range.

  • \$\begingroup\$ I should have made clear, the 5V and the GND connection of the LCD I2C chip are connected to the Nucleo board \$\endgroup\$ – theguitarfreq Mar 9 '17 at 9:40
  • \$\begingroup\$ That makes sense but even still, without the LCD connected, pulling up to 3v3 should mean that i get nothing on the serial monitor? \$\endgroup\$ – theguitarfreq Mar 9 '17 at 9:40
  • \$\begingroup\$ I have added a logic level converter to no avail. so still not sure why this is happening \$\endgroup\$ – theguitarfreq Mar 9 '17 at 11:23
  • 1
    \$\begingroup\$ Many normal level shifters do not work with I²C. And this is not a forum; if you have more correct or additional information, edit the question. \$\endgroup\$ – CL. Mar 9 '17 at 11:41
  • 1
    \$\begingroup\$ Please read How do I ask a good question?. We can help you only if you provide enough information about your circuit, and all details are important. Leaving incorrect information in the question makes it not helpful for anybody who finds it through Google. \$\endgroup\$ – CL. Mar 9 '17 at 12:42

Solution was to use a 3v3 LCD module with the PCF board, No logic converter and with 2k2 pullups

Also used code taken from here: https://developer.mbed.org/users/martinsimpson/code/ic2_test_bus/file/2db41a0c2f17/main.cpp

  • \$\begingroup\$ I think CL answered your question. You should give him credit. \$\endgroup\$ – Sean Houlihane Mar 30 '17 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.