beautypg.com

Rainbow Electronics W79E8213R User Manual

Page 72

background image

Preliminary W79E8213/W79E8213R Data Sheet

Publication Release Date: July 11, 2008

- 72 -

Revision A2

18. I/O PORT CONFIGURATION

The W79E8213 series have three I/O ports, port 0, port 1 and port 2. All pins of I/O ports can be
configured to one of four types by software except P1.5 is only input pin. When P1.5 is configured
reset pin by RPD=0 in the CONFIG 1 register, the W79E8213 series can support 17 I/O pins by use
Crystal. If used internal RC oscillator the P1.5 is configured input pin, the W79E8213 series can be
supported up to 18 I/O pins. The I/O ports configuration setting as below table.

PXM1.Y

PXM2.Y

PORT INPUT/OUTPUT MODE

0 0

Quasi-bidirectional

0 1

Push-Pull

1 0

Input Only (High Impedance)

P2M1.PxS=0, TTL input

P2M1.PxS=1, Schmitt input

1 1

Open

Drain

Table 18-1: I/O port Configuration Table

All port pins can be determined to high or low after reset by configure PRHI bit in the CONFIG0
register. During power-on-reset, all port pins will be tri-stated. After reset, these pins are in quasi-
bidirectional mode. The port pin of P1.5 only is a Schmitt trigger input.


Enabled toggle outputs from Timer 0 and Timer 1 by T0OE and T1OE on P2M1 register, the output
frequency of Timer 0 or Timer 1 is by Timer overflow.


Each I/O port of the W79E8213 series may be selected to use TTL level inputs or Schmitt inputs by
P(n)S bit on P2M1 register, where n is 0, 1 or 2. When P(n)S is set to 1, Ports are selected Schmitt
trigger inputs on Port(n). The P2.0 (XTAL2) can be configured clock output when used internal RC or
external Oscillator is clock source, and the frequency of clock output is divided by 4 on internal RC
clock or external Oscillator.

Note: During power-on-reset, all port pins will be tri-stated. However, PWM pins will be tr-
stated longer until cpu clock is stable.

18.1 Quasi-Bidirectional Output Configuration

After chip was power on or reset, the all ports output are this mode, and output is common with the
8051. This mode can be used as both an input and output without the need to reconfigure the port.


When the pin is pulled low, it is driven strongly and able to sink a fairly large current. These features
are somewhat similar to an open drain output except that there are three pull-up transistors in the
quasi-bidirectional output that serve different purposes.

This mode has three pull-up resisters that are “strong” pull-up, “weak” pull-up and “very weak” pull-up.
The “strong” pull-up is used fast transition from logic “0” change to logic “1”, and it is fast latch and
transition. When port pins is occur from logic “0” to logic “1”, the strong pull-up will quickly turn on two