Sei sulla pagina 1di 23

Microprocessors and Interfacing

MICROPROCESSORS AND INTERFACING UNIT - III By Mr. R. VENKATESH [Asst. Prof, Dept. of Electronics & Communication Engineering]

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing

UNIT III
PIN CONFIGURATION OF 8086 MICROPROCESSOR

8086 is a 40 pin DIP using MOS technology. It has 2 GNDs as circuit complexity demands a large amount of current flowing through the circuits, and multiple grounds help in dissipating the accumulated heat etc. 8086 works on two modes of operation namely, Maximum Mode and Minimum Mode. (i) Power Connections

Pin Description: GND Pin no. 1, 20 Ground

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing CLK Pin no. 19 Type I Clock: provides the basic timing for the processor and bus controller. It is asymmetric with a 33% duty cycle to provide optimized internal timing. VCC Pin no. 40 VCC: +5V power supply pin (ii) Address/ Data Lines Pin Description: AD15-AD0 Pin no. 2-16, 39 Type I/O Address Data bus: These lines constitute the time multiplexed memory/ IO address (T1) and data (T2, T3, TW, T4) bus. A0 is analogous to BHE for the lower byte of of the data bus, pins D7-D0. It iss low when a byte is to be transferred on the lower portion of the bus in memory or I/O operations. Eight bit oriented devices tied to the lower half would normally use A0 to condition chip select functions. These lines are active HIGH and float to 3-state OFF during interrupt acknowledge and local bus hold acknowledge.

(iii) Address Lines A19/S6, A18/S5, A17/S4, A16/S3 Pin no. 35-38 Type O Address / Status: During T1 these are the four most significant address lines for memory operations. During I/O operations these lines are low. During memory and I/O operations, status information is available on these lines during T 2, T3, TW and T4. The status of the interrupt enable FLAG bit (S5) is updated at the beginning of each CLK cycle. A17/S4 and A16/S3 are encoded as shown.

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing

A17/S4 0 (LOW) 0 1(HIGH) 1 S6 is 0 (LOW)

A16/S3 0 1 0 1

Characteristics Alternate Data Stack Code or None Data

This information indicates which relocation register is presently being used for data accessing. These lines float to 3-state OFF during local bus hold acknowledge. (iv) Status Pins S0 - S7 Pin Description

S 2 , S1 , S 0 - Pin no. 26, 27, 28 Type O


Status: active during T4, T1 and T2 and is returned to the passive state (1,1,1) during T3 or during TW when READY is HIGH. This status is used by the 8288 Bus Controller to generate all memory and I/O access control signals. Any change by S 2 , S1 or S 0 during T4 is used to indicate the beginning of a bus cycle and the return to the passive state in T3 or TW is used to indicate the end of a bus cycle.

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing

These signals float to 3-state OFF in hold acknowledge. These status lines are encoded as shown.

S2
0(LOW) 0 0 0 1(HIGH) 1 1 1 Status Details

S1
0 0 1 1 0 0 1 1

S0
0 1 0 1 0 1 0 1

Characteristics Interrupt acknowledge Read I/O Port Write I/O Port Halt Code Access Read Memory Write Memory Passive

S2
0 0 0 0 1 1 1 1

S1
0 0 1 1 0 0 1 1

S0
0 1 0 1 0 1 0 1

Indication Interrupt Acknowledge Read I/O port Write I/O port Halt Code access Read memory Write memory Passive

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing

S4 0 0 1 1

S3 0 1 0 1

Indications Alternate data Stack Code or none Data

S5 S6

----- Value of Interrupt Enable flag

----- Always low (logical) indicating 8086 is on the bus. If it is tristated another bus master has taken control of the system bus. ----- Used by 8087 numeric coprocessor to determine whether the CPU is a 8086 or 8088

S7

(v) Interrupts

Pin Description: NMI Pin no. 17 Type I Non Maskable Interrupt: an edge triggered input which causes a type 2 interrupt. A subroutine is vectored to via an interrupt vector lookup table located in system memory. NMI is not maskable internally by software. A transition from a LOW to HIGH initiates the interrupt at the end of the current instruction. This input is internally synchronized. INTR Pin No. 18 Type I Interrupt Request: is a level triggered input which is sampled during the last clock cycle of each instruction to determine if the processor should enter into an interrupt acknowledge operation. A subroutine is vectored to via an interrupt vector lookup table located in system memory. It can be internally masked by software resetting the interrupt enable bit. INTR is internally synchronized. This signal is active HIGH.

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing (vi) Min mode signals

