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.

TMS320F28P650DK: Problem using sysconfig to setup I2CB

Part Number: TMS320F28P650DK
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE

Tool/software:

Dear forum,

We are using the TMS320F28P650DK9 on a new custom design and I'm now testing the first prototype hardware. I'm using sysconfig to build a basic application to test out hardware bit by bit and had some challenges getting the I2CB peripheral working. Using sysconfig to setup I2CB (GPIO40 and GPIO41 pins for SDA Band SCLB), I power up and it seems like the 28P650DK is pulling these two pins down permanently. If I configure these pins as GPIOs instead, I am able to toggle them as expected.

I switched from using sysconfig to setup I2CB to using my own code instead and the comms works as expected.

After looking in detail at the difference between my code and the sysconfig generated code, the only difference between the two is that the sysconfig code sets the pins up as open drain with pullups enabled whereas my manual code just specifies the pins as pull ups enabled. Copying in the sysconfig generated code into my own code block allows me to change the open drain configuration as a single item which results in either a working I2CB bus or a non-working I2CB bus (both SDA and SCL held low). Below are the two code blocks:-

Working I2CB Code Block:-

void I2CB_Init(void)
{

    GPIO_setPinConfig(GPIO_40_I2CB_SDA);
    GPIO_setPadConfig(40, GPIO_PIN_TYPE_PULLUP);
    GPIO_setQualificationMode(40, GPIO_QUAL_ASYNC);

    //
    // Configuration for the I2CB SCL Pin
    //
    GPIO_setPinConfig(GPIO_41_I2CB_SCL);
    GPIO_setPadConfig(41, GPIO_PIN_TYPE_PULLUP);
    GPIO_setQualificationMode(41, GPIO_QUAL_ASYNC);

    I2C_disableModule(TMP75C_BASE);
    I2C_initController(TMP75C_BASE, DEVICE_SYSCLK_FREQ, 400000, I2C_DUTYCYCLE_50);
    I2C_setConfig(TMP75C_BASE, I2C_CONTROLLER_SEND_MODE);
    I2C_disableLoopback(TMP75C_BASE);
    I2C_setOwnAddress(TMP75C_BASE, 0x0);
    I2C_setTargetAddress(TMP75C_BASE, 0x4F);
    I2C_setBitCount(TMP75C_BASE,I2C_BITCOUNT_8);
    I2C_setDataCount(TMP75C_BASE,1);
    I2C_setAddressMode(TMP75C_BASE,I2C_ADDR_MODE_7BITS);
    I2C_disableFIFO(TMP75C_BASE);
    I2C_setEmulationMode(TMP75C_BASE,I2C_EMULATION_FREE_RUN);
    I2C_enableModule(TMP75C_BASE);
}

Non-Working I2CB Code Block, essentially what sysconfig generates:-

void I2CB_Init(void)
{

    GPIO_setPinConfig(GPIO_40_I2CB_SDA);
    GPIO_setPadConfig(40, GPIO_PIN_TYPE_PULLUP|GPIO_PIN_TYPE_OD);
    GPIO_setQualificationMode(40, GPIO_QUAL_ASYNC);

    //
    // Configuration for the I2CB SCL Pin
    //
    GPIO_setPinConfig(GPIO_41_I2CB_SCL);
    GPIO_setPadConfig(41, GPIO_PIN_TYPE_PULLUP|GPIO_PIN_TYPE_OD);
    GPIO_setQualificationMode(41, GPIO_QUAL_ASYNC);

    I2C_disableModule(TMP75C_BASE);
    I2C_initController(TMP75C_BASE, DEVICE_SYSCLK_FREQ, 400000, I2C_DUTYCYCLE_50);
    I2C_setConfig(TMP75C_BASE, I2C_CONTROLLER_SEND_MODE);
    I2C_disableLoopback(TMP75C_BASE);
    I2C_setOwnAddress(TMP75C_BASE, 0x0);
    I2C_setTargetAddress(TMP75C_BASE, 0x4F);
    I2C_setBitCount(TMP75C_BASE,I2C_BITCOUNT_8);
    I2C_setDataCount(TMP75C_BASE,1);
    I2C_setAddressMode(TMP75C_BASE,I2C_ADDR_MODE_7BITS);
    I2C_disableFIFO(TMP75C_BASE);
    I2C_setEmulationMode(TMP75C_BASE,I2C_EMULATION_FREE_RUN);
    I2C_enableModule(TMP75C_BASE);
}

 You can see that the non-working code specifies GPIOsetPadConfig with an OD option whereas the working code doesn't include this. 

The issue is that I can't see an option in the sysconfig setup of I2CB which allows me to turn off OD configuration. Also, it seems logical that we would want to specify OD operation anyway but this seems to stop I2CB operating properly and both SCL and SDA are held low if we do that.

Any idea what I am missing here?