03.01.2015 Views

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

INPUT/OUTPUT PORTS<br />

Register Name:<br />

Register Mnemonic:<br />

Register Function:<br />

Port Direction Register<br />

PxDIR (P1DIR, P2DIR, P3DIR)<br />

Controls the direction of pins programmed as I/O<br />

ports.<br />

15 0<br />

P<br />

D<br />

7<br />

P<br />

D<br />

6<br />

P<br />

D<br />

5<br />

P<br />

D<br />

4<br />

P<br />

D<br />

3<br />

P<br />

D<br />

2<br />

P<br />

D<br />

1<br />

P<br />

D<br />

0<br />

A1313-0A<br />

Bit<br />

Mnemonic<br />

Bit Name<br />

Reset<br />

State<br />

Function<br />

PD7:0<br />

Port<br />

Direction 7:0<br />

FFH<br />

Setting the PD bit for a pin programmed as a<br />

general-purpose I/O port selects the pin as an<br />

input. Clearing the PD bit selects the pin as an<br />

output.<br />

NOTES:<br />

1) PD7 and PD6 do not exist for Port 3.<br />

2) The PD bits for Port 1 and P3.0 through P3.3<br />

are ignored and can be used as storage.<br />

NOTE: Reserved register bits are shown with gray shading. Reserved bits must be written<br />

to a logic zero to ensure compatibility with future Intel products.<br />

Figure 13-5. Port Direction Register (PxDIR)<br />

13.2.3 Port Data Latch Register<br />

The Port Data Latch Register (Figure 13-6) holds the value to be driven on an output or bidirectional<br />

pin. This value appears at the pin only if it is programmed as a port.<br />

The Port Data Latch Register is read/write. Reading a Port Data Latch Register returns the value<br />

of the latch itself and not that of the associated port pin.<br />

13-9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!