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.

I2C - speed issues - following TI's example code, I2C clock only runs at 370k rather than 400k

Other Parts Discussed in Thread: CC3200, CC3200-LAUNCHXL

I'm working with the CC3200 on the LaunchPad, rev 3.2.


I've set up pins 1 and 2 for I2C following the code defined in the I2C example.

Running at "fast" speed, I only see the clock running at about 370K instead of 400.    Why is this?     I've attached a picture of the scope trace showing the behavior.   My slave device is expecting to run at 400K.    I see intermittent communication failure and I suspect that the problem is the slow master clock.  Yellow is the clock.  You can see on the right side of the screen that 1/deltaX = 370k.   I've verified that the Register controlling the timing (I2CMTPR) is set to 9 as specified in the Technical Reference Manual.

Please advise on how to fix this problem.

Code is here.   I'm using TI's library functions almost exclusively.

main ()

...

BoardInit();
    
 PinMuxConfig();
  //
  // Configuring UART
  //
  InitTerm();

  //I2C setup
  I2C_IF_Open(I2C_MASTER_MODE_FST);
  MAP_UtilsDelay(26666667);
 
  InitAccelerometer();  //I2C commands are Transmitted here after 1 second delay

...

}

PinMuxConfig has the following for I2C pin setup

    MAP_PRCMPeripheralClkEnable(PRCM_I2CA0, PRCM_RUN_MODE_CLK);
       // Configure PIN_01 for I2C0 I2C_SCL
       //
       MAP_PinTypeI2C(PIN_01, PIN_MODE_1);

       //
       // Configure PIN_02 for I2C0 I2C_SDA
       //
       MAP_PinTypeI2C(PIN_02, PIN_MODE_1);


  • Anne,

    I've similar observation as well - Will check further and get back on this. However, this shouldn't cause the intermittent communication failures that you are seeing.

    Few questions:

    - Are these tests done on a custom board or CC3200-LAUNCHXL? And is it a pre-production silicon - Meansing, does the markings on the CC3200 part read 'XCC3200GZ'?

    - If CC3200-LAUNCHXL, how is the slave connected to it? Blue-wires?

    - Can you repeat the test in standard mode and share your observations? 

    -/Praneet

  • Anne
    The I2C clock frequency is only defined as a maximum value. In reality the clock will always be lower than 400KHz due to increase in bus capacitcace with added slaves. This is well defined in the protocol and should never cause a slave communication to fail.
  • Anne, I'm closing this thread - For any followup queries, request you to start a new thread w/ references to the current one for us to track it better.

    -/Praneet