Samsung 8-Bit CMOS Microcontroller Microcassette Recorder User Manual


 
I/O PORTS S3C9228/P9228
9-14
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
.7 .6 .5 .4 .3 .2 .1 .0MSB LSB
P4.5/SEG9 P4.4/SEG8
P4CONH bit-pair pin configuration settings:
00
01
10
11
N-channel open-drain output mode
Input mode with pull-up
Push-pull output mode
Input mode
P4.6/SEG10P4.7/SEG11
Figure 9-19. Port 4 High-Byte Control Register (P4CONH)
Port 4 Control Register, Low Byte (P4CONL)
FAH, Page 0, R/W
.7 .6 .5 .4 .3 .2 .1 .0MSB LSB
P4.1/SEG5 P4.0/SEG4
P4CONL bit-pair pin configuration settings:
00
01
10
11
N-channel open-drain output mode
Input mode with pull-up
Push-pull output mode
Input mode
P4.2/SEG6P4.3/SEG7
Figure 9-20. Port 4 Low-Byte Control Register (P4CONL)