Introduction to Interrupts of 8085 microprocessor

1,998 views 33 slides Mar 06, 2024
Slide 1
Slide 1 of 33
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

About This Presentation

Interrupt of 8085 microprocessor


Slide Content

Interrupt

Introduction
•Interruptisaprocesswhereanexternaldevicecanget
theattentionofthemicroprocessor.
–TheprocessstartsfromtheI/Odevice
–Theprocessisasynchronous.
•Interruptscanbeclassifiedintotwotypes:
–Maskable(canbedelayed)
–Non-Maskable(cannotbedelayed)
•Interruptscanalsobeclassifiedinto:
–Vectored(theaddressoftheserviceroutineishard-wired)
–Non-vectored(theaddressoftheserviceroutineneedsto
besuppliedexternally)

Introduction
•Aninterruptisconsideredtobeanemergency
signal.
–TheMicroprocessorshouldrespondtoitassoon
aspossible.
–WhentheMicroprocessorreceivesaninterrupt
signal,itsuspendsthecurrentlyexecuting
programandjumpstoanInterruptService
Routine(ISR)torespondtotheincomingInterrupt.
–Eachinterruptwillmostprobablyhaveitsown
ISR.

Responding to interrupt
•Respondingtoaninterruptmaybeimmediateor
delayeddependingonwhethertheinterruptis
maskableornon-maskableandwhether
interruptsarebeingmaskedornot.
•Therearetwowaysofredirectingtheexecution
totheISRdependingonwhethertheinterruptis
vectoredornon-vectored.
–ThevectorisalreadyknowntotheMicroprocessor
–Thedevicewillhavetosupplythevectorto
Microprocessor

8085 Interrupt
•Themaskableinterruptprocessinthe8085is
controlledbyasingleflipflopinsidethe
microprocessor.
•ThisInterruptEnableflipflopiscontrolled
usingthetwoinstructions“EI”and“DI”.
•The8085hasasingleNon-Maskableinterrupt.
–Thenon-maskableinterruptisnotaffectedbythe
valueoftheInterruptEnableflipflop.

8085 Interrupt
•The8085has5interruptinputs.
–TheINTRinput.
–TheINTRinputistheonlynon-vectoredinterrupt.
–INTRismaskableusingtheEI/DIinstructionpair.
–RST5.5,RST6.5,RST7.5areallautomatically
vectored.
–RST5.5,RST6.5,andRST7.5areallmaskable.
–TRAPistheonlynon-maskableinterruptinthe8085
–TRAPisalsoautomaticallyvectored

8085 Interrupt

Interrupt Vector
•AninterruptvectorisapointertowheretheISR
isstoredinmemory.
•Allinterrupts(vectoredorotherwise)aremapped
ontoamemoryareacalledtheInterruptVector
Table(IVT).
–TheIVTisusuallylocatedinmemorypage00(0000H-
00FFH).
–ThepurposeoftheIVTistoholdthevectorsthat
redirectthemicroprocessortotherightplacewhen
aninterruptarrives.
–TheIVTisdividedintoseveralblocks.Eachblockis
usedbyoneoftheinterruptstoholdits“vector”

Non-Vectored Interrupt
1.TheinterruptprocessshouldbeenabledusingtheEI
instruction.
2.The8085checksforaninterruptduringtheexecutionof
everyinstruction.
3.Ifthereisaninterrupt,themicroprocessorwillcomplete
theexecutinginstruction,andstartaRESTARTsequence.
4.TheRESTARTsequenceresetstheinterruptflipflopand
activatestheinterruptacknowledgesignal(INTA).
5.UponreceivingtheINTAsignal,theinterruptingdeviceis
expectedtoreturntheop-codeofoneofthe8RST
instructions.

Non-Vectored Interrupt
6.WhenthemicroprocessorexecutestheRST
instructionreceivedfromthedevice,itsavesthe
addressofthenextinstructiononthestackand
jumpstotheappropriateentryintheIVT.
7.TheIVTentrymustredirectthemicroprocessorto
theactualserviceroutine.
8.TheserviceroutinemustincludetheinstructionEIto
re-enabletheinterruptprocess.
9.Attheendoftheserviceroutine,theRETinstruction
returnstheexecutiontowheretheprogramwas
interrupted.

