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.

TCA9555: read/modified write vs. implicit write question

Part Number: TCA9555

Team,

I have a customer using TCA9555 as part of an I2C LED controller application. They are only using Port0, and all the bits in that port are configured as outputs.  To turn on the LED’s the appropriate output bit is driven low to sink. The application is a PoE PSE controller, and the software is keeping track of port link status and lighting the LED’s on connected ports as required. 

They were able to get it working, but found that doing a read/modified write on the Output Port 0 register of the TCA9555 is very unreliable, and instead had to keep track of the link status in software and do an implicit write to the output Port 0 register. 

 

My question is, regarding the Output Portx registers,  should the read status of the output register reflect the actual port status? Is a read/modified write is a common practice with this device?

  • Hey Carolus,

    Can you get us an o-scope shot of their SCL and SDA lines during their "failed" read transaction? I am wondering if they are initiating a read correctly as doing a read actually requires a write and then a read.

    You can see from the figure above that the transaction should actually be the device address followed by a write. Then the register you want to read from. Then a repeated start or a stop and then start again with the device address and a read bit. After this the data sent from the device will be the register you specified earlier.

    "My question is, regarding the Output Portx registers,  should the read status of the output register reflect the actual port status?"

    Yes, the output port registers should be the last bytes of data that were placed in them right before the last stop condition.

    "Is a read/modified write is a common practice with this device?"

    I am unfamiliar with your terminology here. Are you asking if reading the register and then writing to it something most users do? (Expanding on what read/modified write implies would be most helpful for me to better understand the question)

    Thanks,

    -Bobby

  • Bobby,

    Thanks for the assist here. I have asked the customer to get us scope shots, and I'll follow up once I have them.

    According to the customer, what they meant by Read/modified write is "reading a register, modifying the particular bits of interest in software and writing the modified value back to the same register. " That’s the way they usually modify registers so other contents of the register is retained and only the parts they want to change get reflected in the write.
  • Hey Carolus,

    Thanks for the explanation on the read/modified write.

    "Is a read/modified write is a common practice with this device?"
    -Typically when used as an output people do not perform reads but doing so should not affect the performance of our device as it seems like it is in this case. In my experience, when we see an issue like this it is usually related to code and not the device itself.

    An added request here, are you able to post a schematic of the TCA9555. It may be a good idea to confirm if the device is properly set up. (Schematic should show voltages, pull up resistors, and what is being connected to the port pins.)

    Thanks,
    -Bobby
  • Hi Carolus,

    I wanted to check back in on this one - was the customer able to take a look at the SDA/SCL waveforms when this issue occurs as Bobby had mentioned?

    Regards,
    Max
  • Hey Max,

    I checked back in, and the customer is still off fighting other issues. I'm going to suggest we go ahead and close this thread with the comments given, and I can post a new thread referencing this one when they get back to this issue. Thanks for the support!

    Carolus