Pin Description: HOLD, HLDA Pin no. 31, 30 Type I/O HOLD: indicates that another master is requesting a local bus hold. To be acknowledged, HOLD must be active HIGH. The processor receiving the hold reque st will issue HLDA (HIGH) as an acknowledgement in the middle of a T 1 clock cycle. Simultaneous with the issuance of HLDA the processor will float the local bus and control lines. After HOLD is detected as being LOW, the processor will LOWer the HLDA, and when the processor needs to run another cycle, it will again drive the local bus and control lines. The same rules as RQ / GT apply regarding when the local bus will be released. HOLD is not an asynchronous input. External synchronization should be provided if the system can not otherwise guarantee the setup time.

WR - Pin no. 29 Type O


Write: indicates that the processor is performing a write memory or write I/O cycle, depending on the state of the M/IO signal.

WR is active for T2, T3 and TW of any write cycle. It is active LOW, and floats to 3-state OFF in local bus hold acknowledge.

M/IO - Pin no. 28 type O


Status line: logically equivalent to S2 in the maximum mode. It is used to distinguish a memory access from an I/O access. M/IO becomes valid in the T4 preceding a bus cycle and remains valid until the final T4 of the cycle (M=HIGH), IO=LOW). M/IO floats to 3state OFF in local bus hold acknowledge.

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing

DT / R -Pin no. 27 Type O


Data Transmit / Receive: needed in minimum system that desires to use an 8286/8287 data bus transceiver. It is used to control the direction of data flow through the transceiver. Logically DT / R is equivalent to S1 in the maximum mode, and its timing is the same as for M/IO . (T=HIGH, R=LOW). This signal floats to 3-state OFF in local bus hold acknowledge.

DEN - Pin no. 26 Type O


Data Enable: provided as an output enable for the 8286/8287 in a minimum system which uses the transceiver. DEN is active LOW during each memory and I/O access and for INTA cycles. For a read or INT A cycle it is active from the middle of T2 until the middle of T4, while for a write cycle it is active from the beginning of T 2 until the middle of T4. DEN floats to 3-state OFF in local bus hold acknowledge. ALE Pin no. 25 Type O Address Latch Enable: provided by the processor to latch the address into the 8282/8283 address latch. It is a HIGH pulse active during T 1 of any bus cycle. Note that ALE is never floated.

INT A - Pin no. 24 Type O

INT A is used as a read strobe for interrupt acknowledge cycles. It is active LOW during T2, T3 and TW of each interrupt acknowledge cycle.
(vii) Max mode signals Pin Description:

RQ/ GT0 , RQ/ GT1 - Pin no. 30, 31 Type I/O


Request /Grant: pins are used by other local bus masters to force the processor to release the local bus at the end of the processors current bus cycle. Each pin is bidirectional with RQ/ GT0 having higher priority than RQ/ GT1 . RQ/ GT has an internal pull up resistor so may be left unconnected. The request/grant sequence is as follows:

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing

1. A pulse of 1 CLK wide from another local bus master indicates a local bus request (hold) to the 8086 (pulse 1) 2. During a T4 or T1 clock cycle, a pulse 1 CLK wide from the 8086 to the requesting master (pulse 2), indicates that the 8086 has allowed the local bus to float and that it will enter the hold acknowledge state at the next CLK. The CPUs bus interface unit is disconnected logically from the local bus during hold acknowledge. 3. A pulse 1 CLK wide from the requesting master indicates to the 8086 (pulse 3) that the hold request is about to end and that the 8086 can reclaim the local bus at the next CLK. Each master-master exchange of the local bus is a sequence of 3 pulses. There must be one dead CLK cycle after each bus exchange. Pulses are active LOW. If the request is made while the CPU is performing a memory cycle, it will release the local bus during T4 of the cycle when all the following conditions are met: 1. 2. 3. 4. Request occurs on or before T2. Current cycle is not the low byte of a word (on an odd address) Current cycle is not the first acknowledge of an interrupt acknowledge sequence. A locked instruction is not currently executing.

LOCK - Pin no. 29 Type O LOCK : output indicates that other system bus masters are not to gain control of the
system bus while

LOCK is active LOW. The LOCK signal is activated by the LOCK

prefix instruction and remains active until the completion of the next instruction. This signal is active LOW, and floats to 3-state OFF in hold acknowledge.

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing QS1, QS0 Pin no. 24, 25 Type O Queue Status: the queue status is valid during the CLK cycle after which the queue operation is performed. QS1 and QS0 provide status to allow external tracking of the internal 8086 instruction queue. QS1 0(LOW) 0 1 (HIGH) 1 QS0 0 1 0 1 Characteristics No operation First Byte of Op Code from Queue Empty the Queue Subsequent byte from Queue

