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/TMS320F28335: GPIO data writing problem-Reg

Part Number: TMS320F28335
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Dear Sir,

I tried to write the GPIO data registers using variables as code attached. But the data registers are not getting updated. I tried to debug at swap=1 or 0, all the variables such as swan,swbp and swbn are updating but not the data registers of the GPIO. Please, somebody, suggest how to resolve this problem.

int swap,swan,swbp,swbn;
void Gpio_setup1(void){
    EALLOW;
    
    GpioCtrlRegs.GPAMUX1.bit.GPIO11=0;
    GpioCtrlRegs.GPADIR.bit.GPIO11=1;
    GpioDataRegs.GPADAT.bit.GPIO11=0;

    GpioCtrlRegs.GPAMUX1.bit.GPIO12=0;
    GpioCtrlRegs.GPADIR.bit.GPIO12=1;
    GpioDataRegs.GPADAT.bit.GPIO12=0;

    GpioCtrlRegs.GPAMUX1.bit.GPIO13=0;
    GpioCtrlRegs.GPADIR.bit.GPIO13=1;
    GpioDataRegs.GPADAT.bit.GPIO13=0;

    GpioCtrlRegs.GPAMUX1.bit.GPIO14=0;
    GpioCtrlRegs.GPADIR.bit.GPIO14=1;
    GpioDataRegs.GPADAT.bit.GPIO14=0;

    EDIS;
}

__interrupt void cpu_timer0_isr(void)
{
    CpuTimer0.InterruptCount++;
   
    if (igact>(eps+0.1f)){
        swap=1;
    }

    else if(igact<(eps-0.1f)){
        swap=0;
    }
    if (swap==1){
        swan=0;swbn=1;swbp=0;
    }
    else{
        swan=1;swbn=0;swbp=1;
    }
    GpioDataRegs.GPADAT.bit.GPIO11=swap;
    GpioDataRegs.GPADAT.bit.GPIO12=swan;
    GpioDataRegs.GPADAT.bit.GPIO13=swbp;
    GpioDataRegs.GPADAT.bit.GPIO14=swbn;

    PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}