EKT222 Miroprocessor Systems Lab 5

Similar documents
Interrupt is a process where an external device can get the attention of the microprocessor. Interrupts can be classified into two types:

8085 Interrupts. Lecturer, CSE, AUST

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

PERIPHERAL INTERFACING Rev. 1.0

The due date for submitting this assignment has passed. 1) How many times will the following loop be executed? Depends on the initial value of A

EC2304-MICROPROCESSOR AND MICROCONROLLERS 2 marks questions and answers UNIT-I

Interrupts. by Rahul Patel, Assistant Professor, EC Dept., Sankalchand Patel College of Engg.,Visnagar

Introduction to Assembly Language Programming (Instruction Set) 1/18/2011 1

Types of Interrupts:


Subject Code: Model Answer Page No: /25

(2) Explain the addressing mode of OR What do you mean by addressing mode? Explain diff. addressing mode for 8085 with examples.

Its Assembly language programming

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

INSTRUCTION SET OF 8085

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT I THE 8085 & 8086 MICROPROCESSORS. PART A (2 Marks)

Microprocessor Architecture

MACHINE CONTROL INSTRUCTIONS: 1. EI

The advantages of registers over memory locations are as follows:

8085 INSTRUCTION SET INSTRUCTION DETAILS

EE309: Computer Organization, Architecture and MicroProcessors. sumantra/courses/up/up.html GND HIGH ORDER ADDRESS BUS

2. List the five interrupt pins available in INTR, TRAP, RST 7.5, RST 6.5, RST 5.5.

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

Assembly Language Programming of 8085

EXPERIMENT NO. 1 THE MKT 8085 MICROPROCESSOR TRAINER

S.R.M. INSTITUTE OF SCIENCE & TECHNOLOGY SCHOOL OF ELECTRONICS & COMMUNICATION ENGINEERING

MSMF GATE CENTRE. Sub: MICROPROCESSORS. Time: 50min Date: Marks:33

1 = Enable SOD 0 = Disable SOD. Serial Output Data. Fig.12.9 SIM Instruction Format

UNIT I. Differences between: Microcomputer, Microprocessor and Microcontroller

SAMPLE STUDY MATERIAL

MICROPROCESSOR BASICS AND RELATED TERMS

Micro Processor & Micro Controllers

QUESTION BANK. EE 6502 / Microprocessor and Microcontroller. Unit I Processor. PART-A (2-Marks)

Assembly Language Programming of 8085

Control Unit: The control unit provides the necessary timing and control Microprocessor resembles a CPU exactly.

1. Internal Architecture of 8085 Microprocessor

GATE Exercises on Microprocessors

8/26/2010. Introduction to 8085 BLOCK DIAGRAM OF INTEL Introduction to Introduction to Three Units of 8085

Unit 1 8 BIT MICROPROCESSOR ARCHITECTURE

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

م.م. ماجد عيدان. Introduction to microprocessor and microcomputer

CHAPTER 5 : Introduction to Intel 8085 Microprocessor Hardware BENG 2223 MICROPROCESSOR TECHNOLOGY

1. What is Microprocessor? Give the power supply & clock frequency of 8085?

12-Dec-11. Gursharan Singh Maninder Kaur. Introduction to 8085 BLOCK DIAGRAM OF INTEL Introduction to Introduction to 8085

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

Practical Course File For

LIST OF PROGRAMS. Prg. Name of the Program. 1 Study of Pin Diagram of Study of Architecture of Study of 8085 Kit.

COPYRIGHT IS NOT RESERVED BY AUTHORS. AUTHORS ARE NOT RESPONSIBLE FOR ANY LEGAL ISSUES ARISING OUT OF ANY COPYRIGHT DEMANDS

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER

LABORATORY 1 INTRODUCTION TO 8085 MICROPROCESSOR DEVELOPMENT SYSTEM BOARD

DE60/DC68 MICROPROCESSORS & MICROCONTROLLERS JUN 2015

EEE310 MICROPROCESSORS M. Fatih Tüysüz CHAPTER 7

1. What is microprocessor? It is a program controlled semi conductor device (IC), which fetches, decodes and execute instructions.

ROEVER ENGINEERING COLLEGE

Chapter 1: Basics of Microprocessor [08 M]

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE:

Lecture Note On Microprocessor and Microcontroller Theory and Applications

PERIPHERAL INTERFACING Rev. 1.0

8086 Interrupts and Interrupt Responses:

Architecture of 8085 microprocessor

Digital Control of Electric Drives

AE66/AC66/AT66/ AE108/AC108/AT108 MICROPROCESSORS & MICROCONTROLLERS

1. Internal Architecture of 8085 Microprocessor

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY

