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/TMS320F28035: 28035 I2c Code without eeprom

Part Number: TMS320F28035
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hello,

I am looking for example code for I2C for 28035. I could find only one code for eeprom.

Is there a sample code for communicating via I2C for 28035(master) with an MSP 430 (slave).

I have referred to the documentation and it would be great if there is any other sample codes.

Thanks 

  • Sagar,

    At this time, the only I2C examples (i2c_eeprom, and i2c_boot) utilize the EEPROM. We have requested additional examples, including Slave mode, but do not have an estimate when this might be available.

    If you have specific questions about the I2C I am happy to help.

    Thanks,
    Mark
  • In my code posted above I am stuck at the line shown above! Could you help what is going on?

    Thanks
  • I2caRegs.I2CPSC.all = 4;

    I2caRegs.I2CCLKL = 1000;

    I2caRegs.I2CCLKH = 500;

    For 10 KHz what should be the vales. Sysclock is 60Mhz I believe for F28035.
    Its Little confusing that I am able to send clock signals with (the values on top) only.

    It does not work for the following values (bottom)
    I2caRegs.I2CPSC.all = 5;

    I2caRegs.I2CCLKL = 495;

    I2caRegs.I2CCLKH = 495;


    so for 10 KHZ what should be the value?

    Thanks
    Sagar
  • Sagar,

    What do the signals look like right before the code gets stuck?

    Regarding the clock setup,
    I2C Module clock = SYSCLK/(IPSC+1) where the module clock must be between 7-12 MHz.
    For F28035 at 60MHz, I2C Module IPSC should be set to either 4, 5, 6, or 7. As you want 10 KHz I2C clock rate, lets pick IPSC to be 5. so the I2C Module clock is 60MHz/(5+1) = 10MHz. For a 50% duty cycle of the I2C, Setting both I2CCLKL and I2CCLKH to 495 yields a 10 Khz clock. It is odd that this configuration does not work. The config that works yields ~7.9 KHz I2C clock. is this what you see on the oscilloscope?
    Have you ensured that your SYSCLK is in fact 60 MHz?

    The I2C_Boot function in the Boot ROM sources are very simple Master receive examples, you can use this as a reference. This does not use interrupts and the sequences to read from a slave (though it is an eeprom) are very simple. Check out the I2C_Boot.c file located here in C2000Ware : C:\ti\c2000\C2000Ware_1_00_04_00\libraries\boot_rom\f2803x\v1_0\rom_sources\source \I2C_Boot.c

    -Mark