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.

TCA6416A: Output pin is not sending the desired value

Part Number: TCA6416A

Dear Ladies and Gentlemen,

currently I am working with the i2c I/O Expander TCA6416A and I want to configure port 12 as an output which is sending a logical 1.

The device address is configured as 0x20. The following command byte is set to 0x03 according to the device data sheet. The following data byte is set to 0xFF to set all outputs high for testing reasons.

 I can see with my logic analyzer that the data is transmitted successfully, but on the output port 12 is still a logical 0. 

Can you please help me and tell me what I did wrong?

Best regards

Felix

  • 0xFF is the default value of register 3.

    Please read back all eight register values.

  • Hello Mr. Ladisch,

    thank you for your answer! I have read back all registers and the results are according to the datasheet. The register value is set to the according values. 

    The output is still not set to 1. I attached a snapshot from my logic analyzer. Channel 2 is observing the behaviour of the output of port 12.

    Can you see my error?

    Best regards

    Felix

  • What are the values?

    By default, all pins are inputs, and the bits in the output register have no effect.

  • Felix,

    You need to write to the configuration registers first (0x06 and 0x07) to set the GPIOs to be either an output or an input (input by default). Afterwards you can write to the output registers (0x02h and 0x03h) to toggle the outputs (which you set to be an output in registers 0x06 and 0x07) to be high or low.

    Have you done the steps above correctly? the scopeshots you show only provide the register values for output register 0x03h. It does not show the register values for 0x07h which would be required to be set to 0x00h to make all port 1 pins an output. 

    -Bobby

  • Hi Bobby,

    thank you for your answer!

    This solved my issue. I didn't set the according configuration register to 0.

    Thank you very much again and have a nice day!

    Best regards

    Felix