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.

TMS320F280049C: I2C Clock on GPIO18

Part Number: TMS320F280049C


Hi, I have configure the I2C clock on the GPIO18.

GPIO_setPinConfig(GPIO_18_I2CA_SCL);
GPIO_setPadConfig(18, GPIO_PIN_TYPE_PULLUP);
GPIO_setQualificationMode(18, GPIO_QUAL_ASYNC);

I have also configure the I2C_initMaster:

I2C_initMaster(I2CA_BASE, 100000000, 400000, I2C_DUTYCYCLE_33);

and connected digital Ocsilloscope to see that i get the correct clock frequency, but all i can see is very noisy wave with 20MHz frequency.

also this is part of my device init to config external oscillator:

//
// Set up PLL control and clock dividers
//
SysCtl_setClock(DEVICE_SETCLOCK_CFG);

//
// Make sure the LSPCLK divider is set to the default (divide by 4)
//
SysCtl_setLowSpeedClock(SYSCTL_LSPCLK_PRESCALE_4);

we have external oscillator of 20MHz that connected to X1.

I'm a bit at a lost as to what the problem is and why I can't get the clock for the I2C.

Do you have any advice on what am I doing wrong?

  • Hello Ofri,

    Are you configuring the other I2C pin for the data line? Is this scope screenshot when the I2C is transmitting a data frame or just when the I2C bus is supposed to be idle?

    Have you tried testing GPIO 0/1 for I2C A? It has access to the same I2C module as GPIO18, in case this is something unique to GPIO18.

    Best regards,

    Omer Amir

  • Hello Omer,

    Yes i have configure the data GPIO (gpio10). I use the example for reference so I guess that covers all the necessary configuration.

    for the screenshot, I think it's idle. if I look on the I2C - I2CSTR Register:

    it look like the module has start to transmit but has stuck on that state. 
    and this is way I have start to look on every component to analyze this issue, 

    I expected to see other frequency on that gpio18 clock, especially after trying several different values in the initialization function (I2C_initMaster).
    But the truth is that it doesn't matter what I did, except to change this macro: 

    from this:
    DEVICE_SETCLOCK_CFG (SYSCTL_OSCSRC_XTAL | SYSCTL_IMULT(10) | \
    SYSCTL_FMULT_NONE | SYSCTL_SYSDIV(2) | \
    SYSCTL_PLL_ENABLE)

    to this:
    DEVICE_SETCLOCK_CFG (SYSCTL_OSCSRC_XTAL_SE| SYSCTL_IMULT(10) | \
    SYSCTL_FMULT_NONE | SYSCTL_SYSDIV(2) | \
    SYSCTL_PLL_ENABLE)

    *it was just to see if there is some effect. from what I have read and understand the correct flag is SYSCTL_OSCSRC_XTAL .

    Nothing changed the signal coming out of that pin, I try to upload a software that only contains a main function without any configuration. The outgoing signal remains constant.

  • Have you tried testing GPIO 0/1 for I2C A? It has access to the same I2C module as GPIO18, in case this is something unique to GPIO18.

    I will try this to see if there any changes.