TI E2E Community
I2C port expander PCA9539 problem
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,
I managed to get this setup working by re-writing config registers every time I operate the chip.
This approach is still analogous to a dental procedure performed through another part of the body
that shall be unnamed here, but it hints that the config registers get corrupted either through incorrect
I2C operation or through glitches in VCC that might cause the device to reset. I have not yet found any
VCC glitches but I keep looking.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.