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/TMS570LS1224: USER BUTTON ISSUE

Part Number: TMS570LS1224

Tool/software: Code Composer Studio

I have Hercules TMS57012x DEVELOPMENT BOARD ,i am trying to LED blink when I pressed user BUTTON.There are two user button one is connected with GIOB_2 ,and another one i don't know.

 when i am pressing the user button,LED is not glowing.

this is my code.

while (1) {
if (gioGetBit(gioPORTB, 2)==1) {
gioSetBit(gioPORTB, 1, 1); 
} else {
gioSetBit(gioPORTB, 1, 0); 

}

So i need some help.

  • Hello,

    GIOB[2] by default is exposed on pin 142 (Table 4-6 in Datasheet). It has alternate input pin - pin 55. When looking at schematic, you can see that S3 button is connected to pin 55.
    Using PINMUX Tab-->Special Pin Muxing (Use GIOB_2 for disabling selected HET2 PWM outputs) pin 55 is selected for GIOB[2].

    Also, from schematic it is clear that pin 55 is connected to pull-up (also, an internal pull up is enabled on the input) and when button S3 is pressed, pin 55 will be read as "0". So, you have to check for "0" instead for "1" to see when button is pressed.

  • while (1)
    {
    if (gioGetBit(gioPORTB,2)==0)
    {
    gioSetBit(gioPORTB, 1, 1);
    }
    else
    {
    gioSetBit(gioPORTB, 1, 0);
    }

    I tried but led is not glowing.

  • while (1)
    {
    if (gioGetBit(gioPORTB,2)==0)
    {
    gioSetBit(gioPORTB, 1, 1);
    }
    else
    {
    gioSetBit(gioPORTB, 1, 0);
    }
    }

    not working when i pressed switch.

  • Hello,

    You have to enable GIOB checkbox from PINMUX tab and Using PINMUX Tab-->Special Pin Muxing, "Use GIOB_2 for disabling selected HET2 PWM outputs" should be checked. Check if GIOB_2 is set as input from GIO-->Port B tab.