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/TMS320F28377S: sci communication not working in change over switch

Part Number: TMS320F28377S

Tool/software: Code Composer Studio

Hello,

Using tms320f28377s controller for sci communication ,

i have two functions depends on change over switch this functions ill work ,

example: if(change_over_switch==1)

function1();

else

function2();

this two functions sci has enabled,

this sci working in first function, when switch to (change_over_switch==0)

second function is not working,

using GPIO 84 and 85 pins,

thanks and regards

  • Eswara,

    You need to provide more information. Does each function work independently without the switch? If you reverse the functions does it work?

    I hope this helps. If this answers your question, please click the green "Verified Answer" button. Thanks.

    - Ken
  • Hello,
    yes this functions work independently with change over swith,
    default switch is 0 ,for first functions,
    if change the mode of switch to second switch
    sci is not working

    void main(void)
    {
    EALLOW;
    GPIO_SetupPinMux(85, GPIO_MUX_CPU1, 5);
    GPIO_SetupPinOptions(85, GPIO_INPUT, GPIO_PUSHPULL);
    GPIO_SetupPinMux(84, GPIO_MUX_CPU1, 5);//84
    GPIO_SetupPinOptions(84, GPIO_OUTPUT, GPIO_ASYNC);
    EDIS;

    EALLOW;
    GpioCtrlRegs.GPCPUD.bit.GPIO74 = 1;
    GpioCtrlRegs.GPCMUX1.bit.GPIO74 = 0;
    GpioCtrlRegs.GPCDIR.bit.GPIO74 = 0;
    EDIS;

    if(CHG_OVER_SWITCH == 0)
    switch_mode_flg = 0;
    else
    switch_mode_flg = 1;

    if(switch_mode_flg == 0)
    Function1();
    else
    Function2();

    for (;;);
    }

    void Function1()
    {
    // sci is working in this function.
    }
    void Function2()
    {
    //sci is not working in this function.
    }

    thanks and regards
  • Hi,

    From the information provided, we cannot say much about what the potential problem could be. But I will offer some suggestions.

    First, if you can, initialize the SCI in one place prior to the if condition and function1 or function2 function calls. This will let you consistently initialize it.

    Second, you can perform an SCI reset to get the SCI in a known state or you can disable and re-enable the SCI clock to do the same.

    Try these techniques. But with the information provided, we cannot begin to identify the issue. You will need to begin to debug the SCI configuration and your initialization sequence to see what is going wrong.

    sal