Actions

EmSys

TM4C123GXL GPIO - Read Write Data Register

From EdWiki

Revision as of 05:49, 3 June 2019 by Jshankar (Talk | contribs) (Created page with "__NOTOC__ == GPIO - Read Write Data Register (GPIODATA) == The GPIODATA register is the data register. Values written in the GPIODATA register are transferred onto the GPIO po...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

GPIO - Read Write Data Register (GPIODATA)

The GPIODATA register is the data register. Values written in the GPIODATA register are transferred onto the GPIO port pins if the respective pins have been configured as outputs through the GPIO Direction (GPIODIR) register.

  • The GPIO Data Register is located at the offset address of 0x000 from the base address of its port.
  • The data register supports bit-specific addressing.
  • In order to write to GPIODATA, the corresponding bits in the mask, resulting from the address bus bits [9:2], must be set. Otherwise, the bit values remain unchanged by the write.
Tm4c gpio data register 01.png
  • Similarly, the values read from this register are determined for each bit by the mask bit derived from the address used to access the data register, bits [9:2]. Bits that are set in the address mask cause the corresponding bits in GPIODATA to be read, and bits that are clear in the address mask cause the corresponding bits in GPIODATA to be read as 0, regardless of their value.
  • A read from GPIODATA returns the last bit value written if the respective pins are configured as outputs, or it returns the value on the corresponding input pin when these are configured as inputs.


If we want to access bit Offset Constanct
7
0x200
6
0x100
5
0x080
4
0x040
3
0x020
2
0x010
1
0x008
0
0x004


  • Writing to address 0x40004038 means that bits 5, 4 and 3 of Port A must be changed.
Tm4c gpio data register 02.png
  • If we want to read and write all 8 bits of a port, it means that we need to sum all these 8 offset constants, which makes the offset address of 0x3FC (001111111100 in binary).
  • All bits are cleared by a reset.