i2c problems with an I/O expander

Hello folks!

I’m experiencing some problems with an i2c I/O expander. I’m trying to use an Uno to control the device but somehow it won’t work.

The device, TCA9554

I’ve set the Adress to 111. Which means that the controll code + adress is equal to 3F.

So when i try to use it as an output expander I’m not able to control the outputs. That is, the outputs are high no matter what I send to it.

I know that connection is established since if I change the adress I do get NACK instead of ACK. Pics from my logic analyzer to proove it. Same sequence but different adresses. Correct adress gives ACK.

Start - send adress + r/w = 0, 3F << 1 = 7E - send CMD to use output ports, 0x01 - Stop

Arduino code

#include <Wire.h>
#define exp_address 0x3F 

void setup()
{
  Wire.begin(); // join i2c bus (address optional for master)
}

void expander()
{
  Wire.beginTransmission(exp_address); //Choose expander
 
  Wire.write(byte(0x01)); // Output ports
  Wire.write(byte(0x00)); // Send Data 8 bits, first 4 bits to switch on the switches 0 = ON

  Wire.endTransmission();     // stop transmitting
 
  delay(500);
}

void loop()
{
  expander();
}

I suppose I’ve missed something important. But it’s friday… :slight_smile:

Any help is appreciated!