Assembly language Programming

UNIT 1 REFERENCE 1 PREPARED BY S.RAVINDRAKUMAR, LECT/ECE, CHETTINAD COLLEGE OF ENGG AND TECH, KARUR

LAB 1 Introduction to 8085 Microprocessor Development System Board

1. Internal Architecture of 8085 Microprocessor

Basics of Microprocessor

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 153) Pass Marks: 24

MICROPROCESSOR B.Tech. th ECE

Counters & Time Delays. Microprocessors & Interfacing 1

Computer Organization

MICROPROCESSOR MICROPROCESSOR. From the above description, we can draw the following block diagram to represent a microprocessor based system: Output

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

ELECTRICAL ENGINEERING

Rotate Instructions in 8085 Microprocessor to Support Traffic control Signal Processes through Assembly Language which to be Taken as Input of 05H

Pin Description, Status & Control Signals of 8085 Microprocessor

DE60/DC68 MICROPROCESSORS & MICROCONTROLLERS JUNE 2013

Vidyalankar T.E. Sem. V [EXTC] Microprocessors and Microcontrollers I Prelim Question Paper Solution V SS (GND)

PERIPHERAL INTERFACING Rev. 1.0

EC1362 Microprocessors & Microcontrollers

GKMCET Lecture plan Code & name of subject: Microprocessors & Microcontrollers Unit no: 1

INSTITUTE OF ENGINEERING AND MANAGEMENT, KOLKATA Microprocessor

XII HSC - BOARD - MARCH

ET2640 Microprocessors

History and Basic Processor Architecture

Chapter 09. Programming in Assembly

CS 1304-MICROPROCESSORS

EEL 4744C: Microprocessor Applications. Lecture 7. Part 1. Interrupt. Dr. Tao Li 1

Reading Assignment. Interrupt. Interrupt. Interrupt. EEL 4744C: Microprocessor Applications. Lecture 7. Part 1


4 Categories Of 8085 Instructions That Manipulate Data

EECE 340 Introduction to Microprocessors w/lab Section A. Term Project Parking Visitor Counter

ME 4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume LECTURE 6

Week 11 Programmable Interrupt Controller

These three counters can be programmed for either binary or BCD count.

Instruction : A command to the microprocessor to perform a given task on specified data. Each instruction has two parts

Module 3. Embedded Systems I/O. Version 2 EE IIT, Kharagpur 1

Instruction set of 8085

Transcription:

LAB 5: Interrupts Objectives: 1) Ability to define interrupt in 8085 microprocessor 2) Ability to understanding the interrupt structure in the 8085 microprocessor 3) Ability to create programs using the interrupt 4) Ability to execute and demonstrate simple instructions 5) Ability to analyze the 8085 register and memory map conditions Equipments: 1. Computer station with Windows OS and MY1 8085 simulation program 2. 8085 Instruction Sets (Assembly Code) 3. 8085 Instruction Sets (Machine Code) Introduction What is an Interrupt? A hardware interrupt is a CPU facility which permits spurious asynchronous events to suspend program execution and instead execute a software module to service the event. The connection to the processor which allows external devices to signal a request for service is called an interrupt pin. The software module that the processor executes in response to an interrupt is called an interrupt service routine (ISR). The interrupt mechanism is such that after completion of the ISR the processor returns to execution of the main program Maskable Interrupt vs Non-maskable Interrupt A non-maskable interrupt will always, if asserted, interrupt the processor. There is no software mechanism to prevent the processor being interrupted by a nonmaskable interrupt. A maskable interrupt, if asserted, will only interrupt the processor if it is enabled ( unmasked ). Maskable interrupts can be enabled ( unmasked ) or disabled ( masked ) by software. Most maskable interrupts automatically become disabled (masked) after an interrupt has occurred. It requires further software commands to re-enable maskable interrupts. 1

Interrupt in 8085 Microprocessor The 8085 microprocessor has five (5) interrupt source input. They are TRAP, RST7.5, RST6.5, RST5.5 and INTR. TRAP is non-maskable and the others are maskable. During reset, all the maskable interrupt are disable, so the microprocessor only responds to TRAP. For maskable interrupt to be effective, it s must be enabled under program control. Only three (3) of this interrupt can be used using our 8085 development system: RST7.5, RST6.5 and RST5.5. The RST6.5 and RST5.5 are level sensitive while RST7.5 is rising edge sensitive. When the microprocessor is interrupted by the external device, it will respond to the interruption by completing their current instruction, saving the program counter of the next instruction to be executed onto the stack and then jumping to the following addresses based on the type of interrupt request. These addresses are located in the ROM space. TRAP RST5.5 RST6.5 RST7.5 0024H 002CH 0034H 003CH Table 1 shows the 8085 Interrupt details in term of interrupt pin, direct/vectored, maskable/non-maskable, address ISR and priority based. Table 1: 8085 Interrupt 2

