Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8xC196EA microcontroller user's manual.1998.pdf
Скачиваний:
52
Добавлен:
23.08.2013
Размер:
8.29 Mб
Скачать

8XC196EA USER’S MANUAL

7.4I/O PORT INTERNAL STRUCTURES

The following sections describe the internal structure of the ports.

7.4.1Internal Structure for the Extended I/O Port (EPORT Pins 0–4)

Figure 7-1 shows the internal structure for the EPORT pins 0–4. Consult the datasheet for specifications on the amount of current that the EPORT pins 0–4 can source and sink.

During reset, the falling edge of RESET# generates a short pulse that turns on the medium pullup transistor Q3, which remains on for about 300 ns, causing the pin to change rapidly to its reset state. The active-low level of RESET# turns on transistor Q4, which weakly holds the pin high. When RESET# is inactive, both Q3 and Q4 are off; Q1 and Q2 determine output drive.

If RESET#, HOLD#, idle, or powerdown is asserted, the gates that control Q1 and Q2 are disabled and Q1 and Q2 remain off. Otherwise, the gates are enabled and complementary or opendrain operation is possible.

For complementary output mode, the gates that control Q1 and Q2 must be enabled. The Q2 gate is always enabled (except when RESET#, HOLD#, idle, or powerdown is asserted). Either clearing EP_DIR (selecting complementary mode) or setting EP_MODE (selecting address mode) enables the logic gate preceding Q1. The value of DATA determines which transistor is turned on. If DATA is equal to one, Q1 is turned on and the pin is pulled high. If DATA is equal to zero, Q2 is turned on and the pin is pulled low.

For open-drain output mode, the gate that controls Q1 must be disabled. Setting EP_DIR (selecting open-drain mode) and clearing EP_MODE (selecting I/O mode) disables the logic gate preceding Q1. The value of DATA determines whether Q2 is turned on. If DATA is equal to one, both Q1 and Q2 remain off and the pin is left in high-impedance state (floating). If DATA is equal to zero, Q2 is turned on and the pin is pulled low.

Input mode is obtained by configuring the pin as an open-drain output (EP_DIR set and EP_MODE clear) and writing a one to EP_REG.x. In this configuration, Q1 and Q2 are both off, allowing an external device to drive the pin. To determine the value of the I/O pin, read EP_PIN. x.

7-22

I/O PORTS

Internal Bus

 

 

 

 

 

 

 

RESET#

Vcc

EP_REG

0

DATA

 

 

 

 

 

Q1

Address Bit from

1

 

 

 

 

 

Address MUX

 

 

 

 

 

 

I/O Pin

 

 

 

 

EP_MODE

 

 

 

 

 

 

 

 

Q2

EP_DIR

 

 

 

 

POWERDOWN#

 

 

 

 

IDLE#

 

 

 

Vss

HOLD#

 

 

 

 

Sample

 

 

 

 

Latch

 

 

 

EP_PIN

Buffer

150 to 200 Ohms

 

 

 

 

Q

D

 

 

 

 

LE

 

R1

 

 

 

 

Read Port

PH1 Clock

 

Q3

 

 

 

 

 

 

 

 

Vss

Vss

 

 

 

 

Vcc

 

 

 

 

Medium

 

 

 

 

Pullup

 

 

300ns Delay

 

Q3

RESET#

 

 

 

 

 

 

 

 

 

 

 

Vcc

 

 

 

 

Weak

 

 

 

 

Pullup

 

 

 

 

Q4

 

 

 

 

A5490-01

Figure 7-1. EPORT Pins 0–4 Internal Structure

7-23

8XC196EA USER’S MANUAL

7.4.2Internal Structure for Ports 2, 5, 7–12, and EPORT Pins 5–7

Figure 7-2 shows the logic for driving the output transistors, Q1 and Q2. Consult the datasheet for specifications on the amount of current that each port can source or sink.

In I/O mode (selected by clearing a port mode register bit), the port data output and the port direction registers are input to the multiplexers. These signals combine to drive the gates of Q1 and Q2 so that the output is high, low, or high impedance.

In special-function mode (selected by setting a port mode register bit), SFDIR and SFDATA are input to the multiplexers. These signals combine to drive the gates of Q1 and Q2 so that the output is high, low, or high impedance. Special-function output signals clear SFDIR; special-function input signals set SFDIR. Even if a pin is to be used in special-function mode, you must still initialize the pin as an input or output by writing to the port direction register.

Resistor R1 provides ESD protection for the pin. Input signals are buffered. The standard ports use Schmitt-triggered buffers for improved noise immunity. Port 5 uses a standard input buffer because of the high speeds required for bus control functions. The signals are latched into the port pin register sample latch and output onto the internal bus when the port pin register is read.

The falling edge of RESET# turns on transistor Q3, which remains on for about 300 ns, causing the pin to change rapidly to its reset state. The active-low level of RESET# turns on transistor Q4, which weakly holds the pin high. Q4 remains on, weakly holding the pin high, until your software writes to the port mode register.

NOTE

P2.7 is an exception. After reset, P2.7 carries the CLKOUT signal rather than being held high. When CLKOUT is selected, it is always a complementary output.

7-24

I/O PORTS

Internal Bus

 

 

 

 

 

 

 

 

 

 

 

Vcc

 

Px_REG

0

 

 

 

 

 

SFDATA

1

 

 

 

Q1

 

 

 

 

 

 

 

 

 

 

 

 

 

I/O Pin

Px_DIR

0

 

 

 

 

 

SFDIR

 

 

 

 

Q2

 

1

 

 

 

 

 

 

 

 

 

 

 

Px_MODE

 

 

 

 

Vss

 

 

 

 

 

 

 

 

Sample

 

 

150Ω to 200Ω

R1

 

Latch

 

 

 

 

Px_PIN

 

 

 

 

 

Q

D

 

 

 

 

 

LE

 

 

 

 

 

Read Port

PH1 Clock

 

 

 

 

 

 

 

Vcc

 

 

 

 

 

 

Medium

 

 

 

 

 

 

Pullup

 

 

300ns Delay

 

Q3

 

RESET#

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Vcc

 

 

RESET#

 

R

 

Weak

 

 

 

 

Pullup

 

 

 

 

 

Q

Q4

 

 

 

 

 

 

 

Any Write to Px_MODE

 

S

 

 

 

 

 

 

 

 

 

A5489-01

Figure 7-2. Ports 2, 5, 7–12, and EPORT Pins 5–7 Internal Structure

7-25

Соседние файлы в предмете Электротехника