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.

TCAL6416R: TCAL6416R GPIO default output setting questions

Part Number: TCAL6416R

Hello Expert:

 We would like use TCAL6416R as 17 GPIO expander.

can you teach us how to set exapmle to all output as pull low (P00-P17) status by default? 

thank you 

Roy

 

  • Hello Roy,

    To keep the example code simple, I will not include the target address and auto-increment.

    I will be using the following I2C word format:

    At start-up, all I/O ports will be in a Hi-Z state. To output a logic low, you will need:

    • 1) Send all zeros to the Configuration 0/1 registers
    • 2) Send all zeros to the Output Port 0/1 registers

    The following code will force Port 0 to output logic low

    0x06 00
    // 0x06 is the Configuration 0 register address while 0x00 is the data we write to the register. Writing data 0x00 changes Port 0 from an input to an output (this applies to all I/Os under Port 0)

    0x02 00
    // 0x02 is the Output Port 0 register address while 0x00 is the data we write to the register. Writing data 0x00 forces Port 0 to output a logic low (this applies to all I/Os under Port 0)

    If you want to accomplish the same thing for Port 1, you need the following code:

    0x07 00
    0x03 00

    Regards,

    Josh