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.

EK-TM4C1294XL: How to write byte (not bit) value to GPIO port?

Part Number: EK-TM4C1294XL

The GPIO functions I have been able to find are "bit" functions that allow me to set or reset a bit of a particular port one bit at a time.  Since I am interfacing an 8 bit bus, is is possible to set the values of the 8 bits of a port all at once?

Thanks for all your help.

Jorge

  • Hello Jorge,

    Because the writes are done to GPIODATA which is virtually mapped across 256 locations it wouldn't be possible to set all 8 bits at once. I believe you could in two separate commands set all zeroes and then all ones as it's setup to change multiple pins at once, but only to a specific 0 or 1 value, and not that you could set 4 pins to be 1010.

    Best Regards,

    Ralph Jacobi

  • Ralph,

    Thanks for your reply.  So just to make sure I am understanding you correctly, if I want to write 0x57 to PortF, I would have to issue the following two commands?:

    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_7 | GPIO_PIN_6 | GPIO_PIN_5 | GPIO_PIN_4 | GPIO_PIN_3 | GPIO_PIN_2 | GPIO_PIN_1 | GPIO_PIN_0 , 0)

    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_6 | GPIO_PIN_4 | GPIO_PIN_2 | GPIO_PIN_1 | GPIO_PIN_0 , 1)

    Jorge

  • Hello Jorge,

    Yes that would be the best way to change the outputs across the whole port.

    Best Regards,

    Ralph Jacobi