Unit 3 Timing and Interrupts
Unit 3 Timing and Interrupts
AD15 – AD0 These are 16 address/data bus. AD0-AD7 carries low order byte data and AD8AD15
carries higher order byte data. During the first clock cycle, it carries 16-bit address a
after that it carries 16-bit data.
A16 – A19 These are the 4 address/status buses. During the first clock cycle, it carries 4-bit
address and later it carries status signals.
Clock Clock signal is provided through Pin-19. It provides timing to the processor for
operations. Its frequency is different for different versions, i.e. 5MHz, 8MHz and 10MH
S7/BHE BHE stands for Bus High Enable. It is available at pin 34 and used to indicate the
transfer of data using data bus D8-D15. This signal is low during the first clock cycle,
thereafter it is active.
Read(RD) It is available at pin 32 and is used to read signal for Read operation.
𝐑𝐞𝐚𝐝𝐲 It is available at pin 32. It is an acknowledgement signal from I/O devices that data is
transferred. It is an active high signal. When it is high, it indicates that the device is
ready to transfer data. When it is low, it indicates wait state.
RESET It is available at pin 21 and is used to restart the execution. It causes the processor t
immediately terminate its present activity. This signal is active high for the first 4 clo
cycles to RESET the microprocessor.
LE It stands for address enable latch and is available at pin
25. A positive pulse is generated each time the processor
begins any operation. This signal indicates the availability
of a valid address on the address/data lines.
S0, S1, S2 These are the status signals that provide the status of operation, which is used by the Bus Controller 8288 to
generate memory & I/O control signals. These are available at pin 26, 27, and 28.
LOCK When this signal is active, it indicates to the other processors not to ask the CPU to leave the system bus. It is
activated using the LOCK prefix on any instruction and is available at pin 29.
RQ/GT1 and RQ/GT0 These are the Request/Grant signals used by the other processors requesting the CPU to release the system bus.
When the signal is received by CPU, then it sends acknowledgment. RQ/GT0 has a higher priority than RQ/GT1.
here are some conditions for
QS0 and QS1. These
conditions are as follows.
S0 QS1 Status
0 0 No operation
1 1 Subsequent byte
from the queue
2 S1 S0 Status
0 0 0 Interrupt acknowledgement
0 0 1 I/O Read
0 1 0 I/O Write
0 1 1 Halt
1 0 0 Opcode fetch
1 0 1 Memory read
1 1 0 Memory write
Explanation in steps:
1.When the processor is ready to initiate the bus
cycle , it applies a pulse to ALE during T1. Before
the falling edge of ALE, address , BHE’, DEN’, and
DT/R’ must be stable, i.e DEN = high, DT/R’ =0 for
input or 1 for output
2.During T2 address signals are disabled and S3 –
S7 are available on the AD16/S3 – AD19/S7 and
BHE’/S7.DEN’ = 0 to enable the transceiver.
3.For input operation, RD’ is active during T2 and
AD0 to AD15 go high impedance for input
4. If memory or I/O interface can perform the
transfer immediately , there is no wait state and
data is output on the bus during T3.
5. After the data is accepted by the processor, RD’
is raised high at the beginning of T4
6. For the output operation ,processor applies WR’
=0 and then the data on the data bus during T2.
7. In T4 WR’ is raised high and data signal are
disabled.
UNIT – IV
1.Basic Interrupt Processing, Hardware Interrupts.
1. Explain the purpose of Interrupts
2. Explain hardware interrupts of 8086 microprocessor.
3. Explain software interrupts of 8086 microprocessor.
4. With a neat circuit explain the NMI interrupt activation for AC
power failure.
5. Explain the operation of software interrupt instructions INT, INTO,
INT 3, and BOUND
6. Differentiate between INTR and NMI.
7. Explain INTR and INTA with timing diagram.
8. Explain power failure detection circuit using NMI interrupt
9. Explain the action taken by 8086 microprocessor when an
interrupt occurs. Explain the interrupt vector table
•The Purpose of Interrupts
• Interrupts are useful when interfacing I/O devices
at relatively low data transfer rates, such as
keyboard inputs
• Interrupt processing allows the processor to
execute other software while the keyboard
operator is thinking about what to type next.
• When a key is pressed, the keyboard encoder
debounces the switch and puts out one pulse that
interrupts the microprocessor.
•Interrupts
• Intel processors include two hardware pins (INTR and
NMI) that request interrupts…
A hardware pin (INTA) to acknowledge the interrupt
requested through INTR.
• Flag bits IF (interrupt flag) and TF (trap flag), are also
used with the interrupt structure and special return
instruction IRET
•Interrupt can divide to five groupe:
1. hardware interrupt
2. Non-maskable interrupt
3. Software interrupt
4. Internal interrupt
5. Reset
•Intel Dedicated Interrupts
1.Type 0 The divide error whenever the result from
a division overflows or an attempt is made to
divide by zero.
Whenever the NMI input is activated, a type 2 interrupt (Single-step or trap if the trap (TF) flag bit is
set). occurs because NMI is internally decoded.
The INTR input must be externally decoded to select a vector.
ny interrupt vector can be chosen for the INTR pin, but usually use an interrupt type
number between 20H and FFH.
but it is an output that is used in response to the INTR input to apply a vector type
number to the data bus connections D7–D0. Figure 12–5 shows the three user
interrupt connections on the microprocessor.
Hardware Interrupt Request Pin (INTR )
he non-maskable interrupt (NMI) is an edge-triggered input that
requests an interrupt
On the positive edge (0-to-1 transition).
After a positive edge, the NMI pin must remain a logic 1 until it is recognized by the
microprocessor.
The NMI input is often used for parity errors and other major system faults, such as
power failures.
Power failures are easily detected by monitoring the AC power line and causing an
NMI interrupt whenever AC power drops out.
In response to this type of interrupt, the microprocessor stores all of the internal
register in a battery-backed-up memory or an EEPROM.
Figure 12–6 shows a power failure detection circuit that provides a logic 1 to the NMI
input whenever AC power is interrupted.
In this circuit, an optical isolator provides isolation from the AC power line.
The output of the isolator is shaped by a Schmitt-trigger inverter that provides a 60
Hz pulse to the trigger input of the 74LS122 retriggerable, monostable multivibrator.
The values of R and C are chosen so that the 74LS122 has an active pulse width of 33
ms or 2 AC input periods.
Because the 74LS122 is retriggerable, as long as AC power is
applied, the Q output remains triggered at a logic 1 and remains a
logic 0. ]
If the AC power fails, the 74LS122 no longer receives trigger
pulses from the 74ALS14, which means that Q becomes a logic 0
and becomes a logic 1, interrupting the microprocessor through
the NMI pin.
The interrupt service procedure, stores the contents of all internal
registers and other data into a battery-backed-up memory. This
system assumes that the system power supply has a large enough
filter capacitor to provide energy for at least 75 ms after the AC
power ceases.
UNIT 4
Memory, I/O and Peripheral Interfacing:
Address decoding,
memory interfacing for 8086,
I/O port address decoding,
Study of 8255 PPI and related programs
SELECTION CONNECTION
RAM has CS’ and ROM has CE’ these 2 pins are low memory device
performs a reads and write operation.
Control inputs :
ROM : OUTPUT ENABLE OC’ OR GATE G:which allows data to flow output
pins of ROM .
If OE’ AND CE’ ARE ACTIVE ,, THE OUTPUT IS ENABLE
IF OE’ IS INACTIVE , THEN OUTPUT PINS ARE DISABLED
RAM has three control signal
The output enable signal OE’ allows the selected data value
be driven on the data bus.
Chip Enable CE’ which is used to address or select this
particular memory chip
The WRITE ENABLE signal WE’, which, when set low,
indicates that you are writing to the RAM chip.
OE’ must be active to perform read operation
If 64kbyte EPROM
Then 2^6 1Kbyte= 2^6 x 2^10 = 2^16 byte
therefore for 64KB= address line is 16
If 32kbyte EPROM
An 8-bit-wide memory device is often called a byte-wide
memory.
t is often listed as a 1K 8
1K
8 bits
ADDRESS DECODING
WHY Decoding of address is necessary
― to attach a memory device to the microprocessor.
― It allows the microprocessor to address a single
address within a block of Memory or Input/ Output.
―It can access the data stored in the memory by
specifying its address
FFFFFH EROM
1. Design an 8086 based system to interface with
2K byte EPROM. Use NAND gate for address
decoding. Memory Map 2K x 8 EPROM
C B A
A A A A A A A A A A A A A A A A A A A A
19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
FF800H -TO
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
FFFFFH
xample:
23 x 1K = 23 x 210 = 213 B
1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1
F0000H -TO F1FFFH
1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
F2000H to F3FFFH
ABC are input select lines which are connected to
A13,A14,A15
G1= Input G1 is connected directly to A16.
G2B: When all three address inputs (A17 A18 A19) are high, the
output of this NAND gate goes low and enables input G2B of
the 74LS138.
G2A is grounded.
EPROM
DECODER
Select lines
Enable
Inputs
Design
When the 8K × 8 EPROM is used,
Address connections A12–A0 of the 8086 are connected to address
inputs A12–A0 of the EPROM.
The remaining nine address pins (A19–A13) are connected to the inputs
of 3-8 line decoder
8K x 8 EPROM.
= 23 x 1K = 23 x 210 = 213 B
2B: When all three address inputs (A17 A18 A19) are high, the output
of this NAND gate goes low and enables input G2B of the
74LS138.
10–4 8086 (16-Bit) MEMORY
INTERFACE
8086 has data bus is 16 bits M/IO
pin is used.
Separate Bank Write
Strobes
The effective way to handle bank selection
is a separate write strobe for each bank.