8085 microprocessor manual

69
INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGY MICROPROCESSOR AND INTERFACING INDEX Sr . No . Title Page no. Grade Signat ure 1. Introduction to DYNA-8085 microprocessor kit & its features 2. Programming problems on Data Transfer 3. Programming problems on Arithmetic Operations 4. Programming problems on Looping techniques 5. Programming problems on Time Delay and Counters 6. Programming problems on Stack, Subroutines and Interrupts 7. To interface 8255 study card with 8085 microprocessor 8. To interface 8253 study card with 8085 microprocessor 9. To interface 8257 study card with 8085 microprocessor [3]

Upload: aced123

Post on 27-Oct-2015

336 views

Category:

Documents


3 download

DESCRIPTION

8085 microprocessor manuals

TRANSCRIPT

Page 1: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

INDEX

Sr. No.

TitlePage no.

Grade Signature

1.Introduction to DYNA-8085 microprocessor kit & its features

2.Programming problems on Data Transfer

3.Programming problems on Arithmetic Operations

4.Programming problems on Looping techniques

5.Programming problems on Time Delay and Counters

6.Programming problems on Stack, Subroutines and Interrupts

7.To interface 8255 study card with 8085 microprocessor

8.To interface 8253 study card with 8085 microprocessor

9.To interface 8257 study card with 8085 microprocessor

10.To interface 8259 study card with 8085 microprocessor

11.To interface Traffic Control study card with 8085 microprocessor

[3]

Page 2: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

EXPERIMENT-01

Introduction to DYNA-8085 microprocessor kit & its features

INTRODUCTION TO DYNA 8085:Microfriend DYNA-85 is an introduction to a low cost trainer

and development kit. It is a single board computer based on 8085 CPU designed specially for training applications.

SYSTEM HARDWARE OVERVIEW

CENTRAL PROCESSING UNIT It is based on the INTEL 8085 high performance CPU operating at 3 MHz

MEMORY MAP: The DYNA-85 has a flexible memory map, and the RAM has battery back-up.0000H to 3FFFH:This is monitor EPROM socket. 2732,2764 or 27128 can be used for EPROM. If 2732 is used then remaining part will be mapped. 4000H to BFFFH:

This is socket is used for expansion of EPROM or RAM.C000H to FFFFH:User RAM socket.

POWER SUPPLY SPECIFICATIONS ( SMPS):

Voltage Current rating+5 V+12 V-12 V

1A500mA250mA

[4]

Page 3: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

KEYPAD :

[5]

Page 4: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[6]

Page 5: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[7]

Page 6: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Date: Signature: Grade:

EXPERIMENT-02

PROGRAMMING PROBLEMS ON DATA TRANSFER

Solved Example

Load the Accumulator with 05h and register B with 09h. Swap the contents of these registers using register C.

Solution

AddressHex Code

Label Mnemonics Comments

2000H 3EH MVI A, 05HLoad Accumulator with immediate value 05h

2001H 05H

2002H 06H MVI B, 09HLoad register B with immediate value 09h

2003H 09H

2004H 4FH MOV C, ACopy the contents of Acc in register C

2005H 78H MOV A, BCopy the content of B to Acc.

2006H 41H MOV B,CCopy the content of C to B

2006H EFH RST 5 Ends the program

[8]

Page 7: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Assignments

1. Load the content of the memory location 2100H directly to the accumulator then transfer it to register C. The contents of memory location 2100H is 05H.

2. Place 05H in Accumulator. Increment it by one and store result in the memory location 2400H.

3. Write ALP to copy the contents of sixteen byte memory location to another memory location.

Source memory address = 2500H to 2515HDestination memory address = 2613H to 2628H

4. Write ALP to copy the contents of Accumulator to memory location 2400H to 2407H using register addressing mode.

[9]

Page 8: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[10]

Page 9: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[11]

Page 10: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[12]

Page 11: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[13]

Page 12: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Date: Signature: Grade:

EXPERIMENT-03

PROGRAMMING PROBLEMS ON ARITHMETIC OPERATION

Solved Example

Write a logical program to perform addition of two 8-bit numbers

Solution

AddressHex Code

Label Mnemonics Comments

