Beruflich Dokumente
Kultur Dokumente
Er Sanjeev Goyal
Sr Lect ECE
GPC,Bathinda
17/04/2013
INTRODUCTION
Interrupt is a process where an external
INTRODUCTION
What happens when MP is interrupted ?
When the Microprocessor receives an
Interrupts in 8085
When the interrupt signal arrives:
The processor will break its routine
Interrupts
In order to executein
an 8085
interrupt routine, the
processor:
Should be able to accept interrupts (interrupt
enable)
17/04/2013
Interrupts
in 8085
Interrupts increase
processor system
efficiency by letting I/O device request CPU
time only when that device needs immediate
attention.
An interrupt is a subroutine call initialized by
external hardware.
The request is asynchronous it may
occur at any point in a programs execution.
17/04/2013
Interrupts in 8085
INTA
Interrupt
Save
program
counter
Disable
interrupts
Main routine
Go to
service
routine
Go back
Get
original
program
counter
17/04/2013
Send out
interupt
acknowledg
e
EI
RET
Service routine
CLASSIFICATION OF
INTERRUPTS
Rejected)
Non-Maskable Interrupts (Can not be
delayed or Rejected)
Interrupts can also be classified into:
Vectored (the address of the service
routine is hard-wired)
Non-vectored (the address of the
service routine needs to be supplied
externally by the device)
17/04/2013
CLASSIFICATION OF
INTERRUPTS
Nonmaskable interrupt input
The MPU is interrupted when a logic
17/04/2013
10
Response to Interrupt
Responding to an interrupt may be
17/04/2013
11
Response to Interrupt
There are two ways of redirecting the
17/04/2013
12
Response to Interrupt
1. The processing of the current instruction is
completed.
2. An interrupt machine cycle is executed
during which the PC is saved and control is
transferred to an appropriate memory
location.
3. The state of the MPU is saved.
4. If more than one I/O device is associated
with the location transferred to, the highest
priority device requesting an interrupt is
identified.
17/04/2013
13
Response to Interrupt
5. A subroutine is executed which services
17/04/2013
14
17/04/2013
15
8085 INTERRUPTS
The EI instruction is a one byte
16
8085 INTERRUPTS
The 8085 has 5 interrupt inputs.
The INTR input.
The
17
8085 INTERRUPTS
TRAP is the only non-maskable interrupt in
the 8085
TRAP is also automatically vectored
Interrupt
Name
17/04/2013
Maskable
Vectored
INTR
Yes
No
RST 5.5
Yes
Yes
RST 6.5
Yes
Yes
RST 7.5
Yes
Yes
TRAP
No
Yes
18
8085 INTERRUPTS
TRAP
RST7.5
RST6.5
RST 5.5
INTR
INTA
17/04/2013
8085
19
Vectored Interrupts
An interrupt vector is a pointer to where the
17/04/2013
20
Vectored Interrupts
There are four interrupt inputs in 8085 that
transfer the operation immediately to a
specific address:
TRAP : go to 0024
RST 7.5: go to 003C
RST 6.5 0034
RST 5.5 002C
21
Vectored Interrupts
Finding the address of these vectored
interrupts are very easy .Just multiply 8 with
the RST value i.e for RST 7.5 the
subroutine(ISR) address=8*7.5=60=(3c)H.
For TRAP ,its RST value is 4.5,then the
subroutine address is 8*4.5=36=(24)H.
similarly u can calculate for other vector
interupt addresses.
Memory page for all interrupts are (00).
17/04/2013
22
Vectored Interrupts
17/04/2013
23
levels:
Through the Interrupt Enable flip flop and
the EI/DI instructions.
The Interrupt Enable flip flop controls the
whole maskable interrupt process.
Through individual mask flip flops that
control the availability of the individual
interrupts.
These flip flops control the interrupts
individually.
17/04/2013
24
MASKABLE INTERRUPTS
RST7.5 Memory
RST 7.5
M 7.5
RST 6.5
M 6.5
RST 5.5
M 5.5
INTR
Interrupt
Enable
Flip Flop
17/04/2013
25
Punjab
Edusat society
Maskable/Vectored Interrupt
Process
1. The interrupt process should be enabled
26
Maskable/Vectored Interrupt
Process
27
Maskable/Vectored Interrupt
Process
7. The service routine must include the
17/04/2013
28
Maskable/Vectored Interrupt
Process
The Interrupt Enable flip flop is
29
SIM Instruction
17/04/2013
30
SIM Instruction
Bit 0 is the mask for RST 5.5, bit 1 is the mask
for RST 6.5 and bit 2 is the mask for RST 7.5.
If the mask bit is 0, the interrupt is available.
If the mask bit is 1, the interrupt is masked.
Bit 3 (Mask Set Enable - MSE) is an enable for
setting the mask.
If it is set to 0 the mask is ignored and the
old settings remain.
If it is set to 1, the new setting are applied.
17/04/2013
31
SIM Instruction
Bit 4 of the accumulator in the SIM
17/04/2013
32
SIM Instruction
Example: Set the interrupt masks so that RST5.5
First,
the
- Enable
5.5 determine
bit 0
= 0 contents of the accumulator
- Disable 6.5
- Enable 7.5
- Allow setting the masks
- Dont reset the flip flop
- Bit 5 is not used
- Dont use serial data
- Serial data is ignored
EI
MVI A, 0A
SIM
17/04/2013
bit 1 = 1
bit 2 = 0
bit 3 = 1
bit 4 = 0
bit 5 = 0
bit 6 = 0
bit 7 = 0
33
Triggering Levels:
34
35
36
RST (internal)
((SP) 1) (PCH)
((SP) 2) (PCL)
(SP) (SP) 2
(PC) restart address
17/04/2013
37
38
39
17/04/2013
40
Non-Vectored
Interrupt
17/04/2013
41
Punjab
Edusat society
RST0
CALL 0000H
RST1
CALL 0008H
RST2
CALL 0010H
RST3
CALL 0018H
RST4
CALL 0020H
RST5
CALL 0028H
RST6
CALL 0030H
RST7
CALL 0038H
17/04/2013
42
43
44
45
INTERRUPT ACKNOWLEDGE
(INA) Machine Cycle
INTR ( 0 =< n =< 7 )
RST n
((SP) 1) (PCH)
((SP) 2) (PCL)
(SP) (SP) 2
(PC) 8*n
17/04/2013
46
INTR Interrupt
The microprocessor checks the INTR line
47
INTR Interrupt
In
48
INTR Interrupt
The Programmable Interrupt Controller
(PIC) functions as an overall manager in an
Interrupt-Driven system environment. It
accepts requests from theperipheral
equipment, determines which of the incoming requests is of the highest priority.
The 8259A is a device specifically designed
for use in real time, interrupt driven
microcomputer systems.
17/04/2013
49
INTR Interrupt
It manages eight levels or requests and has
built in features for expandability to other
8259A's (up to 64levels). It is programmed
by the system's softwareas an I/O peripheral.
Each peripheral device usually has a special
program or ``routine'' that is associated with
its specific functional or operational
requirements; this is referred to as a
``service routine''.
17/04/2013
50
INTR Interrupt
The PIC,after issuing an Interrupt to the
17/04/2013
51
INTR Interrupt
17/04/2013
52
17/04/2013
53
RIMshowing
instruction:
Readpin and
the status of each interrupt
mask.
Interrupt Mask
RST 7.5
RST7.5 Memory
M 7.5
2 1
SDI
P7.5
P6.5
P5.5
IE
M7.5
M6.5
M5.5
7 6 5 4
RST 6.5
M 6.5
RST 5.5
M 5.5
Interrupt Enable
Flip Flop
17/04/2013
54
Punjab
Edusat society
2 1
SDI
P7.5
P6.5
P5.5
IE
M7.5
M6.5
M5.5
7 6 5 4
Serial Data In
RST5.5 Interrupt Pending
RST6.5 Interrupt Pending
RST7.5 Interrupt
Pending
17/04/2013
55
Punjab
Edusat society
RST5.5 Mask
RST6.5 Mask
RST7.5
Mask
0 - Available
1 - Masked
Interrupt Enable
Value of the Interrupt Enable
Flip Flop
56
17/04/2013
57
58
59
60
61
Maskable
Masking
Method
Vectored
Memory
Triggerin
g Method
INTR
Yes
DI / EI
No
No
Level
Sensitive
Yes
DI / EI
SIM
Yes
No
Level
Sensitive
Yes
DI / EI
SIM
Yes
Yes
Edge
Sensitive
No
Level &
Edge
Sensitive
RST 5.5 /
RST 6.5
RST 7.5
TRAP
No
None
Yes
62