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 Control Register<br />

PxCON (P1CON, P2CON, P3CON)<br />

Selects port or peripheral function for a port pin.<br />

15 0<br />

P<br />

C<br />

7<br />

P<br />

C<br />

6<br />

P<br />

C<br />

5<br />

P<br />

C<br />

4<br />

P<br />

C<br />

3<br />

P<br />

C<br />

2<br />

P<br />

C<br />

1<br />

P<br />

C<br />

0<br />

A1312-0A<br />

Bit<br />

Mnemonic<br />

Bit Name<br />

Reset<br />

State<br />

Function<br />

PC7:0<br />

Port Control<br />

7:0<br />

FFH<br />

When the PC bit for a specific pin is set, the<br />

associated integrated peripheral controls both<br />

pin direction and pin data. Clearing the PC bit<br />

makes the pin a general-purpose I/O port.<br />

NOTE: PC7 and PC6 do not exist for Port 3.<br />

NOTE:<br />

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-4. Port Control Register (PxCON)<br />

13.2.2 Port Direction Register<br />

The Port Direction Register (Figure 13-5) controls the direction (input or output) for each pin programmed<br />

as a general-purpose I/O port. The Port Direction bit has no effect on output-only port<br />

pins. These unused direction control bits can be used for bit storage.<br />

The Port Direction Register is read/write. When read, the register returns the value written to it<br />

previously. Pins with their direction fixed return the value in this register, not a value indicating<br />

their true direction. The direction of a port pin assigned to a peripheral function is controlled by<br />

the peripheral; the Port Direction value is ignored.<br />

13-8

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

Saved successfully!

Ooh no, something went wrong!