(viii) Common Signals

Pin Description:
RD - Pin no. 34, Type O

Read: Read strobe indicates that the processor is performing a memory of I/O read cycle, depending on the state of the S2 pin. This signal is used to read devices which reside on the 8086 local bus. RD is active LOW during T2, T3 and TW of any read cycle, and is guaranteed to remain HIGH in T2 until the 8086 local bus has floated. This signal floats to 3-state OFF in hold acknowledge.

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing READY Pin no. 22, Type I READY: is the acknowledgement from the addressed memory or I/O device that it will complete the data transfer. The READY signal from memory / IO is synchronized by the 8284A Clock Generator to form READY. This signal is active HIGH. The 8086 READY input is not synchronized. Correct operation is not guaranteed if the setup and hold times are not met.

TEST - Pin No 23 Type I


T EST : input is examined by the Wait instruction. If the T EST input is LOW execution continues, otherwise the processor waits in an idle state. This input is synchronized internally during each clock cycle on the leading edge of CLK.
RESET Pin no. 21 Type I Reset: causes the processor to immediately terminate its present activity. The signal must be active HIGH for at least four clock cycles. It restarts execution, as described in the instruction set description, when RESET returns LOW. RESET is internally synchronized.

BHE/S - Pin No. 34 Type O 7


Bus High Enable / Status: During T1 the Bus High Enable signal ( BHE )should be used to enable data onto the most significant half of the data bus, pins D 15-D8. Eight bit oriented devices tied to the upper half of the bus would normally use BHE to condition chip select functions. BHE is LOW during T1 for read, write, and interrupt acknowledge cycles when a byte is to be transferred on the high portion of the bus. The S ,7 status information is available during T2, T3 and T4. The signal is active LOW and floats to 3-state OFF in hold. It is LOW during T1 for the first interrupt acknowledge cycle.

BHE
0 0 1 1

A0 0 1 0 1

Characteristics Whole word Upper byte from / to odd address Lower byte from / to even address None

MN/ MX - Pin no. 33 Type - I


Minimum / maximum: indicates what mode the processor is to operate in. If the local bus is idle when the request is made the two possible events will follow: 1. Local bus will be released during the next clock.

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing 2. A memory cycle will start within 3 clocks. Now the four rules for a currently active memory cycle apply with condition number 1 already satisfied. Minimum Mode 8086 System:

A minimum mode of 8086 configuration depicts a stand alone system of computer where no other processor is connected. This is similar to 8085 block diagram with the following difference. The Data transceiver block which helps the signals traveling a longer distance to get boosted up. Two control signals data transmit/ receive are connected to the direction input of transceiver (Transmitter/Receiver) and DEN* signal works as enable for this block.

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing

Read Cycle Timing Diagram for Minimum Mode

In the bus timing diagram, data transmit / receive signal goes low (RECEIVE) for Read operation. To validate the data, DEN* signal goes low. The Address/ Status bus carries A16 to A19 address lines during BHE* (low) and for the remaining time carries Status information. The Address/Data bus carries A0 to A15 address information during ALE going high and for the remaining time it carries data. The RD* line going low indicates that this is a Read operation. The curved arrows indicate the relationship between valid data and RD* signal. The TW is Wait time needed to synchronize the fast processor with slow memory etc. The Ready pin is checked to see whether any peripheral needs more time for data transmission. Write Cycle Timing Diagram for Minimum Operation

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing

This is the same as Read cycle Timing Diagram except that the DT/R* line goes high indicating it is a Data Transmission operation for the processor to memory / peripheral. Again DEN* line goes low to validate data and WR* line goes low, indicating a Write operation. Bus Request & Bus Grant Timings in Minimum Mode System

The HOLD and HLDA timing diagram indicates in Time Space HOLD (input) occurs first and then the processor outputs HLDA (Hold Acknowledge). Maximum Mode 8086 System

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing

In the maximum mode of operation of 8086, wherein either a numeric coprocessor of the type 8087 or another processor is interfaced with 8086. The Memory, Address Bus, Data Buses are shared resources between the two processors. The control signals for Maximum mode of operation are generated by the Bus Controller chip 8788. The three status outputs S0*, S1*, S2* from the processor are input to 8788. The outputs of the bus controller are the Control Signals, namely DEN, DT/R*, IORC*, IOWTC*, MWTC*, MRDC*, ALE etc. These control signals perform the same task as the minimum mode operation. However the DEN is an active HIGH signal which has to be converted to active LOW by means of an inverter.

Memory Read Timing in Maximum Mode

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing

Here MRDC* signal is used instead of RD* as in case of Minimum Mode S0* to S2* are active and are used to generate control signal. Memory Write Timing in Maximum Mode

