Actions

EmSys

TM4C123GXL GPIO - Unlock the port

From EdWiki

Revision as of 04:56, 3 June 2019 by Jshankar (Talk | contribs) (Created page with "__NOTOC__ == GPIO - Unlock the port == This step is only needed for pins PC0-3, PD7 and PF0 on TM4C123GXL LaunchPad. After enabling the clock some ports are still locked. For...")

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

GPIO - Unlock the port

This step is only needed for pins PC0-3, PD7 and PF0 on TM4C123GXL LaunchPad.

After enabling the clock some ports are still locked. For unlocking them we would have to write this register with the magic number. I found this magic number which is 32 bit wide in the datasheet and it is 0x4C4F434B.

Tm4c gpiolock r.png

Now we have unlocked the PORT but we are not allowed to write any changes to that port. This introduces us to GPIO CR register.

GPIO COMMIT register (CR)

Enabling by writing 1 to the respective bit field of this register allows us to write the data to that port.

Tm4c gpiocr r.png

Here we are going to use PF4, PF3, PF2, PF1, and PF0 so writing the 0b000111111 or 0x1F to the CR register will allow us to change PF0-PF5 pins.

Here we have unlocked and got access to our desired port.