Hi!
I have a problem with these port expanders.
I set up a system where I have 4 PCA9538 chips on the same I2C bus,
each having their own addresses and all pins are configured as outputs.
Two PCA's are used to drive the bases of NPN transistors for relays.
The other two are used to drive LED's on a separate indicator panel that
is used to indicate which relays are turned on.
Program first configures all pins of all chips to outputs, writes 0x00 to all
configuration registers and 0x00 to all polarity registers.
The input registers of the PCA9539's driving the relays are read back and
used by the indicators. Now the problem that I'm having is that most of the time
the pins of the PCA9539 driving the relays wont change and stay at 0.
The I2C signal shows that the the data is written to the output registers and
the same data is also read back from the input registers but the pins themself
wont change. The indicator panel works correctly and the outputs reflect the state
that the relay driver should be.
Sometimes they work if I just write the output registers to 0xFF but not always,
if I create a loop where all outputs are toggled 1/0 with a period of 1s and if
it works right after reset then it dies after few periods.
I2C interface is configured to be 100kHz and the VCC is 3.3V.
The current drawn from single pin is less than 5ma and the NPN transistors
are capable to operate the relays with the provided base current.
What can cause this?
With best regards,
Marek