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.

TMS320F28069M: how to set 100kbps for I2C module in motorware

Part Number: TMS320F28069M
Other Parts Discussed in Thread: CC2650, CONTROLSUITE

Dear TI members,

I'm trying to communicate between F28069 and CC2650 via I2C

I have initialized I2C module based on example of controlsuite as follows.

void I2C_setup(I2C_Handle i2cHandle)
{
   
    i2cHandle->I2CPSC.all = 6;              // Prescaler - need 7~12 MHz on module clock
    i2cHandle->I2CCLKL = 10;                // Note : must be non zero
    i2cHandle->I2CCLKH = 5;                 // Note : must be non zero

    i2cHandle->I2CIER.all = 0x00;          // no interrupt

    i2cHandle->I2CMDR.all = 0x0020;

    i2cHandle->I2CFFTX.all = 0x6000;        // Enable FIFO mode and TXFIFO
    i2cHandle->I2CFFRX.all = 0x2040;        // Enable RXFIFO, clear RXFFINT
}

Communication speed seems to be around 500kbps, as I have checked with oscilloscope.

I'd like to reduce speed to 100kbps, how to change my setting ?

System clock is 90MHz.

Best Regards,

Hae Ryong

  • Hi Hae Ryong,

    Section 14.5.7 "I2C Clock Divider Registers (I2CCLKL and I2CCLKH)" within the TRM will be useful to you:

    http://www.ti.com/lit/spruh18

    In your case with IPSC = 6, the I2C module clock = 90MHz / (6+1) = 12.857 MHz.

    F_SCL = 100KHz = I2C Module Clock / ( (ICCL + d) + (ICCH + d) ) = 12.857 MHz / ( (ICCL + 5) + (ICCH + 5) )

    Let's say you want a 50% duty cycle, ICCL and ICCH would both equal: ~59 (rounded)

    Hope this helps,
    Kevin