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.

TMS320F28055: I have a problem with I2C and SCI.

Part Number: TMS320F28055
Other Parts Discussed in Thread: SFRA

In my device i use tms320f28055pnt. I want to use both interface like I2C and SCI. I2C I'm connect to GPIO 32 n GPIO 33. I'm testing I2C with EEPROM, it normal working. SCI I'm want connect to GPIO28 and GPIO29. When I initializing GPIO, I2C not working more. SDA set to "0" SCL set to "1".
What I'm must do to this work?

  • Can you please post your GPIO initialization code?

    Thanks,
  • Yes, I can.
    It's my init code GPIO:

    void InitSciaGpio()
    {
    EALLOW;

    /* Enable internal pull-up for the selected pins */
    // Pull-ups can be enabled or disabled disabled by the user.
    // This will enable the pullups for the specified pins.


    GpioCtrlRegs.GPAPUD.bit.GPIO28 = 0; // Enable pull-up for GPIO28 (SCIRXDA)
    GpioCtrlRegs.GPAPUD.bit.GPIO29 = 0; // Enable pull-up for GPIO29 (SCITXDA)

    /* Set qualification for selected pins to asynch only */
    // Inputs are synchronized to SYSCLKOUT by default.
    // This will select asynch (no qualification) for the selected pins.


    GpioCtrlRegs.GPAQSEL2.bit.GPIO28 = 3; // Asynch input GPIO28(SCIRXDA)
    GpioCtrlRegs.GPAQSEL2.bit.GPIO29 = 3; // Asynch input GPIO29(SCITXDA)

    /* Configure SCI-B pins using GPIO regs*/
    // This specifies which of the possible GPIO pins will be SCI functional pins.

    GpioCtrlRegs.GPAMUX2.bit.GPIO28 = 2; // Configure GPIO28 for SCIRXDA operation
    GpioCtrlRegs.GPAMUX2.bit.GPIO29 = 2; // Configure GPIO29 for SCITXDA operation

    EDIS;
    }

    void InitI2CGpio(void) {

    EALLOW;

    /* Enable internal pull-up for the selected pins */
    // Pull-ups can be enabled or disabled disabled by the user.
    // This will enable the pullups for the specified pins.
    // Comment out other unwanted lines.
    GpioCtrlRegs.GPBPUD.bit.GPIO32 = 0; // Enable pull-up for GPIO32 (SDAA)
    GpioCtrlRegs.GPBPUD.bit.GPIO33 = 0; // Enable pull-up for GPIO33 (SCLA)

    /* Set qualification for selected pins to asynch only */
    // This will select asynch (no qualification) for the selected pins.
    // Comment out other unwanted lines.
    GpioCtrlRegs.GPBQSEL1.bit.GPIO32 = 3; // Asynch input GPIO32 (SDAA)
    GpioCtrlRegs.GPBQSEL1.bit.GPIO33 = 3; // Asynch input GPIO33 (SCLA)

    /* Configure I2C pins using GPIO regs*/
    // This specifies which of the possible GPIO pins will be I2C functional pins.
    // Comment out other unwanted lines.
    GpioCtrlRegs.GPBMUX1.bit.GPIO32 = 1; // Configure GPIO32 for SDAA operation
    GpioCtrlRegs.GPBMUX1.bit.GPIO33 = 1; // Configure GPIO33 for SCLA operation

    EDIS;
    }
  • Strange. There should be no interaction between those peripherals, and I don't see any problems with your GPIO setup code. Are you able to use the SCI and I2C by themselves?
  • Hi.
    It's really strange. Separately from each other interfaces work. SCI I use to SFRA and to exchange with another MCU.
  • The problem could be in the setup code for the peripherals or for the system control. After running the failing code, here are some things you can check:

    * In the PCLKCR0 register, make sure that the clocks for both I2C and SCI are enabled.
    * In the PLLSTS register, make sure that the MCLKSTS bit is 0.
    * In the I2CMDR register, make sure that the IRS bit is 1.
    * Make sure the I2CCLKL and I2CCLKH registers have reasonable values, or at least non-zero values.