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.

Regarding Assignment of value to single pin of any port

Respected,

I want to give value to certain PIN not full PORT.

With the help of GPIO_PORTG_DATA_R we assign the value to entire PORT.

Like in AVR family microcontroller RS=0; where RS is defined as PIN of Ceratain PORT used to give value to specific PIN of PORT.

So in Tiva series what will be the command to do the same above function. 

  • Hi,

    What Tiva Launchpad are you using? I suggest you read the GPIO section of your Tiva MCU datasheet. GPIO section of Tivaware Peripheral Drivers Library Users Guide, and review the blinky example program.

    - kel
  • Hello Sefu

    Use TivaWare API GPIOPinWrite. That will allow you to write to the pin w/o affecting other pins.

    Regards
    Amit
  • And along w/Amit's "GPIOPinWrite()" function - note that the 2nd parameter (therein) enables you to mask "single or multiple port bits" providing individual (or multiple) bit control beyond your past/lesser MCU...

    Post requesting "which" Tiva appears to "not really" apply as this long standing function is fairly uniform across the Tiva (& past Stellaris) pack...

  • Hello cb1,

    I just realized the pitfall of my post: Should have had a better explanation

    As an example if only GPIO Pin 2 and 3 need to be set for GPIO Port A

    GPIOPinWrite(GPIO_PORTA_BASE, (GPIO_PIN_2 | GPIO_PIN_3), (GPIO_PIN_2 | GPIO_PIN_3));

    If only Pin 2 needs to be set without changing the value of Pin 3

    GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2, GPIO_PIN_2);

    Regards
    Amit
  • Indeed Amit, we note that poster "double greened" you - poor cb1 sits (not even) w/in suggested answer-land. (Yet Id'ed that key Param #2...)

    [edit] Let the record show - post identifying (bit-limiting, parameter #2) has been duly rewarded.  (w/like's & green stamp)   Merci - mon ami.