I/O PORTS

S3C9228/P9228

 

 

PORT 4

Port 4 is an 8-bit I/O port with individually configurable pins. Port 4 pins are accessed directly by writing or reading the port 4 data register, P4 at location E8H in page 0. P4.0-P4.7 can serve as inputs or as push-pull, open-drain outputs. You can configure the following alternative functions with LCD port control register, LPOT:

Low-nibble pins (P4.0-P4.3): SEG4-SEG7

High-nibble pins (P4.4-P4.7): SEG8-SEG11

Port 4 Control Registers (P4CONH, P4CONL)

Port 4 has two 8-bit control registers: P4CONH for P4.4-P4.7 and P4CONL for P4.0-P4.3. A reset clears the P4CONH and P4CONL registers to "00H", configuring all pins to input mode. You use control registers setting to select input or output mode.

Port 4 Control Register, High Byte (P4CONH)

F9H, Page 0, R/W

MSB

.7

.6

 

.5

.4

 

.3

.2

 

.1

.0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

P4.7/SEG11 P4.6/SEG10 P4.5/SEG9 P4.4/SEG8

LSB

P4CONH bit-pair pin configuration settings:

00 Input mode

01 Push-pull output mode

10N-channel open-drain output mode

11Input mode with pull-up

Figure 9-19. Port 4 High-Byte Control Register (P4CONH)

Port 4 Control Register, Low Byte (P4CONL)

FAH, Page 0, R/W

MSB

.7

.6

 

.5

.4

 

.3

.2

 

.1

.0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

P4.3/SEG7 P4.2/SEG6 P4.1/SEG5 P4.0/SEG4

LSB

P4CONL bit-pair pin configuration settings:

00 Input mode

01 Push-pull output mode

10N-channel open-drain output mode

11Input mode with pull-up

Figure 9-20. Port 4 Low-Byte Control Register (P4CONL)

9-14

Page 394
Image 394
Samsung S3C9228/P9228, 8-Bit CMOS Microcontroller user manual Port