1. what is interrupt? explain in detail classification of
TRANSCRIPT
Unit–V 8085 Interrupts
1 Dept: CE MALP(3330705) Prof. Chintan N. Kanani
1. What is interrupt? Explain in detail classification of interrupt? Interrupt એ એક પ્રકાયની પ્રોસેસ છે. જભેાાં processor અને I/O device લચ્ચે data
transfer થામ છે. કોઈ instruction ના execution અથલા તો કોઈ external હાર્ડલેય ડર્લાઈસ જ ેડસગ્નર જનયટે
કય ેતેના કાયણે જ ેઈલેન્ટ જનયટે થામ તેને Interrupt કહેલાભાાં આલે છે. જમાય ે Interrupt આલ ેછે. ત્માય ેprocessor નીચે ભુજફના સ્ટે follow કય ેછે:
(1) Current instruction ને complete કય ેછે અને current પ્રોગ્રભને સસ્ેન્ર્ કય ેછે. (2) Next instruction નુાં એર્ર ેસ stack ભાાં સ્ટોય કય ેછે. (3) Interrupt Service Routine (ISR) ય jump કય ેછે. જ ેનેસેસયી data transfer કય ે
છે. એટરે કે device ને service ૂયી ારે્ છે. (4) ત્માયફાદ stack ભાાંથી address ભેલીને સસ્ેન્ર્ થમેરા પ્રોગ્રાભ ને resume કયળ.ે
Classification of Interrupt:- Interrupt ને ભુખ્મત્લે ફે કેટેગયીભાાં divide કયી ળકામ છે.
(1) Software Interrupt
(2) Hardware Interrupt
Processor જ ેspecial instruction supprot છે. તેને કાયણે software Interrupt જનયટે થામ
છે. Example-RST instruction in 8085. 8085 પ્રોસેસયની Interrupt pin ય ડસગ્નર ભોકરીને હાર્ડલેય Interrupt જનયટે કયી ળકામ છે. 8085 પ્રોસેસય એ five Interrupt ીન ને supprot કય ે છે જલેી કે TRAP, RST 7.5, RST
6.5, RST 5.5 અને INTR. Hardware Interrupt ને ફે બાગભાાં લહેચી ળકામ.
(1) Maskable
(2) Non-Maskable
Maskable Interrupt ને પ્રોસેસય દ્વાયા ડર્સેફર કયી ળકામ છે. ણ Non-Maskable Interrupt
ને ડર્સેફર કયી ળકતુાં નથી. 8085 ભાાં TRAP એ Non-Maskable Interrupt છે. TRAP, RST 7.5, RST 6.5, RST 5.5 અને INTR એ Maskable Interrupt છે.
2. How to Enabling and Disabling Interrupt?
8085 Interrupt
8085 ભાાં EI અને DI instruction દ્વાયા interrupt ને ઈનેફર અને ર્ીસેફર કયી ળકામ છે. આ instruction લરે્ ચાય maskable interrupt જલેા કે RST 7.5, RST 6.5, RST 5.5 અને
INTR ને ઈનેફર અને ડર્સેફર કયી ળકામ છે.
Unit–V 8085 Interrupts
2 Dept: CE MALP(3330705) Prof. Chintan N. Kanani
આ પ્રકાયની instruction થી non-maskable interrupt જલેુાં કે TRAP ય કાાંઈ પેય ર્તો
નથી. (1) EI (Enable Interrupt)
આ instruction લરે્ 8085 ભાઈક્રોપ્રોસેસયની interrupt system ને enable કયી ળકામ છે. જમાય ેEI instruction નુાં execution થતુાં હોઉ ત્માય ેફીજુ કોઈ interrupt recognized થતુાં
નથી. (2) DI (Disable Interrupt)
આ instruction લરે્ 8085 ભાઈક્રોપ્રોસેસયભાાં interrupt system disable કયી ળકામ છે. DI instruction ના execution સભમે ફીજા કોઈ ણ interrupt recognized થઈ ળકતા
નથી. જમાય ે કોઈ interrupt આલે છે ત્માય ે પ્રોસેસય ોતાનુાં currrent status save કય ે છે અને
interrupt service routine ય jump કય ેછે. Interrupt service routine નુાં execution complete કમાડ ફાદ કાંટર ોર ાછો interrupt
પ્રોગ્રાભ ય જામ છે. આ પ્રોસેસને કાયણે time delay લધી જામ છે જ ેtime sensitive એપ્રીકેળન જલેી કે real
time system ભાાં ઉમોગી થઈ ળકતુાં નથી.
આ પ્રોબ્રેભને દૂય કયલા ભાટે, કોઈ application program ભાાં જમાય ેcritical section run થતો હોઈ ત્માય ેinterrupt ને disable કયી દેલુાં જોઈએ.
જમાય ેcritical section નુાં execution complete થામ ત્માય ેાછુ interrupt ને enable
કયી દેલુાં જોઈએ. DI : disable interrupts … … critical portion … of the program … … EI : enable interrupts
3. Write down the steps which perform by microprocessor when Interrupt Occurs.
જમાય ેહાર્ડલેય pin ય કોઈ valid હાર્ડલેય ડસગ્નર જનયટે થામ અને કોઈ interrupt આલે ત્માય ે
8085 એ નીચે ભુજફના સ્ટેપ્સ perform કય ેછે: (1) 8085 ભાાં કોઈ instruction end થતી હોઈત્માય ે દયકે machine cycle ય હાર્ડલેય
interrupt check કયલાભાાં આલે છે.
Unit–V 8085 Interrupts
3 Dept: CE MALP(3330705) Prof. Chintan N. Kanani
(2) જો કોઈ valid signal આલેરુાં હોઈ તો, (a) જો તે TRAP signal હોઈ તો, પ્રોસસેય next instruction નુાં address save કયીન ે
કોઈ સ્ેસીડપક રોકેળન ય જમ્ કય ેછે અને ISR ને execution or execute કય ેછે. અને ત્માયફાદ original પ્રોગ્રાભને resume કય ેછે.
(b) જો TRAP ડળલામના કોઈ ડસગ્નર જલેા કે RST 7.5, RST 6.5, RST 5.5 અને
INTR આલે તો, (i) જો interrupt ઈનેફર હોઈ તો પ્રોસેસય next address save કયી કોઈ
સ્ેડકડપક રોકેળન ય જમ્ કય ે છે અને ISR ને execute કય ે છે. ત્માયફાદ
original પ્રોગ્રાભને resume કય ેછે. (ii) જો interrupt enable ના હોઈ તો ignored કયી દે છે.
4. Explain RST Instruction in 8085. RST instruction નુાં પોયભેટ આકૃડતભાાં દળાડલેરુાં છે.
D7 D6 D5 D4 D3 D2 D1 D0
1 1 n n n 1 1 1
અહીાં, Restrart instruction એ n ની value ને operand તયીકે રે છે. n ની value 0 થી 7 ભાાં કોઈ ણ હોઈ ળકે છે.
જમાય ેRestrart instruction execute થામ છે ત્માય ેતે સૌપ્રથભ next instruction નુાં address stack ભાાં save કય ેછે અને n ની value ને 8 લરે્ multiplied કયી જ ેlocation ભે તેના ય
જમ્ કય ેછે. D3, D4, D5 ની value એ 3-bit binary no. લરે્ replace કયલાભાાં આલે છે.
Instruction Binary Code OPCODE(Hex) Jump Location
RST 0 11000111 C7h 0000h
RST 1 11૦૦1111 CFh 0008h
RST 2 11010111 D7h 0010h
RST 3 11011111 DFh 0018h
RST 4 11100111 E7h 0020h
RST 5 11101111 EFh 0028h
RST 6 11110111 F7h 0030h
RST 7 11111111 FFh 0038h
Software Interrupt using RST:-
Unit–V 8085 Interrupts
4 Dept: CE MALP(3330705) Prof. Chintan N. Kanani
ફે subsequent RST instruction ના જમ્ રોકેળન જોતા ભારૂભ રે્ છે કે તેની લચ્ચે પક્ત 8-byte નુાં
જ distance છે. જભેાાં ISR રખી ળકામ નડહ. આ પ્રોબ્રેભને solve કયલા ભાટે ISR ને ફીજા કોઈ location ય રખલાભાાં આલે છે. Actual ભાાં જ્ાાં ISR રખામેરુાં હોઈ છે ત્માાં હોાંચલા ભાટે આણે jump instruction નો ઉમોગ
કયી ળકીએ છીએ અને ISR ને run કયી ળકીએ છીએ. For Example,
; mainline program
2000h 0018h jmp 4000h; RST 3 location ;ISR
4000h
(INTERRUPT SERVICE ROOTINE)
આકૃડતભાાં દળાડવ્મા પ્રભાણે mainline program નુાં starting location 2000h છે. અને RST 3 instruction ધયાલ ેછે.
RST 3 નુાં jump location 0018h છે. જ ેJMP 4000h instruction ધયાલ ેછે. જથેી actual ISR એ 4000h ય રખરેુાં હોઈ છે.
- - - - - - - - -
- - - - - - - - -
- - - - - - - - -
RST 3
- - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - -
- - - - - - - - -
EI
RET
Unit–V 8085 Interrupts
5 Dept: CE MALP(3330705) Prof. Chintan N. Kanani
તેથી જમાય ેmainline program execute થતો હોઈ અને જમાય ેRST 3 instruction આલે
ત્માય ે0018h ય જામ છે. જ્ાાં JMP 4000h રખરે છે અને કાંટર ોર 4000h ય ટર ાન્સપય થામ છે
અને ISR ને run કય ેછે. ત્માયફાદ કાંટર ોર ાછો mainline program ભાાં ટર ાન્સપય થામ છે. Hardware Interrupt Useing RST:-
8085 પ્રોસેસય એ દયકે instruction run કમાડ ફાદ interrupt pin ચેક કય ેછે. જો interrupt pin ય valid signal આલરે હોઈ તો તે ISR ને run કય ેછે.અને ત્માયફાદ next
cycle ભાાં તે એકનોરજેભેન આે છે. 8085 ભાાં જમાય ેhardware interrupt આલે છે ત્માય ેપ્રોસેસય current program ને stop કયી
દે છે. interrupt ીન ને ડર્સેફર કયી દે છે. અને ISR ય jump કય ેછે. અહીાં interrupt ીન ને ડર્સફેર એટરા ભાટે કય ેકયલાભાાં આલે છે. કાયણ કે ISR run થતુાં હોઈ ત્માય ેફીજુ
કોઈ interrupt આલે નડહ.
Unit–V 8085 Interrupts
6 Dept: CE MALP(3330705) Prof. Chintan N. Kanani
5. Explain in detail 8085 vector interrupt. 8085 એ પ ાંચ interrupt ઈનપટુ pins પ્રોવાઈડ કરે છે. જે I/O device યસુ કરે છે. અને
8085 ને hardware સસગ્ન ના સ્વરૂે interrupt આે છે. તેમાાં TRAP, RST 7.5, RST 6.5, RST 5.5 and INTR નો સમાવેશ થાય છે. TRAP એ non-maskable છે અને તેને disable કરી શકાય નહિ. ફાકીના ચાર interrupt એ maskable છે જેને disable કરી શકાય છે. જયારે interrupt આવે છે, જે location ર jump થાય છે અને control transfer થાય છે તેન ે
vector addresses અથવા jump location કિવેામા આવે છે. આ location TRAP, RST 7.5, RST 6.5, RST 5.5 and INTR માટે હપક્ષ છે. જે નીચ ેના ટેફ મા
દશાાવે છે. Interrupt Vector address Priority
TRAP 0024h 1
RST 7.5 003Ch 2
RST 6.5 0034h 3
RST 5.5 002Ch 4
INTR Provided by external hardware 5
અિી તેના vector હપક્ષ છે તે INTA̅̅ ̅̅ ̅̅ ̅ નો use કરતા નથી. INTR ન ુvector address એ external hardware દ્વારા RST અથવા CALL નો ઉયોગ કરીને
આવામાાં આવે છે. તફ ેમા દશાાવે છે કે TRAP ની priority ફધા કરતા highest છે.
6. Explain in detail RIM and SIM RIM:- Read Interrupt Mask
B7 B6 B5 B4 B3 B2 B1 B0
SID I7 I6 I5 I4 IE 6.5 5.5
Pending Interrupts: 1=Pending Interrupts Mask: 1=Masked Serial Data Input, if any Pending Interrupts flag: 1= Enable
(Format at read interrupt mask)
આ Instruction દ્વાયા accumlator ભાાં interrupt નુાં current status load કયી ળકામ છે, interrupt enable કયી ળકામ છે. અને ેન્ર્ી ાંગ interrupt અને serial data ણ load કયી ળકામ છે.
આકૃડતભાાં દળાડવ્મા પ્રભાણે lower 3-bits એ RST 5.5, RST 6.5 અને RST 7.5 નુાં કયન્ટ status આ ે
Unit–V 8085 Interrupts
7 Dept: CE MALP(3330705) Prof. Chintan N. Kanani
છે means કે તે enable છે કે disable તે જાની ળકામ છે. ત્માય છીનુાં bit એ પ્રોસેસયના interrupt system નુાં status આે છે. EI instruction દ્વાયા flag 1
set કયી ળકામ છે અને DI instruction દ્વાયા flag ને પયીથી યીસેટ કયી ળકામ છે. ત્માય છીના ત્રણ bit એટરે કે B4, B5, B6 ને RST 5.5, RST 6.5 અને RST 7.5 ના ેન્ર્ી ાંગ status
આે છે. રીસ્ટ ફીટ એ પ્રોસેસય ાસથેી ભેલેર SID એટરે કે serial Input data છે.
SIM (Set Interrupt Mask) આ instruction દ્વાયા આને accumalator ભાાંથી કન્ટેન્ટને read કયી ળકીને છીએ અને એ
પ્રભાણે interrupt ને enable કે disable કયી ળકીએ છીએ. આકૃડતભાાં દળાડવ્મા પ્રભાણે higher two bits એ serial I/O ભાટે લયામ છે. Bit B4 એ RST 7.5 ભાટે એડર્ળનર કાંટર ોર છે. જ ેB4 ની value 1 થામ છે RST 7.5 એ
disable થામ. Bit-3 એ control bit તયીકે કાભ કય ેછે. જો bit-0,1,2 ની value 0 set થામ તો તેને corresponding interrupt enable થામ છે અને
જો તેની value-1 set થામ તો interrupt disable થામ છે.