Samsung C8274X Computer Hardware User Manual


 
S3C8275X/F8275X/C8278X/F8278X/C8274X/F8274X I/O PORTS
9-11
PORT 2
Port 2 is an 8-bit I/O port with individually configurable pins. Port 2 pins are accessed directly by writing or reading
the port 2 data register, P2 at location F2H in set 1, Bank 0. P2.0-P2.7 can serve as inputs (with or without pull-
up), as outputs (push-pull or open-drain) or you can be configured the following functions.
Low-nibble pins (P2.0-P2.3): SEG31SEG28, V
BLDREF
High-nibble pins (P2.4-P2.7): SEG27SEG24
Port 2 Control Registers (P2CONH, P2CONL)
Port 2 has two 8-bit control registers: P2CONH for P2.4-P2.7 and P2CONL for P2.0-P2.3. A reset clears the
P2CONH and P2CONL registers to "00H", configuring all pins to input mode. You use control registers setting to
select input or output mode (push-pull or open-drain) and enable the alternative functions.
When programming this port, please remember that any alternative peripheral I/O function you configure using the
port 2 control registers must also be enabled in the associated peripheral module.
Port 2 Pull-up Resistor Control Register (P2PUR)
Using the port 2 pull-up resistor control register, P2PUR (ECH, set 1, bank 0), you can configure pull-up resistors
to individual port 2 pins.
Port 2 Control Register, High Byte (P2CONH)
EAH, Set 1, Bank 0, R/W
.7 .6 .5 .4 .3 .2 .1 .0MSB LSB
P2.7/SEG24
P2CONH bit-pair pin configuration settings:
00
01
10
11
Alternative function (SEG24-SEG27)
P2.6/SEG25 P2.5/SEG26 P2.4/SEG27
Input mode
N-channel open-drain output mode
Push-pull output mode
Figure 9-13. Port 2 High-byte Control Register (P2CONH)