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.

TMS570LS1224: TMS570LS1224

Part Number: TMS570LS1224
Other Parts Discussed in Thread: HALCOGEN

How can we set a single pin of PORTA to high or low??

  • Hello,
    If I am understanding right, you want to toggle GIOA pin.
    To do this you have to configure MCU in HALCoGen as follows:
    After selecting MCU and creating project,
    - Go to Driver Enable TAB and Enable GIO driver, disable all others (if not needed);
    - Go to PINMUX tab and check GIOA checkbox;
    - Go to GIO Tab -> Port A tab and set desired pin as output by checking DIR checkbox (here you can set pull-up/down as well);
    Generate code from File menu.

    In CCS:
    Create an empty CCS Project with the same name as one from HALCoGen. Include project path.
    Add #include gio.h
    In your main.c call gioInit();
    Then you can use HALCoGen APIs to command desired pin.
    For example:
    gioSetBit(gioPORTA, 7, 1); // This will set GIOA[7] to 1 (pin #22 pf TMS570LS1224PGE)
    gioToggleBit(gioPORTA, 7); //This will toggle GIOA[7];

    Function description can be found in HALCoGen Help (Help->Help topics->Files->source->gio.c).

    Hope this helps.

    Best regards,
    Miro