Here the maximum mode write signals are shown. Please note that the T states correspond to the time during which DEN* is LOW, WRITE Control goes LOW, DT/R* is HIGH and data output in available from the processor on the data bus.

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing

RQ / GT

Timings in Maximum Mode

Request / Grant pin may appear that both signals are active low. But in reality, Request signal goes low first (input to processor), and then the processor grants the request by outputting a low on the same pin. Read and Write Cycle Timing diagram of 8088

In 8088, the timing diagram for both Read and Write are indicated along with Ready signal and Wait states. In 8088, there are only 8 data lines as compared to 16 lines in the case of 8086. The figure shown above is for a minimum mode operation of 8088.

INTERFACING WITH MEMORIES

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing The figure 1 shows a general block diagram of an 8086 memory array. In this, the 16-bit word memory is partitioned into high and low 8-bit banks on the upper halves of the data bus selected by BHE, and AO. a) ROM and EPROM ROMS and EPROMs are the simplest memory chips to interface to the 8086. Since ROMs and EPROMs are read-only devices, A0 and BHE are not required to be part of the chip enable/select decoding. The 8086 address lines must be connected to the ROM/EPROM chip chips starting with A1 and higher to all the address lines of the ROM/EPROM chips. The 8086 unused address lines can be used as chip enable/select decoding. To interface the ROMs/RAMs directly to the 8086-multiplexed bus, they must have output enable signals. The figure 2 shows the 8086 interfaced to two 2716s. Byte accesses are obtained by reading the full 16-bit word onto the bus with the 8086 discarding the unwanted byte and accepting the desired byte.

b) Static RAMS Since static RAMs are read/write memories, both A0 and BHE must be included in the chip select/enable decoding of the devices and write timing must be considered in the compatibility analysis. For each static RAM, the memory data lines must be connected to either the upper half AD15-AD0 or lower half AD7-AD0 of the 8086 data lines. For static RAMs without output enable pins, read and write lines must be used as enables for chip select generation to avoid bus contention. If read and write lines are not used to activate the chip selects, static RAMs with common input/output data pins such as 2114 will face extreme bus contentions between chip selects and write active. The 8086 A0 and BHE pins must be used to enable the chip the chip selects. A possible way of generating chip selects for high and low static RAM banks is given in the figure 3. Note that Intel 8205 has three enables E1, E2, and E3, three inputs A0 and A2, and eight outputs O0-O7. For devices with output enables such as 2142, one way to generate chip selects for the static RAMs is by gating the 8086 WR signal with BHE and A0 to provide upper and lower bank write strobes. A possible configuration is shown in the figure 4. Since the Intel 2142 is a 1024 * 4 bit static RAM, two chips for each bank with a total of 4 chips for 2K * 8 static RAM is required. Note that DATA is read from the 2142 when the output disable OD is low, WE is HIGH, and DATA is written into 2142. If multiple chip selects are available with the static RAM, BHE and A0 may be used directly as the chip selects. A possible configuration for 2K * 8 array is shown in the figure 5.

c) Dynamic RAM Dynamic RAM store information as charges in capacitors. Since capacitors can hold charges for a few milliseconds, refresh circuitry is necessary in dynamic RAMs for DEPT. OF ECE, SITS, KHAMMAM PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing retaining system. provides devices. these charges. Therefore, dynamic RAMs are complex devices to design a To relieve the designer of most of these complicated interfacing tasks, Intel the 8202 dynamic RAM controller as part of the 8086 families of peripheral The 8202 can be interfaced with the 8086 to build a dynamic memory system.

FIGURE 1 8086 MEMORY ARRAY

FIGURE 2 ROM / EPROM INTERFACE TO THE 8086

FIGURE 3 GENERATING CHIP SELECTS FOR STATIC RAMs WITHOUT OUTPUT ENABLES

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing FIGURE 4 2K * 8 STATIC RAM ARRAY FOR THE 8086

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing

FIGURE 5 2K * 8 STATIC ARRAY WITH A0 and BHE AS DIRECT CHIP SELECT INPUTS

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Microprocessors and Interfacing

REVIEW QUESTIONS
1. 2. 3. 4. Explain the pin diagram of 8086 Draw and explain the maximum mode of 8086 Draw and explain the minimum mode of 8086 Draw the input and output timing diagram of maximum mode of operation in 8086 5. Draw the input and output timing diagram of minimum mode of operation in 8086 6. Why and when wait states are required. How do you insert wait states

DEPT. OF ECE, SITS, KHAMMAM

PREPARED BY VENKATESH RACHA

Potrebbero piacerti anche