Interrupts of microprocessor 8085

497 views 36 slides Jul 26, 2021
Slide 1
Slide 1 of 36
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36

About This Presentation

Introduction to Interrupts
What happens when the interrupt is occurs
Interrupt Vs Polling
Classfi�cation of Interrupts
Hardware Interrupts of 8085
Software Interrupts of 8085
Maskable Interrupts of Microprocessor 8085
Non - Maskable Interrupts of Microprocessor 8085
Vectored Interrupts of Micropro...


Slide Content

Interrupts of 8085 Microprocessor
Dr. Nilesh Bhaskarrao Bahadure
https://www.sites.google.com/site/nileshbbahadure/home
July 26, 2021
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 1 / 36

Overview
1
Syllabus
2
Introduction to Interrupts
Introduction to Interrupts
What happen when interrupt is occurs
3
Interrupt Vs Polling
4
Classication of Interrupts
Hardware Interrupts of 8085
Software Interrupts of 8085
Maskable Interrupts of Microprocessor 8085
Non - Maskable Interrupts of Microprocessor 8085
Vectored Interrupts of Microprocessor 8085
Non - Vectored Interrupts of Microprocessor 8085
5
8085 Microprocessor Interrupt Structure
Interrupt Structure of Microprocessor 8085
6
SIM Instruction
Example on SIM Instruction
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 2 / 36

Overview
7
Non - Vectored Interrupt
Restart sequence
8
Pending Interrupts
RIM Instruction
9
Multiple Interrupts
10
Thank You
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 3 / 36

Outline of Interrupts
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 4 / 36

Introduction to Interrupts
Interrupt is a process where an external device can get the attention of the
microprocessor.
1. The process starts from the I/O device2. The process is asynchronous.An interrupt is considered to be an emergency signal that may be serviced.
The Microprocessor may respond to it as soon as possible.
Interrupt is signals send by an external device to the processor, to request
the processor to perform a particular task or work. Mainly in the
microprocessor based system the interrupts are used for data transfer
between the peripheral and the microprocessor. The processor will check
the interrupts always at the 2nd T-state of last machine cycle. If there is
any interrupt it accept the interrupt and send the INTA (active low) signal
to the peripheral
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 5 / 36

What happen when interrupt is occurs
1
When the Microprocessor receives an interrupt signal, it suspends the
currently executing program and jumps to an Interrupt Service
Routine (ISR) to respond to the incoming interrupt.
2
Each interrupt will most probably have its own ISR.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 6 / 36

What happen when interrupt is occurs...
Figure :
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 7 / 36

Interrupt Vs Polling
A single microprocessor can serve several devices. There are two ways to
do that: Interrupts and polling.
Interrupts:In the interrupt method, whenever any device needs its service, the device
noties the microprocessor by sending an interrupt signal, upon receiving
an interrupt signal, the microprocessor interrupts whatever it is doing and
serve the device. The program associated with the interrupt is called the
interrupt service routine (ISR) or interrupt handler.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 8 / 36

Interrupt Vs Polling...
Polling:In polling, the microprocessor continuously monitors the status of a several
devices, when the status condition is met, it perform the service, after that,
it moves on to monitor the next device until each one is serviced. Although
polling can monitors the status of several devices and serve each of them
as certain conditions are met, it is not an ecient use of microprocessor.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 9 / 36

Interrupt Vs Polling...
Figure :
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 10 / 36

Classication of Interrupts
Interrupts are mainly classied into dierent types as follows:
1
Hardware interrupts
2
Software interrupts
3
Maskable interrupts
4
Non - maskable interrupts
5
Vectored interrupts
6
Non - vectored interrupts
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 11 / 36

Hardware Interrupts of 8085
An external device initiates the hardware interrupts and placing an appropri-
ate signal at the interrupt pin of the processor. If the interrupt is accepted
then the processor executes an interrupt service routine.
The 8085 has ve hardware interruptsTRAP
RST 7.5RST 6.5RST 5.5INTRMain Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 12 / 36

