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.

Question about the "Arbitration lost" of I2C bus

Other Parts Discussed in Thread: AM3352

Hi, 

I have a question about the "Arbitration lost interrput" of I2C bus.

In the Technical Reference Manual of am335(SPRUH73J)

there is  the description of "Arbitration lost IRQ status" in page of 4252.

In this description ,I can see that "During reads, it always returns 0."

Is it correct??

I can not understand  if it always returns 0, how could Arbitration lost  intrrupt be detected whent it occurred?

Regards,

Yin

 

 

  • If the AL interrupt is enable in the I2C_IRQENABLE_SET register, an interrupt will be triggered.
  • Hi Biser,

    Thanks for your reply.

    I understand if the AL interrupt is enable in the I2C_IRQENABLE_SET register, an interrupt will be triggered.

    But If the AL bit in the I2C_IRQSTATUS_RAW  always returns 0,  in the interrupt's  isr ,how can I determine the kind of the interrupt(XRDY/RRDY/ARDY...etc.)?

    Regards,

    Yin

  • Yes, you are right, either this is an error in the TRM or if no other interrupt source is active in I2C_IRQSTATUS_RAW it's considered that AL has occurred.

  • Hi Biser 

    In our system, there are two am3352 board connected with I2C.

    And in our program, the two am3352s was both set in "master transmitter",  and them initiate a transfer on I2C bus simultaneously.

    But the arbitration lost interrupt was not detected, and the XRDY interrupt  was detected in both side. and then the one side's DOUNT does not  become 0.So the ARDY was not detected. I think the am3352s was both  in incorrect status.

    Can you teach me the correct procedure when I want to let the arbitration lost interrupt be detected?

    And when the arbitration lost interrupt be detected, what should be do in the isr ?

    Regards,

    Yin

     

     

  • I'm not sure but I think the Linux I2C driver does not support slave mode.

  • Hi Biser 

    We do not use the Linux. We use the driver in  AM335X_StarterWare_02_00_01_01,and we referred to the sample program "hsi2c_eeprom" in ti/AM335X_StarterWare_02_00_01_01/examples/ .

    And we want to test the function of I2C arbitration.

    So could you teach me if I want to let the arbitration lost interrupt be detected, which registers of the two am3352 should be set/cleared?

    And when the interrupt be detected, which registers shout be set/cleared?

    Regards,

    Yin

  • Yi Yin1 said:

    there is  the description of "Arbitration lost IRQ status" in page of 4252.

    In this description ,I can see that "During reads, it always returns 0."

    The TRM isn't wrong but merely made an unfortunate choice of words:  they meant to say "During receive".

    Arbitration loss is detected only in master transmit mode: when the master intends to transmit a 1 yet sees SDA low, it concludes that another master is active and aborts the transaction.

    During receive, there is no way for the master to tell the difference between the slave driving the bus versus another master doing so.  I'm not sure such a situation is even possible though unless one or more devices are very confused.

  • Hi Matthijs

    Thanks for reply.

    In my program of the two am3352s, I set them as below:

       Set as master transmitter (I2C_CON.MST=1, I2C_CON.TRX=1)

       Enable the AL interrupt (I2C_IRQENABLE_SET.AL_IE=1)

    And when the program run, the two am3352 are generate "Start Condition" simultaneously(I2C_IRQENABLE_SET.STT=1).

    In this condition, can the "Arbitration lost" occur and be detected?

    Regards,

    Yin

  • Hi 

    Now I know why was not  the  AL interrupt  detected.

    The timing of the two AM3352s  generating "Start Condition"  was not simultaneously.

    When the "AM3352 A" generate "Start Condition"(I2C_IRQENABLE_SET.STT=1), the "AM3352 B" has generated the "Start Condition already, so the "AM3352 A" could not  generate it successfully, and the I2C_IRQENABLE_SET.STT does not become  "0".

    Now my Question is that in this situation, what should be do? Should I reset the I2C module?

    I can not find any description about the step when the I2C_IRQENABLE_SET.STT does not become "0".

    Thanks!

    Yin