2000H 3EH MVI A, 05HLoad Accumulator with immediate value 05h

2001H 05H

2002H 06H MVI B, 09HLoad Accumulator with immediate value 05h

2003H 09H

2004H 80H ADD BAdd the contents of Acc. & B. Result stored in Acc.

2005H 4FH MOV C, ACopy the contents of Acc in register C

2006H EFH RST 5 Ends the program

[14]

Page 13: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Assignments

1. Load the register B with 05H and register C with 04H. Subtract the contents of register B from that of register C. Check the status of borrow flag.

2. Load the register B with 03H, register D with 07H and register H with 04H. Add the contents of all and store the result in register C. Repeat the problem with content of register B = FAH. Check the status of carry flag.

3. Memory location 2500H contains value 68H and memory location 2600H contains value 19H. Add these numbers and store the result in memory location 2700H.

4. Memory location 2500H contains value 53H and memory location 2600H contains value 25H. Subtract these numbers and store the result in memory location 2700H.

5. Multiply the contents of accumulator by 4 without using MUL instruction.

[15]

Page 14: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[16]

Page 15: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[17]

Page 16: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[18]

Page 17: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[19]

Page 18: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Date: Signature: Grade:

EXPERIMENT-04

PROGRAMMING PROBLEMS ON LOOPING TECHNIQUE.

Solved Example

Write a logical program to find the smallest number in the given array

Solution

AddressHex Code

Label Mnemonics Comments

2000H 21H LXI H, 4200H Load HL pair with 4200 2001H 00H Address2002H 42H2003H 46H MOV B, M Load the count

2004H 23H INX HIncrement memory location

2005H 7EH MOV A, MSet 1st element as smallest data

2006H 05H DCR B Decrement count2007H 23H LOOP: INX H If A-reg < M, go to Ahead2008H BEH CMP M2009H DAH JC AHEAD2010H 14H2011H 20H

2012H 7EH MOV A,MSet the new value as smallest

2013H 35H AHEAD: DCR MRepeat comparisions till count = 0

2014H C2H JNZ LOOP2015H 07H2016H 20H

2017H 32H STA 4300Store the smallest value at 4300

[20]

Page 19: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Assignment

1. Write ALP to find the largest number from the given array. 2. Write ALP to sort the given array in ascending order.

3. Write ALP to sort the given array in descending order.

4. Write ALP to transfer the entire block of sixteen bytes of data stored at memory location 2090H to 29FH to a new memory location starting at 20C0H.

5. Write ALP to multiply the contents of Accumulator by 4 without using MUL instruction.

6. Write ALP to divide the contents of Accumulator by 4 without using DIV instruction.

[21]

Page 20: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[22]

Page 21: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[23]

Page 22: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[24]

Page 23: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[25]

Page 24: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Date: Signature: Grade:

EXPERIMENT-05

PROGRAMMING PROBLEMS ON TIME DELAY AND COUNTER

Solved Example

Write a logical program to generate 1 millisecond delay if the clock frequency is 4 MHz.

Solution

AddressHex Code

Label Mnemonics Comments

2050H 0EH DELAY: MVI C, 8FH Load C with value 8F2051H 8FH2052H 0DH LOOP1: DCR C Decrement C by 12053H C2H JNZ LOOP1 Continue loop until C = 02054H 52H2055H 20H

Determining T-states of the delay routine

Instruction T statesDELAY: MVI C, FFH 7LOOP1: DCR C 4

JNZ LOOP1 7/10

Total T-states = 7 + 142*(4+10) + 1*(4+7)

= 2006

[26]

Page 25: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Assignment

1. Write an ALP to generate 10 ms time delay using register pair.

2. Write an ALP to generate 1 second time delay using loop within loop technique.

3. Write an ALP to setup DOWN counter from 0FH to00H.

4. Write an ALP to setup UP counter from 00H to0FH.

NOTE : Use clock frequency = 3.0mhz and show time delay calculations.

[27]

Page 26: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[28]

Page 27: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[29]

Page 28: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[30]

Page 29: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Date: Signature: Grade:

EXPERIMENT-06

PROGRAMMING PROBLEMS ON STACK, SUBROUTINES & INTERRUPTS

