Datasheet

Rev. 3.00, 03/04, page 196 of 830
8.4 Port 4
Port 4 is an 8-bit I/O port. Port 4 pins also function as external interrupt input, and TMR_0,
TMR_1, TMR_X, and TMR_Y input/output pins. Port 4 has the following registers.
Port 4 data direction register (P4DDR)
Port 4 data register (P4DR)
8.4.1 Port 4 Data Direction Register (P4DDR)
The individual bits of P4DDR specify input or output for the pins of port 4.
Bit Bit Name Initial Value R/W Description
7 P47DDR 0 W
6 P46DDR 0 W
5 P45DDR 0 W
4 P44DDR 0 W
3 P43DDR 0 W
2 P42DDR 0 W
1 P41DDR 0 W
0 P40DDR 0 W
If port 4 pins are specified for use as the general I/O
port, the corresponding port 4 pins are output ports
when the P4DDR bits are set to 1, and input ports when
cleared to 0.
8.4.2 Port 4 Data Register (P4DR)
P4DR stores output data for the port 4 pins.
Bit Bit Name Initial Value R/W Description
7 P47DR 0 R/W
6 P46DR 0 R/W
5 P45DR 0 R/W
4 P44DR 0 R/W
3 P43DR 0 R/W
2 P42DR 0 R/W
1 P41DR 0 R/W
0 P40DR 0 R/W
P4DR stores output data for the port 4 pins that are
used as the general output port.
If a port 4 read is performed while the P4DDR bits are
set to 1, the P4DR values are read. If a port 4 read is
performed while the P4DDR bits are cleared to 0, the
pin states are read.