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.

TIVA - GPIO setting order

Hello TI TIVA community:

I seem to be experiencing a strange issue with respect to the TIVA GPIO settings.

The issue I believe we might have is that we are setting the pin to an output first, and then setting the direction.   

In the TIVA platform, can I set the GPIO pin output value prior to setting the pin to an output, and have that value persist?

If so, then I just need to reset the order, and everyone should be happy.  If not, then I have to look into a possible hardware change.

This is some code to review: 

<Code>

    GPIOPinTypeGPIOOutput(PIN_FUNCTION_1);

    GPIOPinTypeGPIOOutput(PIN_FUNCTION_2);

    GPIOPinTypeGPIOOutput(PIN_FUNCTION_3);

    GPIOPinTypeGPIOOutput(PIN_FUNCTION_4);

    GPIOPinTypeGPIOOutput(PIN_FUNCTION_5);

    GPIOPinTypeGPIOOutput(PIN_FUNCTION_6);

 

    GPIOPinWrite(PIN_FUNCTION_1, 0);

    GPIOPinWrite(PIN_FUNCTION_2, 0);

    GPIOPinWrite(PIN_FUNCTION_3, 0);

    GPIOPinWrite(PIN_FUNCTION_4, 0);

    GPIOPinWrite(PIN_FUNCTION_5, 0);

    GPIOPinWrite(PIN_FUNCTION_6, 0);

</Code>

 

<DoesReversedNewCodeWork>

    GPIOPinWrite(PIN_FUNCTION_1, 0);

    GPIOPinWrite(PIN_FUNCTION_2, 0);

    GPIOPinWrite(PIN_FUNCTION_3, 0);

    GPIOPinWrite(PIN_FUNCTION_4, 0);

    GPIOPinWrite(PIN_FUNCTION_5, 0);

    GPIOPinWrite(PIN_FUNCTION_6, 0);

 

    GPIOPinTypeGPIOOutput(PIN_FUNCTION_1);

    GPIOPinTypeGPIOOutput(PIN_FUNCTION_2);

    GPIOPinTypeGPIOOutput(PIN_FUNCTION_3);

    GPIOPinTypeGPIOOutput(PIN_FUNCTION_4);

    GPIOPinTypeGPIOOutput(PIN_FUNCTION_5);

    GPIOPinTypeGPIOOutput(PIN_FUNCTION_6);

</DoesReversedNewCodeWork>

Any feedback or input is welcomed and appreciated!

Thanks again!

Paul