Академический Документы
Профессиональный Документы
Культура Документы
Session – 24
Prof. Venkataramaiah. P. P
HEAD – Department of
Instrumentation Technology
&
Medical Electronics
M.S.Ramaiah Institute of Technology, Bangalore
Topics to be covered
Session 24 :
22/11/2005 : Interrupt Processing,
Interrupt Vector table,
Hardware Interrupts.
Session 25 :
23/11/2005 : Expanding the Interrupt
Structure
Session 26 :
25/11/2005 : Interrupt Applications
INTERRUPT
The meaning of ‘interrupts’ is to break the sequence
of operation.While the cpu is executing a program,on
‘interrupt’ breaks the normal sequence of execution
of instructions, diverts its execution to some other
program called Interrupt Service Routine (ISR).After
executing ISR , the control is transferred back again
to the main program.
Purpose of Interrupts
03FCH
Available
Interrupts
Type 32 (Available)
(224)
080H
Type 31 (Reserved)
07FH Reserved
Interrupts
(27)
Type 5
0014H Reserved
Interrupt Vector Table
INT Number Physical Address
INT 00 00000
INT 01 00004
INT 02 00008
: :
: :
INT FF 003FC
Example
Find the physical address in the interrupt
vector table associated with
b) INT 12H b) INT 8H
Solution: a) 12H * 4 = 48H
Physical Address: 00048H ( 48 through
4BH are set aside for CS & IP)
b) 8 * 4 = 20H
Memory Address : 00020H
Difference between INT
and CALL instructions
S.No CALL INT
1. Can Jump to any Goes to fixed memory
location with in 1MB location in the interrupt
address range vector table to get address
of ISR
First method:
PUSH F
POP AX
AND AX, 1111 1110 1111 1111 B
PUSH AX
POP F
Second method:
PUSH F
MOV BP,SP
AND 0(BP), OFE FFH
POP F
Setting TF (TF = 1)
NMI
Mov AL , 64
Mov BL , 64 0100 0000 +64
0100 0000 +64
ADD AL , BL
1000 0000 +128
INT 0 ; 0F = 1
INT 0 causes the cpu to perform “INT 04” and
jumps to physical location 00010H of the vector
table to get the CS : IP of the ISR
ADVANCED MICROPROCESSORS
Session – 25
Prof. Venkataramaiah. P. P
HEAD – Department of
Instrumentation Technology
&
Medical Electronics
M.S.Ramaiah Institute of Technology, Bangalore
HARDWARE INTERRUPTS
NMI : Non maskable interrupts
INTR : Interrupt request
Edge triggered
Input
NMI
Level triggered
INTR Input
INTA Response to
INTR input
8086
Hardware Interrupts
Interrupt Priority
Divide Error, INT(n),INTO Highest
NMI
INTR
Single Step Lowest
University Questions
Aug 2005 CSE/ISE (VTU)
R R
B2
7414 B1 Q
5v A1
AC A2
Q
NMI
Opto
74LS122
Isolator Monoshot
The output of the isolator is shaped by
Schmit trigger inverter that provides a
50Hz pulse to the trigger Input of
monoshot.
The value of R & C are chosen so that pulse
width of 2 AC I/P periods.
74LS122’s retriggarable as long as a.c
power is applied Q = 1, Q = 0
If the AC power fails, no trigger pulses to
monoshot hence Q = 0, Q = 1interrupting
the microprocessor
The ISR stores the contents of all internal
registers and other ddc into a battery-
backed up memory
The filter capacitor (normally high), the
voltage decays exponentially provides
energy for the memory after the AC power
ceases.
INTR and INTA
Interrupt request input (INTR) is level
sensitive, it must be held at logic 1 level
until it is recognized.
The microprocessor responds to the INTR
input by pulsing INTA output in
anticipation of receiving an interrupt vector
type number as data bus (D7 – D0)
INTR
LOCK
INTA
8086
74LS244
1G 2G
10 K
INTR
5v
INTA
… .
Pull up resistors
D PR Q INTR
Edge-triggered
Interrupt request
CLK
CR
Reset INTA
RESET signal initially clears the flip-flop
so that no interrupts requested when the
system is powered
Clock input becomes an edge-triggered
interrupt request input
Clear I/P is used to clear the request when
the INTA is output by the microprocessor
Expanding the Interrupt
structure
Using 74LS244 to expand
D7 – D0
8086
8
74LS244
1G 2G
5v
VCC
INTA 10K
..
IR0
INTR IR1
: :
IR7
If any of the IR input becomes a logic 0,
then the output of the NAND gate goes to
logic 1 and requests an interrupt through
INTR input.
IR6 IR5 IR4 IR3 IR2 IR1 IR0 Vector
1 1 1 1 1 1 0 FEH
1 1 1 1 1 0 1 FDH
1 1 1 1 0 1 1 FBH
Bit
D7 = 1
1 1 1 0 1 1 1 F7H
1 1 0 1 1 1 1 EFH
1 0 1 1 1 1 1 DFH
0 1 1 1 1 1 1 BFH
HARDWARE INTERRUPT
APPLICATIONS
D7 – D0 8255
8086
ASCII 5v NMI
Keyboard
Kp
Keyboard data