USER`S MANUAL

Add to My manuals
254 Pages

advertisement

USER`S MANUAL | Manualzz

S3F80N8_UM_REV1.10

PORT 0

Port 0 is an 8-bit I/O port with individually configurable pins. Port 0 pins are accessed directly by writing or reading the port 0 data register, P0 at location E0H. P0.0-0.7 can serve as inputs and as outputs (push-pull or opendrain).

Port 0 Control Registers (P0CONH, P0CONL)

Port 0 has two 8-bit control registers: P0CONH for P0.4-0.7 and P0CONL for P0.0-0.3. A reset clears the

P0CONH and P0CONL registers to "00H". You use control registers setting to select input or output mode (pushpull or open-drain).

Port 0 Pull-Up Resistor Control Register (P0PUR)

Using the port0 pull-up resistor control register, P0PUR (E6H), you can configure pull-up resistors to individual port.

MSB .7

Port 0 Control Register, High-byte (P0CONH)

E4H, R/W

.6

.5

.4

.3

.2

.1

.0

LSB

P0.4

P0.5

P0.6

P0.7

P0CONH bit-pair pin configuration

0 0

0 1

1 0

1 1

Normal input mode

Output mode, push-pull

Output mode, open-drain

Not used

Figure 9-1. Port 0 High-Byte Control Register (P0CONH)

9-3

I/O PORTS

MSB .7

Port 0 Control Register, Low-byte (P0CONL)

E5H, R/W

.6

.5

.4

.3

.2

.1

.0

LSB

P0.0

P0.1

P0.2

P0.3

P0CONL bit-pair pin configuration

0 0

0 1

1 0

1 1

Normal input mode

Output mode, push-pull

Output mode, opne-drain

Not used

Figure 9-2. Port 0 Low-Byte Control Register (P0CONL)

MSB .7

Port 0 Pull-up Control Register (P0PUR)

E6H, R/W

.6

.5

.4

.3

.2

.1

.0

LSB

P0.7

P0.6

P0.5

P0.4

P0.3

P0.2

P0.1

P0.0

P0PUR bit configuration settings:

0

1

Disable pull-up resistor

Enable pull-up resistor

Figure 9-3. Port 0 Pull-up Control Register (P0PUR)

S3F80N8_UM_REV1.10

9-4

advertisement

Related manuals

advertisement

Table of contents