Two program steps are required to enable the RST7.5, RST6.5, RST5.5 interrupts: Setting the interrupt masks using SIM instruction Enabling all interrupt using EI instruction The SIM instruction is used to implement the masking process of the 8085 interrupts RST7.5, RST6.5 and RST5.5. Figure 1 shows the instruction interprets the accumulator contents. SOD SOE X R7.5 MSE M7.5 M6.5 M5.5 Figure 1: Instruction interprets SOD Serial Output Data: Bit D7 of Accumulator is latched into the SOD output line and made available to serial peripheral if bit D6 = 1 SOE Serial Output Enable: If this bit = 1, it enables the serial output. To implement serial output, this bit needs to be enabled. X Don t care R7.5 Reset RST7.5: If this bit = 1, RST7.5 flip-flop is reset. This is an additional control to reset RST7.5. MSE Mask Set Enable: If this bit is high, it enables the function of bits D2, D1 and D0. This is a master control over all the interrupt masking bits. If this bit is low, bits D2, D1 and D0 do not have any effect on the masks. M7.5 D2 = 0, RST7.5 is enabled D2=1, RST7.5 is masked or disabled M6.5 D1 = 0, RST6.5 is enabled D1=1, RST6.5 is masked or disabled M5.5 D0 = 0, RST5.5 is enabled D0=1, RST5.5 is masked or disabled Note: SOD and SOE are irrelevant for interrupt setting. For example, the following instruction sequence enables RST6.5 and disables RST7.5 and RST5.5: please refer Figure 1 to make sure right settings. z MVI A, 00011010B SIM EI 3

Exercises Connect the circuit as shown in Figure 2 and write the following program. Test the program using the 8085 development system by pressing the pushbutton switch connected to RST6.5. Figure 1: Instruction interprets 4

Example Programming : ORG 0000H JMP START ORG 0034H JMP ISR6_5 START: LXI SP, 3FF0H MVI A, 80H OUT 83H MVI A, 00011101B SIM EI ;1000 0000 B ; b7 mode definition control byte ; b6-b5 00 is for mode 0, basic I/O ; b4 0 Port A as output ; b3 0 Port C upper as output ; b2 0 mode 0 ; b1 0 Port B as output ; b0 0 Port C lower as output ; set data to control register ; set mask 0001 1101 B ; b7-b6 00 is for SOD/SOE - not relevant ; b5 0 n/c = no connection ; b4 1 R7.5 is reset ; b3 0 MSE = Mask setting enabled ; b2 1 M7.5 is enabled ; b1 0 M6.5 is masked or disabled ; b0 1 M5.5 is enabled ; Set interrupt masking ; Enable interrupt START: LXI H, TABLE ; Initialize HL reg to the data table MVI B, 10 ; Set reg B as a counter NEXT: MOV A, M ; Copy data from data table OUT 80H ; send data to PortA@80H CALL DELAY ; call delay INX H ; increment table pointer DCR B ; decrement counter JNZ NEXT ; if counter not zero, do next JMP START ; if coounter zero, start all over again ;define data table byte data TABLE: DFB 00111111B,00000110B, 01011011B, 01001111B, 01100110B DFB 01101101B,01111101B, 00000111B, 01111111B, 01101111B ;continue next pages 5

;delay routine 1 DELAY: MVI D, 5 LOOP1: MVI E, 20 LOOP: DCR E JNZ LOOP DCR D JNZ LOOP1 RET ;delay routine 2 DELAY2: MVI D, 1 LOOP1b: MVI E, 10 LOOPb: DCR E JNZ LOOPb DCR D JNZ LOOP1b RET ; Interrupt Service Routine RST6.5 ISR6_5: PUSH PSW ; store reg AF to stack area PUSH B ; store reg BC to stack area PUSH D ; store reg DE to stack area MVI A, 0 ; inbitialize A reg to 0 MVI B, 15 ; initialize b reg at 15 as counter REPEAT: CMA ; complement the value in A reg OUT 82H ; send data in a reg to Port C@82H CALL DELAY2 ; call delay2 DCR B ; decrement counter B JNZ REPEAT ; do repeat if counter not zero POP D ; retrieve data in stack area to DE reg POP B ; retrieve data in stack area to BC reg POP PSW ; retrieve data in stack area to AF reg EI ; re enable interrupt RET ; return to main program END 6

Task 1. Connect another pushbutton switch to the RST5.5 pin. Modify your existing program to make the LED blink 20 times when the pushbutton switch is pressed. 7