I2C Scan hangs at endTransmission

I am a relative newbie with tons of electronic experience but not so much programming. So I am working with an Arduino Uno R3 in Win 7 Pro using the Arduino IDE ver 1.6.3.

The idea was to use the PCF8574N to control a 16x2 LCD: (P0 to RS, P1 to RW, P2 to en, P4 to d4, P5 to d5, P6 to d6, P7 to d7.) But I cant even get that far. I was wanting to scan the PCF8574 to verify the address, I THINK it is 0x40 (0100 000), but none of the assorted versions of I2C scanners work. Inserting code to turn the Uno R3 onboard led on just before endTransmission works fine but turning off immediately after never happens. None of the connecting wires are over 7cm long, power and ground are good at 5.0vdc and 4.7k pullups are on the SDA and SCL lines.

I have downloaded Mr. Gammons I2C_Rev5.zip library and am trying to use it in his I2CScanDevices.ino which looked promising but having no luck. My newbie attempts to substitute the I2C_Rev5 functions for the Wire functions is apparently over my head and after 14 hours reading, experimenting, rewiring, replacing parts, etc I am no closer to scanning the I2C address of my PCF8574N set up with all address lines pulled low than when I started. I have even disconnected all lines to the PCF device except for power, ground SDA and SCL but no change, every scan.ino I run hangs at the same place.

Any ideas or perhaps a scanner sketch that has the I2C_Rev5 restart functions in it? Thank you for your time.

If it is an I2C device, and the I2c_scanner sketch does not work, then the most likely problem is an electrical problem with the connection.

I2C works by having the clock and data signal lines connected to the power supply ( 3.3 or 5 volts ), with 2 resistors, and the master and slave communicate by pulling the lines low. The performance of this arrangement can be quite sensitive to the resistance value used, and also the length of the wires.

I am starting to think it may be something like that. With only 4 wires at play it must be an impedance issue which is scary for a potential production design.

The datasheet suggests 10k pullup resistors on SCL and SDA. Try that instead.

adwsail: P0 to RS, P1 to RW

If you are referring to Arduino Pin-0 and Pin-1: These are the RX/TX pins for Serial, so if you should decide to use pin-0 and pin-1 for something else, you are NOT ALLOWED TO USE SERIAL in any way when doing so!

Besides of that you will get strange effects during startup, as the Arduino bootloader is using Serial while resetting the Arduino. So if you want to use pin-0 and pin-1 on an Arduino board: - remove the bootloader from the Arduino board - upload your sketches by using an ISP-programmer connected to the ISP programming connector - and DO NOT USE SERIAL

Otherwise: Do not use pin-0 and pin-1 for anything else than Serial in your circuit!

You also need to connect each of the A pins of the device to either 5V or ground, and modify your I2C address to correspond to that.

I think he is refering to the connections between the chip and the display device, not pins 0 and 1 on the arduino.

Correct, LCD and PCF8574 pins, NOT Arduino. Got it working now. I put variable 10k trim pots on the SDA and SCL lines along with a .01uF cap to gnd. It works very well at 115,200 and 8.2k - 9.3k on the pots. Thanks guys.