Solved Example

Write a logical program to count from 00-99 (Upcounter) in BCD. Use subroutine to generate a delay of 1 second between counts

Solution

AddressHex Code

Label Mnemonics Comments

2050H 3EH START: MVI A, 00H Load count as 002051H 00H2052H F5H RPT: PUSH PSW PUSH 2053H CDH CALL DELAY Call DELAY subroutine2054H 00H2055H 23H2056H F1H POP PSW POP 2057H C6H ADI O1H

2058H 27H DAADecimal adjust after addition

2059H C3H JMP RPTUnconditional jump to RPT

2060H 51H2061H 20H2062H 76H HLT Halt execution

2300H 01H DELAY: LXI B, F424HLoad HL pair with delay count

2301H 24H2302H F4H2304H 0BH WAIT: DCX B Decrement count2305H 79H MOV A, C

[31]

Page 30: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

2306H B0H ORA B2307H C2H JNZ WAIT Loop until B = 02308H 04H2309H 23H2310H C9H RET

Assignment

1. Write an ALP to demonstrate the effect of the following cases on zero flag.

Load 00 in accumulator and check zero flag. Load 00 in accumulator, logically OR accumulator and then

check zero flag.

2. Write an ALP to display HEX UP counter from 00H to 0FH.

3. Write an ALP to display HEX DOWN counter from 0FH to 00H.

[32]

Page 31: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[33]

Page 32: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[34]

Page 33: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[35]

Page 34: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Date: Signature: Grade:

EXPERIMENT-07

TO INTERFACE 8255 STUDY CARD WITH 8085 MICROPROCESSOR.

8255 Study Card:

1. This study card is interfaced with 8085 kit through 50 pin cable.

2. It consists of one 8255, with tags for all I/O ports, buffers to drive LEDs, Vcc and ground tags.

3. I/O addresses are as underPort A – 30H, Port B – 31H, Port C – 32H, Control Reg. – 33H.

General Procedure:

1. Keep 8255 study card to the left side of the 8085 kit.

2. Connect 8255 card to 8085 kit through 50 pin cable.

3. Do not connect/remove card when power is ON.

4. Enter your program in RAM area (i.e. C000H ) for your experiment.

[36]

Page 35: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

5. Execute the program and check working of 8255.

6. Similarly check working of 8255 in different modes by writing programs for the same.

Programs

1. 8255 is configured in mode 0. Ports A,B,C are in mode 0. All the ports are in output mode and data is transmitted to the respective ports.

Procedure : Check the status of LED‘s after execution of program.

2. 8255 is configured in mode 0. Ports A,B,C are in mode 0. All the ports are in input mode and data from all the three ports are read and then stored in different registers.

Procedure : Write data byte by connecting tags of LED‘s with ground. Execute the program and check the status of registers.

3. 8255 is configured in BIT SET/RESET mode. Use bit PC7.

Procedure : Check the status of LED-7 of port C (PC7) after execution of program.

[37]

Page 36: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[38]

Page 37: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[39]

Page 38: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[40]

Page 39: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[41]

Page 40: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Date: Signature: Grade:

EXPERIMENT-08

TO INTERFACE 8253 STUDY CARD WITH 8085 MICROPROCESSOR.

8253 Study Card:

1. This study card is interfaced with 8085 kit through 50 pin cable.

2. It consists of one 8253, with tags for all counters, buffers to drive LEDs, Vcc and ground tags.

3. I/O addresses are as underCounter 0 – 30H, Counter 1 – 31H, Counter 2 – 32H, Command port – 33H.

General Procedure:

1. Keep 8253 study card to the left side of the 8085 kit.

2. Connect 8253 card to 8085 kit through 50 pin cable.

3. Do not connect/remove card when power is ON.

4. Enter your program in RAM area (i.e. C000H ) for your experiment.

5. Execute the program and check working of 8253.

[42]

Page 41: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

6. Similarly check working of 8253 in different modes by writing programs for the same.

Programs

1) The counter is in mode 0, i.e. Interrupt on terminal count. Binary counter 0 is selected. Read /load lower 8-bits and then higher 8-bits.

