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.

TCA9534A: the communication flow

Part Number: TCA9534A

Dear all,

I would like to communication like attached file.

comunication flow.pdf

Are there somwthing wrong to communicate?

If you need some condition to check, please inform us what is not enough.

Best regards,

  • Hello Takao-san,

    Just to clarify I understand everything. I'm a little confused on the flow char of what you are ultimately trying to do/accomplish.

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    From the first half of the pdf you sent:

    1) You write to the configuration register

    example 1: you write 0xFF meaning you set all the ports as inputs

    example 2: you write 0x00 meaning you set all the ports as outputs

    I assume from the following steps, you have set them to inputs so example 1 is what you used.

    2) I see an arrow going from the Lon chip to the IO expander, are you sending the address you want to read from?

    example 3:

    You send the slave address with the R/W' bit set to read.

    You send the register address 0x00 (input port)

    You get an ACK from the device and then you receive a byte of data from the IO expander to the Lon chip

    You repeat the read process multiple times

    Is this correct?

    If so, this process works.

    Also after setting the configuration register, it will not change so you will not have to access it again. You are correct about this.

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Your second half seems more straight forward.

    1) You set the output ports in register 0x01 to either high or low

    If the configuration is set to inputs, you will not see a change

    2) You change the configuration register to be all outputs

    example 4: you write 0x00 meaning you set all the ports as outputs

     This will set the outputs to what you set in step 1 here

    3) You write to the output register and change the outputs

    4) you repeat this process

    Once again, after setting the configuration register, it will not change so you will not have to access it again. You are correct about this.

    If my understanding of what you are doing is correct then I don't see any issues with this process.

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Thanks,

    -Bobby

  • Hello Bobby-san,

    Thank you for your support and sorry for my late response.

    I need to apologize about myh PDF file.

    This file lost some words through converting PDF file...

    I attached new PDF file.

    4857.comunication flow.pdf

    >first half of PDF

    2) I see an arrow going from the Lon chip to the IO expander, are you sending the address you want to read from?

    ---> Yes, I want to check whether the write command is sent correctly.

    Are there other concerning?

    Best regards,

  • Hey Takao-san,

    "--->Yes, I want to check whether the write command is sent correctly."
    If you are writing to a register, you should receive an ACK from the device to let you know the write went through. You can read what you wrote, after you release the lines and re-initiate the communication to double check, that is not a problem.

    My understanding was you were sending the slave address then reading the input port to see if anything changed.

    Example: you scan every 5 seconds to see if someone pressed a button. If the input port goes low (previously held high), the mcu sees it and performs an action.
    ^This case is also fine, no issues.

    Your programming/code flow seems fine.

    EDIT: Your first setup has you input 0xFF in the Configuration register which works. Just to let you know though, upon reset/start up the device is already set up as inputs and you don't have to rite 0xFF unless previously you wrote something else to it. This could save you a step so you can skip it if your just power up/reset your device.


    Thanks,
    -Bobby