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.

TCA9535: Understanding restart conditions and auto-increment in IO Expanders

Part Number: TCA9535

  • 1)      A restart is just a reinitiated start condition before a stop condition. If a stop condition is initiated, another master could take control of the bus before the entire transaction is completed.

    A quick example of this may be if you were writing to an IO expander and you send the slave address then write (whether they are high or low) to the output registers. You would need to use a restart condition to keep control of the bus to write to the configuration registers to set the ports to an output (default is usually input). If you did a stop condition between this transaction,  if there was another master on the bus then the new master would take control and the previous device you were trying to configure would stay an input when you wanted to set it to an output.

    Every start condition must have a stop condition but you can have multiple start (restart) conditions in between.

    Last thing to note is a restart is not the same as a stop then quick start condition, the example above should illustrate why.

    This is not unique to our device and is specified in the I2C standard. (section 3.1.10 )

    More can be found here if what I said does not make sense:

    http://dlnware.com/dll/Repeated-START-Sr-Condition

    https://www.i2c-bus.org/repeated-start-condition/

    2)      This refers to an auto increment logic that occurs during a register read or write. The registers are set up in pairs, such as: Input port, output port, polarity inversion, and configuration. When a register is read/written to the pointer will increment to the next register in the pair. This has its benefits as it can decrease the amount of transactions in the case where two register pairs need to be read or written to.

    a) An example for this would be if you wanted to set the configuration ports to be outputs. You send the slave address, the register you wish to write to (configure register 0) and the data you wish to write in this register. If you do not initiate a stop condition you can send an additional byte of information and write to the next register in the particular pair (configuration register 1 in this case). In total this transaction required 4 bytes

    b) An alternative way to do this would be to initiate the stop condition after the byte of data into the register. You would then need to resend the slave address, the register you wish to write to (configure register 1 this time) and the data you wish to write in this register. With this transaction and the previous transaction there was a total of 6 bytes sent to write to both configuration registers.

    From the examples above, you can see why this can be useful as it is more efficient.

    3)      This refers to a restart after a byte of data is written/read and another start condition is done again.

    Simply: start->typical communication->restart->byte received/written->restart (this is a subsequent restart)

    This is for whatever reason you decided to do another start condition, the pointer may change if the amount of reads/writes of data is odd then the pointer is now referencing a different register than originally.

    When a slave address is the same as before the restart condition and the read/write bits are not changed, the restart typically will write/read from the same register but this is not the case for this device as it may change registers. In this case, it would be best to send a stop condition and start condition if you wish to address the original register (if the amount of data bytes read/written to was odd).

    4)      This is when the data from the ports are collected. This occurs during the rise of the ACK on SDA. This is all done internally inside our device and the user does not need to do anything. This is more of understanding the timing of when data is polled.

    INT is reset at 70%xVcc of SCL during transactions and has a delay before it is reset which can be a maximum of 4 us. This is separate from the “read port0” timing.

    5)      Yes, you can start (read or write) with either. Keep in mind if you start with input port1 then the pointer will move to input port0 after a read/write.

    -Bobby