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.

MSP430G2553: About Clock Stretching behavior

Guru 10235 points

Part Number: MSP430G2553

Hello, TI Experts,

 

Our customer sent us a questions about I2C behavior of MSP430G2553.

- MSP430G2553 act as Slave.

- They rarely observed Clock Stretching behavior after MSP430G2553 recieved Slave Address of Read access from Master Device.

- They plan to analyze the related Register values including UCBxTXBUF based on the UserGuide(SLAU144J) "17.3.4.1.1 I2C Slave Transmitter Mode".

Question:

- Are there any other reason/condition about this Clock Stretching behavior occurred?

 

If we should consider the any other point for analyzing this Clock Stretching behavior, please tell us.

 

Best regards,

  • Hi,

    I'm not quite sure if I understand the question correctly.

    "When the master addresses the slave, the slave holds SCL low until it is ready. During this time, the I2C bus is stalled. Once the slave is ready, it will ack the slave request and transfer will continue" source: e2e.ti.com/.../198590

    Can you please elaborate on the question?

    Best regards,
    Andre
  • Hello,

     

    Thank you for your prompt reply.

    I really appreciate your help.

    I'm sorry for lacking of information. 

    They thought Clock stretching is unexpected behavior.

    So they want to know why this behavior occurred when MSP430G2553 act as Slave.

    Then they checked the related documents including the UserGuide(SLAU144J).

    And they thought the one reason is "The SCL line is held low until the first data to be sent is written into the transmit buffer UCBxTXBUF."

    from the description of UserGuide(SLAU144J) "17.3.4.1.1 I2C Slave Transmitter Mode".

     

    We understand the I2C slave general behavior which you explained including the explanation of "the slave holds SCL low until it is ready".

    They want to know how to analyze the root cause of this Clock stretching when MSP430G2553 act as Slave.

     

    Best regards,

  • Clock stretching occurs when the CPU does not write to the TXBUF register fast enough.

    To avoid clock stretching,

    • ensure that no other interrupt handlers execute too long (and block the I²C interrupt handler);
    • ensure that the program does not disable GIE for too long; and
    • ensure that the interrupt handler writes to TXBUF immediately, and does not wait for anything else.

  • Hello,

     

    Thank you very much for your kindness.

    I really appreciate your help.

     

    I'd like to send the answer to the customer.

    Best regards,

**Attention** This is a public forum