Procedure: Connect pulser key to clock, gate to Vcc, connect RST 6.5 to OUT 0 after executing the program and then press pulser key. Press the pulser key according to data and the interrupt service routine executes.

2) The counter is in mode 1, i.e. programmable one shot. Binary counter 0 is selected. Read /load lower 8-bits only.

Procedure : Connect pulser key to clock, gate to ground. Execute the program. Connect the gate to Vcc through a tag and start giving the pulse. The output of the counter will go low for count period and then it begins to glow again.

3) The counter is in mode 2, i.e. rate generator. Binary counter 0 is selected. Read /load high order 8-bits only.

Procedure : Connect clock 0 to pulser key. Check mode 2 operation.

4) The counter is in mode 3, i.e. square wave generator. BCD counter 0 is selected, load lower 8-bit count first followed by higher 8-bit count.

[43]

Page 42: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Procedure : Connect gate to low, execute the program and then make it high ( Vcc). Give clock pulses.

[44]

Page 43: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[45]

Page 44: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[46]

Page 45: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[47]

Page 46: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Date: Signature: Grade:

EXPERIMENT-09

TO INTERFACE 8257 STUDY CARD WITH 8085 MICROPROCESSOR.

8257 Study Card:

1. This study card is interfaced with 8085 kit through 50 pin cable.2. It consists of two 8257, buffers to drive LEDs, Vcc and ground

tags.3. I/O addresses are as under

Selection Address ADD_CH0 30HCNT_CH0 31HADD_CH1 32HCNT_CH0 33HADD_CH2 34HCNT_CH0 35HADD_CH3 36HCNT_CH0 37HMODE_PORT 38H

General Procedure:

1. Keep 8257 study card to the left side of the 8085 kit.2. Connect 8257 card to 8085 kit through 50 pin cable.3. Do not connect/remove card when power is ON.4. Enter your program in RAM area (i.e. C000H ) for your

experiment.[48]

Page 47: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

5. Execute the program and check working of 8257.6. Similarly check working of 8257 in different modes by writing

programs for the same.

Programs

1) To study 8257 in DMA read mode.

2) To study 8257 in DMA write mode.

[49]

Page 48: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[50]

Page 49: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[51]

Page 50: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Date: Signature: Grade:

EXPERIMENT-10

TO INTERFACE 8259 STUDY CARD WITH 8085 MICROPROCESSOR.

8259 Study Card:

1. This study card is interfaced with 8085 kit through 50 pin cable.2. It consists of two 8259, buffers to drive LEDs, Vcc and ground

tags.3. I/O addresses are as under

ICW1-30H, ICW2-31H for master 8259

General Procedure:

1. Keep 8259 study card to the left side of the 8085 kit.2. Connect 8259 card to 8085 kit through 50 pin cable.3. Do not connect/remove card when power is ON.4. Enter your program in RAM area (i.e. C000H ) for your

experiment.5. Execute the program and check working of 8259.6. Similarly check working of 8259 in different modes by writing

programs for the same.

Programs

1) To study 8259 in stand alone mode.

[52]

Page 51: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Procedure : Check the status of LED‘s after execution of program.

[53]

Page 52: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[54]

Page 53: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Date: Signature: Grade:

EXPERIMENT-11

TO INTERFACE TRAFFIC CONTROL STUDY CARD WITH 8085 MICROPROCESSOR.

Traffic Study Card:

1. This study card is interfaced with 8085 kit through 50 pin cable.2. It consists of buffer, 4 latches and LEDs.3. I/O addresses are as under

Port 01 – 20HPort 02 – 28HPort 03 – 30HPort 04 – 38H

General Procedure:

1. Keep Traffic control study card to the left side of the 8085 kit.2. Connect Traffic control card to 8085 kit through 50 pin cable.3. Do not connect/remove card when power is ON.4. Enter your program in RAM area (i.e. C000H) for your

experiment.5. Execute the program and check working of Traffic control.

Programs

1) Operate port-01 in traffic control sequence.

[55]

Page 54: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[56]

Page 55: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

[57]

Page 56: 8085 Microprocessor Manual

INDUS INSTITUTE OF ENGINEERING AND TECHNOLOGYMICROPROCESSOR AND INTERFACING

Date: Signature: Grade:

[58]