12.07.2015 Views

80C186EB/80C188EB Microprocessor User's Manual - CEUNES

80C186EB/80C188EB Microprocessor User's Manual - CEUNES

80C186EB/80C188EB Microprocessor User's Manual - CEUNES

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 PORTS11.2.1 Port Control RegisterThe Port Control Register (Figure 11-5) selects the overall function for each port pin: peripheralor port. For I/O ports, the Port Control Register is used to assign the pin to either the associatedon-chip peripheral or to a general-purpose I/O port. For output-only ports, the Port Control Registerselects the source of data for the pin: either an on-chip peripheral or the Port Data latch.Register Name:Register Mnemonic:Register Function:Port Control RegisterPxCON (P1CON, P2CON)Selects port or peripheral function for a port pin.15 0PC7PC6PC5PC4PC3PC2PC1PC0A1312-0ABitMnemonicBit NameResetStateFunctionPC7:0Port Control7:0FFHWhen the PC bit for a specific pin is set, theassociated integrated peripheral controls bothpin direction and pin data. Clearing the PC bitmakes the pin a general-purpose I/O port.NOTE:Reserved register bits are shown with gray shading. Reserved bits must be writtento a logic zero to ensure compatibility with future Intel products.Figure 11-5. Port Control Register (PxCON)11.2.2 Port Direction RegisterThe Port Direction Register (Figure 11-6) controls the direction (input or output) for each pin programmedas a general-purpose I/O port. The Port Direction bit has no effect on output-only portpins. These unused direction control bits can be used for bit storage.The Port Direction Register is read/write. When read, the register returns the value written to itpreviously. Pins with their direction fixed return the value in this register, not a value indicatingtheir true direction. The direction of a port pin assigned to a peripheral function is controlled bythe peripheral; the Port Direction value is ignored.11-8

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

Saved successfully!

Ooh no, something went wrong!