1 port configurations, 2 quasi-bidirectional output configuration, Section 4.1 “port configurations – NXP Semiconductors P89LPC9321 UM10310 User Manual

Page 29: Nxp semiconductors

Advertising
background image

UM10310

All information provided in this document is subject to legal disclaimers.

© NXP B.V. 2010. All rights reserved.

User manual

Rev. 2 — 1 November 2010

29 of 139

NXP Semiconductors

UM10310

P89LPC9321 User manual

4.1 Port

configurations

All but three I/O port pins on the P89LPC9321 may be configured by software to one of
four types on a pin-by-pin basis, as shown in

Table 13

. These are: quasi-bidirectional

(standard 80C51 port outputs), push-pull, open drain, and input-only. Two configuration
registers for each port select the output type for each port pin.

P1.5 (RST) can only be an input and cannot be configured.

P1.2 (SCL/T0) and P1.3 (SDA/INT0) may only be configured to be either input-only or
open drain.

4.2 Quasi-bidirectional

output configuration

Quasi-bidirectional outputs can be used both as an input and output without the need to
reconfigure the port. This is possible because when the port outputs a logic high, it is
weakly driven, allowing an external device to pull the pin low. When the pin is driven low, it
is driven strongly and able to sink a large current. There are three pull-up transistors in the
quasi-bidirectional output that serve different purposes.

One of these pull-ups, called the ‘very weak’ pull-up, is turned on whenever the port latch
for the pin contains a logic 1. This very weak pull-up sources a very small current that will
pull the pin high if it is left floating.

A second pull-up, called the ‘weak’ pull-up, is turned on when the port latch for the pin
contains a logic 1 and the pin itself is also at a logic 1 level. This pull-up provides the
primary source current for a quasi-bidirectional pin that is outputting a 1. If this pin is
pulled low by an external device, the weak pull-up turns off, and only the very weak pull-up
remains on. In order to pull the pin low under these conditions, the external device has to
sink enough current to overpower the weak pull-up and pull the port pin below its input
threshold voltage.

The third pull-up is referred to as the ‘strong’ pull-up. This pull-up is used to speed up
low-to-high transitions on a quasi-bidirectional port pin when the port latch changes from a
logic 0 to a logic 1. When this occurs, the strong pull-up turns on for two CPU clocks
quickly pulling the port pin high.

The quasi-bidirectional port configuration is shown in

Figure 10

.

Although the P89LPC9321 is a 3 V device most of the pins are 5 V-tolerant. If 5 V is
applied to a pin configured in quasi-bidirectional mode, there will be a current flowing from
the pin to V

DD

causing extra power consumption. Therefore, applying 5 V to pins

configured in quasi-bidirectional mode is discouraged.

A quasi-bidirectional port pin has a Schmitt-triggered input that also has a glitch
suppression circuit

Table 13.

Port output configuration settings

PxM1.y

PxM2.y

Port output mode

0

0

Quasi-bidirectional

0

1

Push-pull

1

0

Input only (high-impedance)

1

1

Open drain

Advertising