Texas Instruments MSP430x1xx User Manual
Page 124

Ports P1, P2
8-4
8.2.1
Port P1, Port P2 Control Registers
The seven control registers give maximum digital input/output configuration
flexibility:
-
All individual I/O bits are independently programmable.
-
Any combination of input, output, and interrupt condition is possible.
-
Interrupt processing of external events is fully implemented for all eight
bits of ports P1 and P2.
The seven registers for port P1 and the seven registers for port P2 are shown
in Table 8–1 and Table 8–2, respectively.
Table 8–1. Port P1 Registers
Register
Short
Form
Register
Type
Address
Initial State
Input
P1IN
Read only
020h
– – – – –
Output
P1OUT
Read/write
021h
Unchanged
Direction
P1DIR
Read/write
022h
Reset
Interrupt flags
P1IFG
Read/write
023h
Reset
Interrupt edge select
P1IES
Read/write
024h
Unchanged
Interrupt enable
P1IE
Read/write
025h
Reset
Function select
P1SEL
Read/write
026h
Reset
Table 8–2. Port P2 Registers
Register
Short
Form
Register
Type
Address
Initial State
Input
P2IN
Read only
028h
– – – – –
Output
P2OUT
Read/write
029h
Unchanged
Direction
P2DIR
Read/write
02Ah
Reset
Interrupt flags
P2IFG
Read/write
02Bh
Reset
Interrupt edge select
P2IES
Read/write
02Ch
Unchanged
Interrupt enable
P2IE
Read/write
02Dh
Reset
Function select
P2SEL
Read/write
02Eh
Reset
These registers contain eight bits, and should be accessed using byte
instructions in absolute-address mode.
8.2.1.1
Input Registers P1IN, P2IN
Both Input registers are read-only registers that reflect the signals at the I/O
pins.
Note:
Writing to Read-Only Registers P1IN, P2IN
Writing to these read-only registers results in increased current consumption
while the write attempt is active.