Software Interrupts of 8085
The software interrupts are program instructions. These instructions are
inserted at desired locations in a program. Software interrupt are special
instructions supported by microprocessor. After executing of these instruc-
tions microprocessor completes the execution of the current machine cycle
or current operation and then transfers the program control to the subrou-
tine program. Upon completion of the execution of the subroutine program,
program control returns back to the main program from where the micro-
processor has left previously.
The 8085 has eight software interrupts from RST 0 to RST 7. The vector
address for software interrupt RST0 to RST7 can be calculated as follows
Interrupt number * 8 = vector location address
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 13 / 36

Maskable Interrupts of Microprocessor 8085
Maskable interrupts are enabled and disabled under program control. By
setting or resetting particular ip op in the microprocessor, interrupts can
be masked or unmasked respectively. When masked, microprocessor does
not respond to the interrupt even through the interrupt is activated.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 14 / 36

Non - Maskable Interrupts of Microprocessor 8085
In the microprocessor those interrupt which can be masked under software
control are called maskable interrupt whereas the interrupt which cannot
be masked under software control are called unmaskable or non maskable
interrupt. These types of interrupt are specially used in the emergency
shuto.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 15 / 36

Non - Maskable Interrupts of Microprocessor 8085
Figure :
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 16 / 36

Vectored Interrupts of Microprocessor 8085
When interrupt signal is activated, the internal control circuit of micropro-
cessor produces a CALL to a predetermined memory location. This memory
location, where the subroutine i.e. interrupts service routine (ISR) starts is
referred to as vector location and such interrupts are called vectored inter-
rupts.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 17 / 36

Non - Vectored Interrupts of Microprocessor 8085
In response to the interrupt signal, the interrupt service routine address is not
dened by CALL or not produced CALL by microprocessor internally then
it is referred as non vectored interrupt. In this type of interrupt, interrupt
service routine address is generate using external hardware circuitry (buer,
decoder or encoder etc).
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 18 / 36

Interrupt Structure of Microprocessor 8085
Figure :
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 19 / 36

