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.

CCS/AM5728: I2C bitrate issue

Part Number: AM5728

Tool/software: Code Composer Studio

sdk version: processor_sdk_rtos_am57xx_5_03_00_07

I use the i2c5 in the dsp with rtos, I successfully to transfer data with the 100K bit rate.

But I failed when I set the bit rate to 400K,1M or 3.4M.

When I set the bit rate to 400K,1M and 3.4M, The sda and scl lines didn't work anymore.

The following is my setting:

    I2C_Params_init(&i2c_params);

    i2c_params.bitRate = I2C_3P4Mhz;

    handle = I2C_open(i2c_dev,&i2c_params);

I only modified the i2c_params.bitRate to I2C_3P4Mhz.

Is there another setting should I configure?

If there are some documents can I reference to set the bit rate to 3.4M, please give me the link.

Thanks

  • Hi,

    You also need to configure the HSSCLL & HSSCLH bit fields in the I2C registers, see device TRM:
      Section 24.1.4.2.1 HS I 2 C Clocking, Table 24-6. HS I 2 C t LOW and t high Values of the I 2 C Clock & Table 24-7. HS I C Register Values for Maximum I C Bit Rates in I C F/S, I C HS Modes.

    Best Regards,
    Yordan

  • #define I2C5_PSC        0x4807C0B0
    #define I2C5_SCLL       0x4807C0B4
    #define I2C5_SCLH       0x4807C0B8
    i2c_params.bitRate = I2C_3P4Mhz; 
    HW_WR_REG_32(I2C5_PSC,0x00000001); 
    HW_WR_REG_32(I2C5_SCLL,0x00000C73); 
    HW_WR_REG_32(I2C5_SCLH,0x00000571); 
    handle = I2C_open(i2c_dev,&i2c_params);

    If I configure the registers follow Table 24-7 before I2C_open function, the value of PSC, SCLL and SCLH will be reset to zero after opening i2c.

    If I configure them after opening i2c, the value seems correct by using devmem2 tool.

    But the i2c only work one time, and then it will block in I2C_transfer function forever.

  • Hi,

    It works,when I connect my slave device.

    It was strange, I thought that I could see the  address broadcast from the scl and sda line at least even if I hadn't connect the slave device.

    Whatever, it works now.

    Thanks for your help