C-33
REGISTERS
Px_REG
P
x
_REG
x
= 1–4
Address:
Reset State:
Table C-14
For an input, set the corresponding port x data ouput (P
x
_REG) register bit.
For an output, write the data to be driven out by each pin to the corresponding bit of P
x
_REG. When a
pin is configured as standard I/O (P
x
_MODE.
y
= 0), the result of a CPU write to P
x
_REG is
immediately visible on the pin. When a pin is configured as a special-function signal (P
x
_MODE.
y
= 1),
the associated on-chip peripheral or off-chip component controls the pin. The CPU can still write to
P
x
_REG, but the pin is unaffected until it is switched back to its standard I/O function.
This feature allows software to configure a pin as standard I/O (clear P
x
_MODE.
y
), initialize or
overwrite the pin value, then configure the pin as a special-function signal (set P
x
_MODE.
y
). In this
way, initialization, fault recovery, exception handling, etc., can be done without changing the operation
of the associated peripheral.
7 0
x
= 1–3 PIN7 PIN6 PIN5 PIN4 PIN3 PIN2 PIN1 PIN0
7 0
x
= 4 ————PIN3 PIN2 PIN1 PIN0
Bit Number
Bit
Mnemonic
Function
7:0 PIN7:0 Port
x
Pin
y
Output
To use P
x
.
y
for output, write the desired output data to this bit. To use
P
x
.
y
for input, set this bit.
Table C-14. P
x
_REG Addresses and Reset Values
Register Address Reset Value
P1_REG 1FD4H FFH
P2_REG 1FD5H FFH
P3_REG 1FDCH FFH
P4_REG 1FDDH FFH