Restart Sequence
•Therestartsequenceismadeupofthreemachinecycles
–Inthe1stmachinecycle:
•ThemicroprocessorsendstheINTAsignal.
•WhileINTAisactivethemicroprocessorreadsthedatalines
expectingtoreceive,fromtheinterruptingdevice,the
opcodeforthespecificRSTinstruction.
–Inthe2ndand3rdmachinecycles:
•the16-bitaddressofthenextinstructionissavedonthe
stack.
•Thenthemicroprocessorjumpstotheaddressassociated
withthespecifiedRSTinstruction.

Masking
•These three interrupts are masked at two
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.

Hardware of EI

Manipulating the Mask
•TheInterruptEnableflipflopismanipulated
usingtheEI/DIinstructions.
–TheindividualmasksforRST5.5,RST6.5andRST
7.5aremanipulatedusingtheSIMinstruction.
–Thisinstructiontakesthebitpatterninthe
Accumulatorandappliesittotheinterruptmask
enablinganddisablingthespecificinterrupts.

SIM

SIM and Interrupt Mask
•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 ignoredand the old settings remain.
–If it is set to 1, the new setting are applied.
•The SIM instruction is used for multiple purposes and not only for
setting interrupt masks.
–It is also used to control functionality such as Serial Data
Transmission.
–Therefore, bit 3 is necessary to tell the microprocessor whether or
not the interrupt masks should be modified

Triggering Level
•RST7.5ispositiveedgesensitive.
–WhenapositiveedgeappearsontheRST7.5line,alogic1is
storedintheflip-flopasa“pending”interrupt.
–Sincethevaluehasbeenstoredintheflipflop,thelinedoes
nothavetobehighwhenthemicroprocessorchecksforthe
interrupttoberecognized.
–Thelinemustgotozeroandbacktoonebeforeanew
interruptisrecognized.
•RST6.5andRST5.5arelevelsensitive.
•Theinterruptingsignalmustremainpresentuntilthe
microprocessorchecksforinterrupts.

RIM

RIM instruction
•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 flip flops.
–They can be used by a program to read the mask settings
in order to modify only the right mask.
•Bit 3 shows whether the maskable interrupt process is
enabled or not.
–It returns the contents of the Interrupt Enable Flip Flop.
–It can be used by a program to determine whether or not
interrupts are enabled.

RIM instruction
•Bits4-6showwhetherornottherearepending
interruptsonRST7.5,RST6.5,andRST5.5
•Bits4and5returnthecurrentvalueoftheRST5.5and
RST6.5pins.
•Bit6returnsthecurrentvalueoftheRST7.5memoryflip
flop.
•Bit7isusedforSerialDataInput.
•TheRIMinstructionreadsthevalueoftheSIDpinonthe
microprocessorandreturnsitinthisbit.

Trap
•TRAPistheonlynon-maskableinterrupt.
–Itdoesnotneedtobeenabledbecauseitcannot
bedisabled.
–Ithasthehighestpriorityamongstinterrupts.
–Itisedgeandlevelsensitive.
–Itneedstobehighandstayhightoberecognized.
Onceitisrecognized,itwon’tberecognizedagain
untilitgoeslow,thenhighagain.
–TRAPisusuallyusedforpowerfailureand
emergencyshutoff.

Additional Concepts
•ProgrammableInterruptController8259A
–Aprogrammableinterruptmanagingdevice
–Itmanages8interruptrequests.
–Itcanvectoraninterruptanywhereinmemory
withoutadditionalH/W.
–Itcansupport8levelsofinterruptpriorities.
•Thepriorityschemecanbeextendedto64
levelsusingahierarchy0f8259device.

Features
Can manage 8 interrupts
Can be cascaded with another 8259 to
increase the interrupts to 64.
Internal priority resolver.
Individually mask each interrupt request.
Read the status of pending , in-service and the
masked interrupts

8259PIC(programmableinterruptcontroller)

Pin functions
D0-D7 Bidirectionaltri-stated buffered data lines. connected to
data bus directly or through buffers
RD Active low read control
WR Active low write control
A0 Address input lineused to select the control register
CS Active low chip select
CAS0-2 Bi-directional 3 cascaded lines .Inmaster mode , PIC
places slave ID no. on these lines and in slave mode , the
PIC reads slave ID no. from master on these lines. It may
be regarded as slave select
SP/EN Slave program/enable. Innon buffered mode , it is SP
input ,used to distinguish master slave PIC and in buffered
mode ,it is output line used to enable the buffer
INT Interrupt lines, connected to INTR of microprocessor
INTA Interruptacknowledge , received active low from
microprocessor
IR0-7 Interrupt request lines generated by peripherals devices