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.

RTOS/F28M36P63C2: I2C Arbitration lost issue with F28M36P63C2

Part Number: F28M36P63C2

Tool/software: TI-RTOS

Dear TI

I connect TCA9546APWR(slave) and two battery(slave) by I2C.

TCA9546APWR: one channel change  to two channel.

BATTERY:read the quantity of electricity.

and when we connect and disconnect the battery ,It's randomly happened arbitration lost (I guess so...)

I dumped the I2CMCS register , it is 0x7A

It means bus busy, IDLE,  lost arbitration, data not acknowledged .

I have tried following methods, but none of these worked

1. I2C_close then I2C_init

2. set I2CMICR to clear interrupt flag

My questions are:

1. Am I Facing a arbitration Issue?

2. Is there a way to recover from this with out IC reset?

Thank you very much!

Have a nice day!

  • Hi,

    user5905559 said:
    and when we connect and disconnect the battery ,It's randomly happened arbitration lost (I guess so...)

    Please explain the battery connect and disconnect process to me. Is it being disconnected over I2C commands, or is it physically being disconnected?

    user5905559 said:
    1. Am I Facing a arbitration Issue?

    I2CMCS 0x7A also includes the "ERROR" bit. It wouldn't be an"Arbitration Lost" condition since there is only one master on the bus, i.e. Arbitration Lost occurs when there are multiple masters.

    user5905559 said:
    2. Is there a way to recover from this with out IC reset?

    The error on the bus needs to be understood better before coming up with a way to recover. Can you probe the I2C SDA/SCL pins with an oscilloscope or logic analyzer to see what is happening on the bus. Capture waveforms when the issue is occurring and provide them on here.

    Best,

    Kevin

  • Hi

    There are two I2C physical interface for battery, Connect and disconnect means operate the physical interfa

    I probe the I2C SDA/SCL pins with an oscilloscope(Connect and disconnect teset), There has two condition of I2C.

    Green and yellow: TCA9546APWR  I2C channal 0

    purple and blue:TCA9546APWR  I2C channal 1

    1. when i disconnect the I2C1, It is randomly happened All the SCL and SDA will be pulled down by circuit noise( I guess so...), I2CMCS is 0x7A. In this condition, The I2C can not be recover.  

    2. After M3 send the command,I think the slave need relay the data, but then I disconnect the battery , then SCL alway low.I2CMCS is 0X40.

    I think there has some problem on I2C bus, But After error occured , The I2C of F28M36 can not be recover from error state.

    what do you think?

    Thank you very much!

     
     
          SCL0    
        SCL          
              SDA0    
              SCL1    
        SDA          
              SDA1    
                   
  • Hi,

    These waveform screenshots for channel 0 and 1 are the I2C interfaces between the batteries and TCA9546APWR, correct? If the issue is along this this interface then you should probably post a question on the forum that corresponds to the TCA9546APWR device. The TI experts on the below forum will be able to speak to that device better.

    e2e.ti.com/.../138

    Is there an issue along the F28M36P63C2 and TCA9546APWR I2C interface? Have you probed this interface to see what's going on?

    Best,
    Kevin
  • Hi

    Is there an issue along the F28M36P63C2 and TCA9546APWR I2C interface?

    -->Yes,there has the same issue,And waveform screenshots is same when issue occured.

    -->TCA9546APWR is 1-of-4 Bidirectional Translating Switches, We can change the channal by I2C command.

    And we try to reset  the TCA9546APWR(GPIO control the reset pin) when issue occured, Then SDA and SCL will change to  high.

    But F28M36P63C2 also don't send the command, Maybe I2CMCS register is error state(I guess).

    So i want to a way to recover from this state.

    Thank you very much!

    Have a nice day!

  • Hi,

    Which of the waveforms provided is what the F28M36P63C2 and TCA9546APWR I2C interface looks like when the issue occurs? This isn't clear to me.

    If you reset the TCA9546APWR and that causes the F28M36P63C2 to get into a confused state you should likely reset the I2C module on the F28M36P63C2 . You can try disabling and re-enabling the I2C master bit, i.e. set I2CMR.bit.MFE to 0 and then 1. You should integrate proper error handling for this situation.

    Best,
    Kevin
  • Hi,

    Which of the waveforms provided is what the F28M36P63C2 and TCA9546APWR I2C interface looks like when the issue occurs? This isn't clear to me.

    -->The waveforms like below when issue occured, It is same with the Battery and TCA9546APWR I2C interface

    I try to re-enabling the I2C master bit when the issue occured,But I2C master aslo don't send the single, After re-enabling the master ,the I2CMCS register don't changed (0x7A)

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

     I2CMasterDisable(I2C0_MASTER_BASE);
     Task_sleep(10);
     I2CMasterEnable(I2C0_MASTER_BASE);

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

    Thank you very much!

    Have a nice day!

  • Hi,

    Hmmm, ok. Can you try setting I2CMCS.bit.RUN to 0 and then 1?

    Maybe that (along with setting I2CMCR.bit.MFE) will reset the I2C module.

    Best,
    Kevin
  • Hi

    I try to seting the the MFE bit longer(10s), But the I2CMCS register also don't changed (0x7A).

    And i change the GPIODEN register, then setting the MFE again, the I2CMCS will be changed,and I2C will send the single again.

    I don't konw whether has other side effect, And i need test more. whah't do you think?

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

    HWREG(GPIO_PORTP_BASE + GPIO_O_DEN) &= (~0x0C);

    HWREG(GPIO_PORTP_BASE + GPIO_O_DEN) |= 0x0C;

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

    Thank you very much!

  • Hi,

    I believe resetting the I2C using the module registers would be a better solution than resetting the GPIO Digital Enable bit. But that along with re-configuring the I2C module may work too.

    Have you tried writing to the I2CMCS register like I previously stated? There's a block diagram that says to write b100 (i.e. 0x4) to I2CMCS when an error is received:

    This is effectively setting the STOP bit to 1, START to 0, and RUN bit to 0:

    Best,

    Kevin

  • Hi

    But that along with re-configuring the I2C module may work too.

    --> I try to setting the the MFE bit longer(10s), But the I2C module don't work too.

    Have you tried writing to the I2CMCS register like I previously stated? There's a block diagram that says to write b100 (i.e. 0x4) to I2CMCS when an error is received:

    -->yes, I  write b100 (i.e. 0x4) to I2CMCS when an error is received , but I2CMCS register don't chaned, I2C also don't work.

    -->  I2CMasterControl(I2C0_MASTER_BASE, I2C_MASTER_CMD_BURST_SEND_ERROR_STOP);



     

     

  • Hi,

    When you write b100 (i.e. 0x4) to I2CMCS the register values don't change and nothing changes on the I2C bus? In the waveforms you provided some of the I2C signals are being held low, do they not return to the high state?

    user5905559 said:

    And i change the GPIODEN register, then setting the MFE again, the I2CMCS will be changed,and I2C will send the single again.

    What happens on the bus after writing to the GPIODEN register? Can you provide waveform screenshots of this? When you perform this sequence youre seeing all I2C registers go to their reset state?

    Best,

    Kevin

  • Hi,

    Have you already posted a question to the TCA9546APWR forum? e2e.ti.com/.../138

    They may have a better understanding of how resetting the TCA9546APWR device affects the I2C bus.

    Best,
    Kevin