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/TMS570LS0432: How to enable GIO port pin?

Part Number: TMS570LS0432
Other Parts Discussed in Thread: LAUNCHXL-TMS57004, HALCOGEN

Tool/software: Code Composer Studio

I am new to the TI Hercules line. I am using a LAUNCHXL-TMS57004 board. My first step is to verify the GIO. I have attempted to blink the D12 LED on GIOA2 by calling:

    //    1. Configure GIOA2 as output:
    gioPORTA->DIR = 0x00000004; //bit 2
    //    2. SET this pin to HIGH
    gioPORTA->DSET = 0x00000004; //bit 2
    //    3. RESET this pin to LOW
    gioPORTA->DCLR = 0x00000004; //bit 2

First observation is that, after setting values to these registers and examining their contents the contents do not contain the values I assigned to them.

I have also tried:

    gioSetDirection(gioPORTA, 0xFFFFFFFF);
    gioSetBit(gioPORTA, 2, 1);
    gioSetPort(gioPORTA,1);

But no luck. Is there a trick that I am missing?

    ken

  • Ken,

    The GIODSET and GIODCLR registers always reflect the content of the GIODOUT register. Once a pin is configured as an output pin, the GIODOUT register always reflects the status of the corresponding pin. So if a GIO pin is LOW, the corresponding bit in the GIODSET/CLR/OUT register will read 0.

    Regards,
    Sunil
  • Thanks for your reply.

    Before calling these two functions:

    [CortexR4] gioPORTA address = 0xfff7bc34
    gioPORTA->DCLR = 0x00000000
    gioPORTA->DIN = 0x00000002
    gioPORTA->DIR = 0x00000000
    gioPORTA->DOUT = 0x00000000
    gioPORTA->DSET = 0x00000000
    gioPORTA->PDR = 0x00000000
    gioPORTA->PSL = 0x00000000
    gioPORTA->PULDIS = 0x00000000

    After calling

    gioPORTA->DIR = 0x00000004; //bit 2
    gioPORTA->DSET = 0x00000004; //bit 2

    [CortexR4] gioPORTA address = fff7bc34
    gioPORTA->DCLR = 0x00000000
    gioPORTA->DIN = 0x00000002
    gioPORTA->DIR = 0x00000000
    gioPORTA->DOUT = 0x00000000
    gioPORTA->DSET = 0x00000000
    gioPORTA->PDR = 0x00000000
    gioPORTA->PSL = 0x00000000
    gioPORTA->PULDIS = 0x00000000

    gioPORTA->DIR has not been changed from 0x00000002 to 0x00000004 and
    gioPORTA->DOUT is still 0x00000000

    Thanks again,

    ken
  • Ken,

    Are these two functions part of your main() function? Did you generate the GIO driver using HALCoGen? It will create a gioInit() function that you need to execute before other functions. The module is under reset by default and needs to be released from reset before attempting to write to the control registers.
  • That did it! I knew it had to be something simple. Thanks for your help!!!!