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.

TCAL9539: I2C Code

Part Number: TCAL9539

The customer is testing TCAL9539. It seem whatever they write to TCAL9539, it always read back 0xFF.

Please help confirm whether the content written to TCAL9539RTWR I2C is correct?
In addition, can you provide other similar i2C content for our reference? 

Or the code to help customer verify the function?

  • Hi Fabio,

    We do not have source code available for our devices at the moment. What exactly is the customer attempting to do with the TCAL9539? 

    The customer needs to first set the pointer in the device correctly before writing / reading from the internal register. For example, 

    This is an Arduino script that simplifies my statement. First write the device address, write 0x02 = output port register (this sets the internal I2C state machine to point to the output port register for reading and writing data to the register), then write 0x00 and 0x00 to port 0 and port 1. Send I2C stop condition. 

    The code above successfully sets all p-port configured as outputs to logic low state. 

    The examples in figure 8-9 and figure 8-10 of the datasheet are the bit combinations needed to write and read from the TCAL9539. \

    Write condition (example is writing to polarity inversion registers)

    Read condition

    Regards,

    Tyler