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.

VC5502 I2C STOP condition missing

Other Parts Discussed in Thread: MSP430F5510

The I2C communication is between a VC5502 and a MSP430F5510.  The I2C module works as a master transmitter and uses standard mode (not repeat mode).  The I2C clock is about 400 kbps.  The system works correctly.  The only problem is that when the DSP send out two sets of data very close, the DSP does not issue STOP condition at the end of the first set of data.  The bus trace shows that there is only the START condition of the second set of data.  If some delay (about 250 us) is added between these two sets of data, the STOP condition of the first set presents.  This is a designed behavior or something wrong?

Thanks much for your help.

 

Best regards,

Yiyuan

  • Hi,

    We'll take a look into it. If you can send me your code, it'll help us.

    Regards,

    Hyun

  • The following are I2C initialization and hardware related write code

    void i2c_init(void)
    {
      int i;

      /* Initial mode */
      I2CMDR = 0;               /* 8-bit mode under reset */

      /* Set up clock */
      I2CPSC = 0x3; /* module clock = 45 MHz (SYSCLK2) / (3 + 1) = 11.25 MHz */
      I2CCLKH = 10; /* master clock = module clock / (I2CCLKH + d + I2CCLKL + d), where d = 5 */
      I2CCLKL = 10;

      /* Set addresses */
      I2COAR = DSP_I2C_ADDR;        /* own address */
      I2CSAR = MSP_I2C_ADDR;        /* slave address of MSP430 */
     
      /* Set up interrupt */
      I2CIER = 0x1F;                /* enable all interrupts */

      /* Enable I2C */
      I2C_Enable;
      DelayForHalfMicroSeconds(10000); /* 5 ms delay  */
      for (i = 0; i < I2C_INIT_TIMEOUT; i++) {
        if (!(I2CSTR & I2CSTR_BB))  /* check bus busy */
          break;
        DelayForHalfMicroSeconds(2000);
      }

      /* Enable interrupts */
      ENA_INT_I2C;
      ENA_INT_WDTINT;               /* enable int3 to receive MSP interrupt */
    }

      /* Initial I2C registers */
      I2CCNT = length;
      I2C_Master;
      I2C_TransmitMode;
      I2C_Stop;
      I2C_Start;

      /* Wait for writing done */
      t = msTimer + I2C_WR_TIMEOUT;
      while ((p_i2c_write - p_data) < length) {
        if (i2c_arb_lost) {
          r = ERR_ARB_LOST;
          break;
        }
        if (i2c_nack) {
          r = ERR_NACK;
          break;
        }
        if (t == msTimer) {
          r = ERR_WR_TIMEOUT;
          break;
        }
      }
      I2C_Stop;                     /* make sure stop is sent */
     

  • I beleive this problem is the same as the one I posted (http://e2e.ti.com/support/dsp/tms320c5000_power-efficient_dsps/f/109/t/88812.aspx) a couple of weeks ago.  I think the issue is if you start to set up a new write before the previous transaction completes, the stop condition gets stepped on.  This is because to start a new transaction you tell the hardware to generate a start. I think this cancels the pending stop if the setup is completed  before the stop of the last transaction.