This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PCa9557 I2C using

Other Parts Discussed in Thread: PCA9557, TCA9534, PCF8575

I am still not sure how to use the PCA9557. Seven of the PCA 9557 chips I use are for output only (writing), and one is for input only (reading). Can each chip be configured one time at startup for which register will be accessed from normal SMBus transactions (2 byte) from that point on?

 In reading the data sheet, it looks like each output requires 3 bytes (address, register, data), instead of the normal 2 (address, data). Instead, can the output chips be configured for output (address, config, 0) and then just use a 2 byte message (address, data).

 For the chip I will be reading from, it looks like 4 bytes are required to read a byte of data. Can I configure it to use the Input Data register one time at startup (address, config, 1), and from then on just use the normal 2 byte transaction?

 This chip is nightmare to use in an interrupt driven system if all the bytes detailed in the data sheet need to be sent just for a one byte transaction. Is there any way to make it conform to the normal I2C interface (2 bytes / transaction) by a one time setup before use.

  • Hello Bob!

    Thanks for the question.

    First off, is there a reason you're looking at the PCA9557 over our more recent IO expanders? Our newest IO expanders feature 'TCA' prefixes instead of PCA. They add lower-voltage support and the power on errata bug fix.

    Worth noting on the PCA9557, the P0 port is open-drain only. This means P0 can only pull-down or release the pin.

    If you would like a comparable device with all 8 ports offering push-pull, then the TCA9534 would be the best cross for this part.

    Now, regardless of which device you choose, the following answers your questions will be the same:

    1) Can each chip be configured one time at startup for which register will be access from normal SMBus transactions (2 byte) from that point on?

    - No. These IO expanders will require the new standard I2C address, Register Address, Data format for all writes and I2C address, REgister Address, Repeated start with address, Read data, for reading.

    2) It looks like each output requires 3 bytes instead of the normal two. Can output chips be configured for output and then just use a 2 byte message?

    - No. This 2 byte standard became more-or-less superseded with this newer 3 byte style of writing. The reason for this is, the newer IO expanders offer more features than the old style, giving you the ability to independently configure each port as an input or output. Some even allow you to turn on and off pull-up resistors by writing to a register. These additional features require that you explicitly tell the device which register you're writing to.

    3)For reading data, can I configure it to use the input data register one time at start up, and then just use normal 2 byte ttransaction?

    - Yes and no. This is because of the same reason above. Per the newer I2C format for more advanced devices, you must first tell the device which register you want to read from, then you perform a read address.

    However, you can partially do what you want to do if you are going to be ONLY reading from a device. The device will remember the last register accessed, and will always go to that register until told otherwise. So you can write the INPUT register address to the device (the 4 byte read format you saw in the datasheet), then every read you perform to that device afterwards will read from the input register. Note that this will work on IO expanders which do NOT have the auto-incrementing feature. The auto-increment feature will automatically advance the register by 1 so that you can continuously read bytes of data, and the register will automatically increase. Not all devices feature this.

    4) Is there any way to make it conform to the normal I2C interface by a one time setup before use

    - Again,  no. This is because these IO expanders are more complicated than the traditional IO expanders, which require that multiple registers be used to specify device operation. This is considered the standard I2C format for more advanced slave devices, as opposed to simple sensors or single-function IO expanders.

  • Do you know of any simple IO Exoanders in the SOIC-16 or gull wing packages that wil run on 5V? I have 8 devices in my system, one is only for reading, and the other 7 are only for writing. I really don't need all the fancy features of the more modern devices.

    I have a single PCA9557 running and I can write to it without problems. When I try to read, I can send the first 2 bytes and get an ACK for each. When I write the 3rd byte (with READ set), I do not get an ACK. Looking with a scope ithe SCL and SDA lines appear correct per your datasheet. Any clue as to why I don't get an ACK after the 3rd byte?

     Thanks for answering my questions.

    Bob Mntgomery

  • If you are OK with a weak IOH rating (100 uA high output current rating max), you may want to look into some of our PCF io expanders.

    PCF8575 is an example of such a part. The PCF family comes from another group within Texas Instruments, but this is the correct location to get help with the PCF family if you require it.

    In general, the PCF family is our basic I2C IO expander which sets output mode based on whether you read or write, and does not have any registers. It should do what you're asking (device address then data, with no registers required).