Interrupt Structure of Microprocessor 8085...
Interrupt
Name
Maskable Masking
Method
Vectored Vector
location
Memory Triggering
Method
Priority
INTR
Yes
DI/EI
No{No
Level
Sensi-
tive
5 (Lowest)
RST
5.5
Yes
DI/EI
SIM
Yes
002Ch
No
Level
Sensi-
tive
4
RST
6.5
Yes
DI/EI
SIM
Yes
0034h
No
Level
Sensi-
tive
3
RST
7.5
Yes
DI/EI
SIM
Yes
003Ch
Yes
Edge
Sensi-
tive
2
TRAP
No
None
Yes
0024h
No Level
Edge
Sensi-
tive
1 (Highest)
Table :
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 20 / 36

SIM Instruction
Figure :
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 21 / 36

Example - 1
Example - 1
Set the interrupt masks so that RST5.5 is enabled, RST6.5 is masked, and
RST7.5 is enabled.
Solution
EI ; Enable interrupts including INTRMVI A, 0Ah; Prepare the mask to enable RST 7.5, and 5.5, disable 6.5SIM ; Apply the settings RST masksMain Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 22 / 36

Non - Vectored Interrupt
Example
Explain non-vectored interrupt. Also explain how to generate vector
location for non-vectored interrupt
1
The interrupt process should be enabled using the EI instruction.
2
The 8085 checks for an interrupt during the execution of every
instruction.
3
If INTR is high, MP completes current instruction, disables the
interrupt and sends INTA (Interrupt acknowledge) signal to the device
that interrupted .
4
INTA allows the I/O device to send a RST instruction through data
bus.
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 23 / 36

Non - Vectored Interrupt
5
Upon receiving the INTA signal, MP saves the memory location of
the next instruction on the stack and the program is transferred to
call location (ISR Call) specied by the RST instruction.
6
Microprocessor Performs the ISR.
7
ISR must include the EI instruction to enable the further interrupt
within the program.
8
RET instruction at the end of the ISR allows the MP to retrieve the
return address from the stack and the program is transferred back to
where the program was interrupted.
9
Although INTR is a maskable interrupt, it does NOT need SIM to get
enabled.
Just instruction EI is enough.
The 8085 recognizes 8 RESTART instructions: RST0 - RST7.
Each of these would send the execution to a predetermined hard-wired
memory location:
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 24 / 36

Non - Vectored Interrupt
Restart instruction Equivalent to
RST 0 CALL 0000H
RST 1 CALL 0008H
RST 2 CALL 0010H
RST 3 CALL 0018H
RST 4 CALL 0020H
RST 5 CALL 0028H
RST 6 CALL 0030H
RST 7 CALL 0038H
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 25 / 36

Restart Sequence
1
The restart sequence is made up of three machine cycles
2
In the 1st machine cycle:The Microprocessor sends the INTA signal.
3
While INTA is active the microprocessor reads the data lines
expecting to receive, from the interrupting device, the opcode for the
specic RST instruction.
4
In the 2nd and 3rd machine cycles:the 16-bit address of the next
instruction is saved on the stack.
5
Then the microprocessor jumps to the address associated with the
specied RST instruction.
6
There are 8 dierent RST instructions.
7
Each RST instruction tells the processor to go to a specic memory
address (call location xed)
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 26 / 36

Restart Sequence...
Reading theRST 5instruction
The above example is for generating RST 5:
RST 5's opcode isEF =11101111
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 27 / 36

Restart Sequence...
During the interrupt acknowledge machine cycle, (the 1st machine cycle of
the RST operation):
1
The Microprocessor activates the INTA signal.
2
This signal will enable the Tri-state buers, which will place the value
EFH on the data bus.
3
Therefore, sending the Microprocessor the RST 5 instruction.
The RST 5 instruction is exactly equivalent to CALL 0028H
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 28 / 36

Pending Interrupts
1
Since the 8085 has ve interrupt lines, interrupts may occur during an
ISR and remain pending.
2
Using the RIM instruction, it is possible to can read the status of the
interrupt lines and nd if there are any pending interrupts
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 29 / 36

RIM Instruction
Load the accumulator with an 8-bit pattern showing the status of each
interrupt pin and mask.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 30 / 36

RIM Instruction...
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 31 / 36

RIM Instruction...
1
Bits 0-2 show the current setting of the mask for each of RST 7.5,
RST 6.5 and RST 5.5 .They return the contents of the three mask
ip ops.
2
Bit 3 shows whether the maskable interrupt process is enabled or not.
It can be used by a program to determine whether or not interrupts
are enabled.
3
Bits 4-6 show whether or not there are pending interrupts on RST
7.5, RST 6.5, and RST 5.5 .
4
Bit 7 is used for Serial Data Input.
The RIM instruction reads the value of the SID pin on the
microprocessor and returns it in this bit.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 32 / 36

Multiple Interrupts
1
Microprocessor can be interrupted again before the completion of the
ISR.
2
As soon as the 1st interrupt arrives, all maskable interrupts are
disabled.
3
They will only be enabled after the execution of the EI instruction.
4
If the EI instruction is placed early in the ISR, other interrupt may
occur before the ISR is done.
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 33 / 36

Multiple Interrupts...
There are 8 dierent RST InstructionsMultiple interrupts coming from 8 dierent external devices
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 34 / 36

Multiple Interrupts...
1
How do MPU allow multiple devices to interrupt using the INTR line?
2
The microprocessor can only respond to one signal on INTR at a time.
3
Therefore, we must allow the signal from only one of the devices to
reach the microprocessor.
4
We must assign some priority to the dierent devices and allow their
signals to reach the microprocessor according to the priority.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 35 / 36

Thank you
Please send your feedback at [email protected]
For more details and updates kindly visit
https://sites.google.com/site/nileshbbahadure/home
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - IV (Part - I) July 26, 2021 36 / 36