TM4C123GXL GPIO - Unlock the port
Revision as of 04:56, 3 June 2019 by Jshankar (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...")
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.
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.
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.