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: Control Suite GPIO_WritePin functions

Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

HI GUYS

I AM DAVIDE, I WOULD LIKE KNOW HOW SET 1OR O THE OUTPUT PIN.

I HAVE DONE THIS: 

GpioDataRegs.GPBSET.bit.GPIO30 = 1 IF I WANT OUTPUT PIN HIGHT 

GpioDataRegs.GPBCLEAR.bit.GPIO30 = 1 IF I WANT OUTPUT PIN LOW.

I HAVE CONTROLED IT THROUGH DIGITAL OSCILLOSCOPE AND THE RESULT IS EGUAL.

CAN YOU HELP ME?

THANKS

  • Davide,

    I HAVE DONE THIS: 

    GpioDataRegs.GPBSET.bit.GPIO30 = 1 IF I WANT OUTPUT PIN HIGHT 

    GpioDataRegs.GPBCLEAR.bit.GPIO30 = 1 IF I WANT OUTPUT PIN LOW.

    You are using correct method. Are you facing any issue? Please make sure you have changed the direction of the pin to OUTPUT before this. By default pins are in INPUT mode.

    You can refer "gpio_toggle" example in c2000Ware for the same.

    Regards,

    Vivek Singh

  • Sorry,
    When i wrote GpioDataRegs.GPBSET.bit.GPIO30 = 1 it is not implicit output pin, because i tell =1?

    thanks
  • No, that only set the data registers to toggle the output from GPIO module to '1' but unless direction is not changed to output, this value will not be reflected on PIN. You need to add following code before setting the value in GPBSET register.

    EALLOW;
    GpioCtrlRegs.GPBDIR.bit.GPIO30 = 1;
    EDIS;

    Regards,
    Vivek Singh