I/O PORTS

S3C84E5/C84E9/P84E9

 

 

PORT 3

Port 3 is an 8-bit I/O port that can be used for general-purpose digital I/O. The pins are accessed directly by writing or reading the port 3 data register, P3 at location E3H in set 1, bank 0. P3.0–P3.7 can serve as inputs, outputs (push pull) or you can configure the following alternative functions:

General-purpose digital I/O

Alternative function: ADC0– ADC7

Port 3 Control Register (P3CONH, P3CONL)

Port 3 has two 8-bit control registers: P3CONH for P3.4–P3.7 and P3CONL for P3.0–P3.3. A reset clears the P2CONH and P2CONL registers to “00H”, configuring all pins to input mode. You use control registers settings to select input or output mode (push-pull) and enable the alternative functions.

When programming the port, please remember that any alternative peripheral I/O function you configure using the port 3 control registers must also be enabled in the associated peripheral module.

Port 3 Control Register, High Byte (P3CONH)

EEH, Set1, Bank0, R/W, Reset value="00"

MSB

.7

.6

.5

.4

.3

.2

.1

.0

LSB

[.7-.6] P3.7/ADC7 Configuration Bits

00 = Input mode with pull-up

01 = Input mode

10 = Push-pull output mode

1 1 = Alternative function mode: ADC7 input

[.5-.4] P3.6/ADC6 Configuration Bits

00 = Input mode with pull-up

01 = Input mode

10 = Push-pull output mode

1 1 = Alternative function mode: ADC6 input

[.3-.2] P3.5/ADC5 Configuration Bits

00 = Input mode with pull-up

01 = Input mode

10 = Push-pull output mode

1 1 = Alternative function mode: ADC5 input

[.1-.0] P3.4/ADC4 Configuration Bits

00 = Input mode with pull-up

01 = Input mode

10 = Push-pull output mode

1 1 = Alternative function mode: ADC4 input

Figure 9-9. Port 3 High-Byte Control Register (P3CONH)

9-12

Page 236
Image 236
Samsung S3C84E5 Port 3 Control Register P3CONH, P3CONL, P3.7/ADC7 Configuration Bits, P3.6/ADC6 Configuration Bits