0% found this document useful (0 votes)
2 views

MPMC LAB

The document outlines a series of experiments using 8086 and 8051 microprocessor kits, including programs for arithmetic operations, data manipulation, and interfacing. Each section details the aim, required apparatus, program code, sample input/output data, and procedures for execution. The experiments cover tasks such as addition, subtraction, multiplication, division, and data sorting in arrays and matrices.

Uploaded by

vijay
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

MPMC LAB

The document outlines a series of experiments using 8086 and 8051 microprocessor kits, including programs for arithmetic operations, data manipulation, and interfacing. Each section details the aim, required apparatus, program code, sample input/output data, and procedures for execution. The experiments cover tasks such as addition, subtraction, multiplication, division, and data sorting in arrays and matrices.

Uploaded by

vijay
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

DATE NAME OF THE EXPERIMENT PAGE DATE 0F MARK SIGN

NO. SUBMISSION
8086 µP KIT –Programs
1 16 Bit data addition and subtraction 3
2 16 Bit multiplication and division 7
3 Sum of an Array and matrix addition 10
4 BCD addition and Subtraction 15
5 Find largest and smallest data in an array 20
6 Ascending and descending order in an array 25
7 BCD to binary conversion and String manipulation 30
8051µC KIT –Programs
1 16 Bit addition 34
2 8 Bit subtraction 37
3 8 Bit multiplication 39
4 Find a square of a Number 41
5 8 Bit division 43
6 Decimal number into Hexa decimal number conversion 46
7 Find largest and smallest number in an array 49
8. One’s complement and two’s complement of a Number 55
Interfacing With 8086 µp KIT
1 Interface 8255 57
2 Interface 8279 59
3 Stepper Motor Interface 62
4 ADC Interface 65
5 DAC Interface 67
Interfacing With 8051µC KIT
1 Interface 8255 69
2 Interface 8279 71
3 Stepper Motor Interface 73
4 ADC Interface 77
5 DAC Interface 79

EC8681-MPMC LAB Page 1


1. 16 BIT DATA ADDITION&SUBTRACTION

AIM:

To add and subtract two 16 bit numbers and stored at consecutive memory locations using 8086 Kit.

APPARATUS REQUIRED:

S.no Name of the item Range Quantity


1 Microprocessor kit with LCD µP8086 1
display

PROGRAM(16 BIT ADDITION):

ADDRESS LABEL MNEMONIC LABEL


1000 MOV AX,[1100]
1004 MOV BX,[1102]
1008 MOV CL,00
100B ADD AX,BX
100C JNB 1011 L1
100F INC CL
1011 L1 MOV [1104],AX
1015 MOV [1106],CL
1019 HLT
SAMPLE INPUT/ OUTPUT DATA
MEMORY
CONTENT
ADDRESS
DATA 1
1100 09
1101 07
DATA 2
1102 01
1103 08
SUM
1104 0A
1105 0F
CARRY
1106 00

EC8681-MPMC LAB Page 2


PROGRAM(16 BIT SUBTRACTION)
ADDRESS LABEL MNEMONIC LABEL
1000 MOV AX,[1100]
1004 MOV BX,[1102]
1008 MOV CL,00
100B SUB AX,BX
100C JNB 1013 L1
100F INC CL
1011 NEG AX
1013 L1 MOV [1104],AX
1017 MOV [1106],CL
101B HLT
SAMPLE INPUT/ OUTPUT DATA
MEMORY
CONTENT
ADDRESS
DATA 1
1100 09
1101 0F
DATA 2
1102 02
1103 07
DIFFERENCE
1104 07
1105 08
BORROW
1106 00

Procedure:

1. Switch ON the microprocessor Kit.


2. Enter “A” then type the starting Address(1000)
3. Type the Mnemonics from the program table and RESET.
4. Enter the Input data for the specified address field.
5. After that “RESET”, then GO Starting address (1000).
6. Now execute the program.
7. Check the output at the specified address field.

EC8681-MPMC LAB Page 3


FLOW CHART:

EC8681-MPMC LAB Page 4


RESULT:

Thus the 16-bit addition and subtraction of two 16- bit number was successfully executed.

EC8681-MPMC LAB Page 5


2. 16 BIT DATA MULTIPLICATION &DIVISIOM

AIM:

To multiply two16 bit numbers and division of given 16 bit number and stored the result at
consecutive memory locations using 8086 Kit.

APPARATUS REQUIRED:

S.no Name of the item Range Quantity


1 Microprocessor kit with LCD µP8086 1
display

PROGRAM(16 BIT MULTIPLICATION)

ADDRESS LABEL MNEMONIC LABEL


1000 MOV AX,[1100]
1004 MOV BX,[1102]
1008 MUL BX
100A MOV[1104],DX
100E MOV [1106],AX
1012 HLT

SAMPLE INPUT/ OUTPUT DATA:

MEMORY
CONTENT
ADDRESS
DATA 1
1100 DC
1101 FE
DATA 2
1102 98
1103 BA
RESULT
1104 C3
1105 B9
1106 A0
1107 2A

EC8681-MPMC LAB Page 6


PROGRAM(16 BIT DIVISION):

ADDRESS LABEL MNEMONIC LABEL


1000 MOV AX,[1100]
1004 MOV CH,[1102]
1008 DIV CH
100A MOV [1103],AL
100E MOV [1104],AH
1012 HLT

SAMPLE INPUT/ OUTPUT DATA:

MEMORY
CONTENT
ADDRESS
DIVIDEND
1100 0F
1101 00
DIVISOR
1102 02
QUOTIENT
1103 07
REMINDER
1104 01

PROCEDURE:

1. Switch ON the microprocessor Kit.


2. Enter “A” then type the starting Address(1000)
3. Type the Mnemonics from the program table and RESET.
4. Enter the Input data for the specified address field.
5. After that “RESET”, then GO Starting address (1000).
6. Now execute the program.
7. Check the output at the specified address field.

EC8681-MPMC LAB Page 7


FLOW CHART:

RESULT:

Thus the 16-bit Multiplication and division of 16- bit number was successfully executed.

EC8681-MPMC LAB Page 8


3. Sum of an Arry and Matrix addition

AIM:

To find a sum of an array and matrix addition using 8086, stored the result at consecutive memory
locations in the memory.
APPARATUS REQUIRED:

S.no Name of the item Range Quantity


1 Microprocessor kit with LCD µP8086 1
display
PROGRAM:

Sum of an array:

ADDRESS LABEL MNEMONIC LABEL


1000 MOV SI,1100
1004 MOV DI,1200
1008 MOV CL,[SI]
100A INC SI
100B MOV AX,0000
100F AGAIN ADD AL,[SI]
1011 JNB 1015 AHEAD
1013 INC AH
1015 AHEAD INC SI
1016 LOOP 100F AGAIN
1018 MOV [DI],AX
101A HLT

EC8681-MPMC LAB Page 9


SAMPLE INPUT OUTPUT DATA:

MEMORY
CONTENT
ADDRESS
COUNT
1100 05
INPUT DATA
1101 01
1102 03
1103 02
1104 04
1105 00
OUTPUT DATA
1200 0A
1201 00

Matrix addition:

ADDRESS LABEL MNEMONIC LABEL


1000 MOV BX,1300
1004 MOV BP,1400
1008 MOV SI,0001
100C MOV DI,1501
1010 MOV CL,09
1013 REPEAT MOV AL,[BX+SI]
1015 ADD AL,[BP+SI]
1017 MOV [ DI],AL
1019 INC SI
101A INC DI
101B LOOP 1013 REPEAT
101D HLT

EC8681-MPMC LAB Page 10


SAMPLE INPUT/ OUTPUT DATA
MEMORY MEMORY
CONTENT CONTENT
ADDRESS ADDRESS
MATRIX 1 MATRIX 2
1301 05 1401 03
1302 04 1402 02
1303 01 1403 01
1304 02 1404 04
1305 08 1405 02
1306 04 1406 05
1307 03 1407 07
1308 01 1408 07
1309 05 1409 08

MEMORY CONTENT
ADDRESS
SUM MATRIX

1501 08
1502 06
1503 02
1504 06
1505 0A
1506 09
1507 0A
1508 08
1509 0D
PROCEDURE:

1. Switch ON the microprocessor Kit.


2. Enter “A” then type the starting Address(1000)
3. Type the Mnemonics from the program table and RESET.
4. Enter the Input data for the specified address field.
5. After that “RESET”, then GO Starting address (1000).
6. Now execute the program.
7. Check the output at the specified address field.

EC8681-MPMC LAB Page 11


FLOW CHART:

EC8681-MPMC LAB Page 12


RESULT:

Thus the sum of an array and matrix addition was successfully executed.

EC8681-MPMC LAB Page 13


4. BCD addition and subtraction

AIM:

To perform BCD addition and BCD subtraction using 8086, stored at consecutive memory
locations in the memory.
APPARATUS REQUIRED:

S.no Name of the item Range Quantity


1 Microprocessor kit with LCD µP8086 1
display
PROGRAM:(BCD ADDITION)

ADDRESS LABEL MNEMONIC LABEL


1000 MOV SI,1100
1004 MOV CL,00
1007 MOV AX,[SI]
1009 M OV BX,[SI+2]
100C ADD AL,BL
100E DAA
100F MOV DL,AL
1011 MOV AL, AH
1013 ADC AL,BH
1015 DAA
1016 MOV DH,AL
1018 JNB 101C AHEAD
101A INC CL
101C AHEAD MOV [SI+4],DX
101F MOV [SI+6],CL
1022 HLT

EC8681-MPMC LAB Page 14


SAMPLE INPUT/ OUTPUT DATA:

MEMORY
CONTENT
ADDRESS
DATA 1
1100 08
1101 02
DATA 2
1102 01
1103 03
SUM
1104 09
1105 05
CARRY
1106 00

BCD SUBTRACTION:

ADDRESS LABEL MNEMONIC LABEL


1000 MOV SI,1100
1004 MOV CL,00
1007 MOV AX,[SI]
1009 M OV BX,[SI+2]
100C SUB AL,BL
100E DAS
100F MOV DL,AL
1011 MOV AL, AH
1013 SBB AL,BH
1015 DAS
1016 MOV DH,AL
1018 JNB 101C AHEAD
101A INC CL
101C AHEAD MOV [SI+4],DX
101F MOV [SI+6],CL
1022 HLT

EC8681-MPMC LAB Page 15


SAMPLE INPUT OUTPUT DATA
MEMORY
CONTENT
ADDRESS
DATA 1
1100 08
1101 05
DATA 2
1102 05
1103 04
SUM
1104 03
1105 01
CARRY
1106 00

PROCEDURE:

1. Switch ON the microprocessor Kit.


2. Enter “A” then type the starting Address(1000)
3. Type the Mnemonics from the program table and RESET.
4. Enter the Input data for the specified address field.
5. After that “RESET”, then GO Starting address (1000).
6. Now execute the program.
7. Check the output at the specified address field.

EC8681-MPMC LAB Page 16


FLOW CHART:

EC8681-MPMC LAB Page 17


RESULT:

Thus the BCD addition and subtraction program was successfully executed.

EC8681-MPMC LAB Page 18


5. Find largest Data and Smallest Data in an Array

AIM:

To find largest Data and Smallest Data in an Array using 8086, stored at consecutive memory
locations in the memory.
APPARATUS REQUIRED:

S.no Name of the item Range Quantity


1 Microprocessor kit with LCD µP8086 1
display
PROGRAM(Largest data):

ADDRESS LABEL MNEMONIC LABEL


1000 MOV SI,1100
1004 MOV DI,1200
1008 MOV CL,[SI]
100A INC SI
100B MOV AL,[SI]
100D DEC CL
100F AGAIN INC SI
1010 MOV BL,[SI]
1012 CMP AL,BL
1014 JB 1018 AHEAD
1016 MOV AL,BL
1018 AHEAD DEC CL
101A JNZ 100F AGAIN
101C MOV [DI],AL
101E HLT

EC8681-MPMC LAB Page 19


SAMPLE INPUT /OUTPUT DATA

MEMORY
CONTENT
ADDRESS
COUNT
1100 05
INPUT DATA
1101 02
1102 03
1103 04
1104 0A
1105 0F
OUTPUT DATA
1200 0F

PROCEDURE:

1. Switch ON the microprocessor Kit.


2. Enter “A” then type the starting Address(1000)
3. Type the Mnemonics from the program table and RESET.
4. Enter the Input data for the specified address field.
5. After that “RESET”, then GO Starting address (1000).
6. Now execute the program.
7. Check the output at the specified address field.

EC8681-MPMC LAB Page 20


PROGRAM(Smallest data):

ADDRESS LABEL MNEMONIC LABEL


1000 MOV SI,1100
1004 MOV DI,1200
1008 MOV CL,[SI]
100A INC SI
100B MOV AL,[SI]
100D DEC CL
100F AGAIN INC SI
1010 MOV BL,[SI]
1012 CMP AL,BL
1014 JB 1018 AHEAD
1016 MOV AL,BL
1018 AHEAD DEC CL
101A JNZ 100F AGAIN
101C MOV [DI],AL
101E HLT

SAMPLE INPUT /OUTPUT DATA


MEMORY
CONTENT
ADDRESS
COUNT
1100 05
INPUT DATA
1101 02
1102 05
1103 01
1104 07
1105 03
OUTPUT DATA
1200 01

EC8681-MPMC LAB Page 21


FLOW CHART:

EC8681-MPMC LAB Page 22


RESULT:

Thus find the largest data and smallest data in an array program was successfully executed.

EC8681-MPMC LAB Page 23


6. Accending and Decending order in an Array

AIM:

To arrange the datas in Ascending and Descending order in an Array using 8086, stored at
consecutive memory locations in the memory.
APPARATUS REQUIRED:

S.no Name of the item Range Quantity


1 Microprocessor kit with LCD µP8086 1
display

PROGRAM (Ascending order)

ADDRESS LABEL MNEMONIC LABEL


1000 MOV SI,2400
1004 MOV CL,[SI]
1006 DEC CL
1008 REPEAT MOV SI,2400
100C MOV CH,[SI]
100E DEC CH
1010 INC SI
1011 REPCOM MOV AL,[SI]
1013 INC SI
1014 CMP AL,[SI]
1016 JB 101D AHEAD
1018 XCHG AL,[SI]
101A XCHG AL,[SI- 1]
101D AHEAD DEC CH
101F JNZ 1011 REPCOM
1020 DEC CL
1022 JNZ 1008 REPEAT
1024 HLT

EC8681-MPMC LAB Page 24


SAMPLE INPUT /OUTPUT DATA
MEMORY MEMORY
CONTENT CONTENT
ADDRESS ADDRESS
COUNT COUNT
2400 07 2400 07
INPUT ARRAY OUTPUT ARRAY
2401 09 2401 01
2402 06 2402 03
2403 04 2403 04
2404 05 2404 05
2405 01 2405 06
2406 07 2406 07
2407 03 2407 09

PROGRAM (Descending order)

ADDRESS LABEL MNEMONIC LABEL


1000 MOV SI,2400
1004 MOV CL,[SI]
1006 DEC CL
1008 REPEAT MOV SI,2400
100C MOV CH,[SI]
100E DEC CH
1010 INC SI
1011 REPCOM MOV AL,[SI]
1013 INC SI
1014 CMP AL,[SI]
1016 JNB 101D AHEAD
1018 XCHG AL,[SI]
101A XCHG AL,[SI-1]
101D AHEAD DEC CH
101F JNZ 1011 REPCOM
1020 DEC CL
1022 JNZ 1008 REPEAT
1024 HLT

EC8681-MPMC LAB Page 25


SAMPLE INPUT/ OUTPUT DATA
MEMORY MEMORY
CONTENT CONTENT
ADDRESS ADDRESS
COUNT COUNT
2400 07 2400 07
INPUT ARRAY OUTPUT ARRAY
2401 01 2401 09
2402 05 2402 07
2403 04 2403 06
2404 09 2404 05
2405 07 2405 04
2406 06 2406 03
2407 03 2407 01

PROCEDURE:

1. Switch ON the microprocessor Kit.


2. Enter “A” then type the starting Address(1000)
3. Type the Mnemonics from the program table and RESET.
4. Enter the Input data for the specified address field.
5. After that “RESET”, then GO Starting address (1000).
6. Now execute the program.
7. Check the output at the specified address field.

EC8681-MPMC LAB Page 26


FLOW CHART:

EC8681-MPMC LAB Page 27


RESULT:

Thus arranged the data in the ascending order and descending order program was successfully
executed.

EC8681-MPMC LAB Page 28


7. BCD to Binary conversion and String Manipulation

AIM:

To convert BCD to Binary number and String Manipulation using 8086, stored at consecutive
memory locations in the memory.
APPARATUS REQUIRED:

S.no Name of the item Range Quantity


1 Microprocessor kit with LCD µP8086 1
display

PROGRAM(Binary to BCD conversion):

ADDRESS LABEL MNEMONIC LABEL


1000 MOV BX,1100
1004 MOV AL,[BX]
1006 MOV DL,AL
1008 AND DL,0F
100B AND AL,0F0
100E MOV CL,4
1011 ROR AL,CL
1013 MOV DH,0A
1016 MUL DH
1018 ADD AL,DL
101A MOV [BX+1],AL
101D HLT

SAMPLE INPUT/ OUTPUT DATA

MEMORY
CONTENT
ADDRESS
BCD
1100 12
BINARY
1101 0C

EC8681-MPMC LAB Page 29


PROGRAM(String manipulation):

ADDRESS LABEL MNEMONIC LABEL


1000 MOV SI,1100
1004 MOV DI,1200
1008 MOV CL,03
100B L1 MOVSB
100D LOOP 100B L1
100F HLT

SAMPLE INPUT/ OUTPUT DATA

MEMORY MEMORY
CONTENT CONTENT
ADDRESS ADDRESS
INPUT STRING OUTPUT STRING
1100 E 1200 E
1101 C 1201 C
1102 E 1202 E

PROCEDURE:

1. Switch ON the microprocessor Kit.


2. Enter “A” then type the starting Address(1000)
3. Type the Mnemonics from the program table and RESET.
4. Enter the Input data for the specified address field.
5. After that “RESET”, then GO Starting address (1000).
6. Now execute the program.
7. Check the output at the specified address field.

EC8681-MPMC LAB Page 30


FLOW CHART:

EC8681-MPMC LAB Page 31


RESULT:

Thus conversion of BCD to Binary number and String Manipulation program was successfully
executed.

EC8681-MPMC LAB Page 32


1.16 BIT ADDITION

AIM:

To add two 16-bit numbers and store the result in memory using 8051 Kit

APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microcontroller kit with LCD µC8051 1
display
2. Keyboard with connector ------ 1

PROGRAM:

EC8681-MPMC LAB Page 33


FLOWCHART:

EC8681-MPMC LAB Page 34


RESULT:
Thus the addition of two 16 bit numbers was performed by using 8051 microcontroller Kit.

EC8681-MPMC LAB Page 35


2. 8-BIT SUBTRACTION

AIM:

To subtract two 8-bit numbers and store the result in memory using 8051 Kit

APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microcontroller kit with LCD µC8051 1
display
2. Keyboard with connector ------ 1

PROGRAM:

EC8681-MPMC LAB Page 36


FLOWCHART:

RESULT:

Thus the subtraction of two 8 bit numbers was performed by using 8051 microcontroller
Kit.

EC8681-MPMC LAB Page 37


3.8 BIT MULTIPLICATION

AIM:

To multiply two 8-bit numbers and store the result in memory using 8051 Kit

APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microcontroller kit with LCD µC8051 1
display
2. Keyboard with connector ------ 1

PROGRAM:

EC8681-MPMC LAB Page 38


FLOWCHART:

RESULT:

Thus the Multiplication of two 8 bit numbers was performed by using 8051 microcontroller
Kit.

EC8681-MPMC LAB Page 39


4.FIND A SQUARE OF A NUMER

AIM:

To Find Square of two 8-bit number and store the result in memory using 8051 Kit

APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microcontroller kit with LCD µC8051 1
display
2. Keyboard with connector ------ 1

PROGRAM:

SAMPLE DATA: 0A

#DATA1:0A, #DATA2:0A

RESULT: 4500 64

EC8681-MPMC LAB Page 40


FLOWCHART:

RESULT:

Thus the Square of two 8-bit numbers was performed by using 8051 microcontroller Kit.

EC8681-MPMC LAB Page 41


5.8BIT DIVISION

AIM:

To divide two 8-bit numbers and store the result in memory using 8051 Kit

APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microcontroller kit with LCD µC8051 1
display
2. Keyboard with connector ------ 1
PROGRAM:

EC8681-MPMC LAB Page 42


EC8681-MPMC LAB Page 43
FLOW CHART:

RESULT:

Thus the Division of two 8-bit numbers was performed by using 8051 microcontroller Kit.

EC8681-MPMC LAB Page 44


6. DECIMAL NUMBER INTO HEXA DECIMAL CONVERSION

AIM:

To convert Decimal number Hexa decimal number into equivalent stores the result in memory
using 8051 Kit.

APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microcontroller kit with LCD µC8051 1
display
2. Keyboard with connector ------ 1
PROGRAM:

EC8681-MPMC LAB Page 45


EC8681-MPMC LAB Page 46
FLOW CHART:

RESULT:

Thus the conversion of decimal to hexa decimal was performed by using 8051
microcontroller Kit.

EC8681-MPMC LAB Page 47


7. FIND A LARGEST NUMBER& SMALLEST NUMBER IN AN ARRAY
AIM:
To find a largest number and smallest number in an array and stores the result in memory using
8051 Kit.
APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microcontroller kit with LCD µC8051 1
display
2. Keyboard with connector ------ 1

PROGRAM(Smallest)

ADDRESS OPCODE LABEL MNEMONIC LABEL


4100 90 42 00 MOV DPTR,#4200
4103 E0 MOVX A,@DPTR
4104 F8 MOV R0,A
4105 18 DEC R0
4106 A3 INC DPTR
4107 E0 MOVX A, @DPTR
4108 FC MOV R4,A
4109 A3 AGAIN INC DPTR
410A E0 MOVX A,@DPTR
410B FA MOV R2,A
410C C3 CLR C
410D 9C SUBB A,R4
410E 50 02 JNC AHEAD
4110 EA MOV A,R2
4111 FC MOV R4,A
4112 D8 F5 AHEAD DJNZ R0 AGAIN
4114 90 45 00 MOV DPTR,#4500
4117 EC MOV A,R4
4118 F0 MOVX @DPTR,A
4119 80 FE HALT SJMP HALT

EC8681-MPMC LAB Page 48


SAMPLE INPUT OUTPUT DATA:

MEMORY
CONTENT
ADDRESS
COUNT
4200 05
INPUT ARRAY
4201 01
4202 08
4203 05
4204 07
4205 0F
SMALLEST DATA
4500 01

EC8681-MPMC LAB Page 49


PROGRAM(Largest)

ADDRESS OPCODE LABEL MNEMONIC LABEL


4100 90 42 00 MOV DPTR,#4200
4103 E0 MOVX A,@DPTR
4104 F8 MOV R0,A
4105 18 DEC R0
4106 A3 INC DPTR
4107 E0 MOVX A, @DPTR
4108 FC MOV R4,A
4109 A3 AGAIN INC DPTR
410A E0 MOVX A,@DPTR
410B FA MOV R2,A
410C C3 CLR C
410D 9C SUBB A,R4
410E 40 02 JC AHEAD
4110 EA MOV A,R2
4111 FC MOV R4,A
4112 D8 F5 AHEAD DJNZ R0 AGAIN
4114 90 45 00 MOV DPTR,#4500
4117 EC MOV A,R4
4118 F0 MOVX @DPTR,A
4119 80 FE HALT SJMP HALT

SAMPLE INPUT OUTPUT DATA

EC8681-MPMC LAB Page 50


MEMORY
CONTENT
ADDRESS
COUNT
4200 05
INPUT ARRAY
4201 00
4202 08
4203 05
4204 07
4205 0F
LARGEST DATA
4500 0F

PROCEDURE:

1. Switch on the microcontroller kit.


2. Enter the opcode or mnemonics from the program table.
3. Enter the input data for the specified address field.
4. Run the program.
5. Verify the result.

EC8681-MPMC LAB Page 51


FLOW CHART:

EC8681-MPMC LAB Page 52


RESULT:
Thus the find the largest and smallest number in an array was performed by using 8051
microcontroller Kit.

EC8681-MPMC LAB Page 53


8. ONE’S COMPLEMENT AND TWO’S COMPLEMENT OF A NUMBER

AIM:

To find a one’s complement and two’s complement of a number and stores the result in memory
using 8051 Kit.

APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microcontroller kit with LCD µC8051 1
display
2. Keyboard with connector ------ 1
PROGRAM:

EC8681-MPMC LAB Page 54


FLOW CHART:

RESULT:

Thus the one’s complement and two’s complement of a number was performed by using
8051 microcontroller Kit.

EC8681-MPMC LAB Page 55


1. INTERFACE 8255 WITH 8086

AIM:

To interface the programmable peripheral interface 8255 with 8086 microprocessor Kit.

APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microprocessor kit with LCD µP8086 1
display
2. Keyboard with connector ------ 1
3 Interface Kit 8255 1
PROGRAM:

Procedure:
1. Enter the program starting from 1000H
2. Set a known data using DPDT switch.
3. Execute the program.
4. After that the data set by the DPDT switch is stored in the memory location 1500H.

EC8681-MPMC LAB Page 56


Procedure:
1. Enter the program starting from 1000H
2. Set a known data using DPDT switch.
3. Execute the program.
4. After that the data set by the DPDT switch is made output to Port B and visually seen on
LEDs glow.
Block diagram:

µprocessor Interface kit


8086kit
8255

RESULT:
Thus the interface 8255 with 8086 was performed successfully.

EC8681-MPMC LAB Page 57


2. INTERFACE 8279 WITH 8086
AIM:

To interface key board interface 8279 with 8086 microprocessor Kit.

APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microprocessor kit with LCD µP8086 1
display
2. Keyboard with connector ------ 1
3 Interface Kit 8279 1
PROGRAM:

(a)TO DISPLAY “A” IN THE FIRST DIGIT

ADDRE
LABEL MNEMONIC LABEL
SS
1000 MOV AL,00
1003 OUT C2,AL
1006 MOV AL,0CC
1009 OUT C2,AL
100C MOV AL,90
100F OUT C2,AL
1012 MOV AL,88
1015 OUT C0,AL
1018 MOV AL,0FF
101B MOV CX,0005
101F NEXT OUT C0,AL
1022 LOOP 101F NEXT
1024 HLT

EC8681-MPMC LAB Page 58


(b).ROLLING DISPLAY (DISPLAY MESSAGE IS “HELP US”)

ADDRE
LABEL MNEMONIC LABEL
SS
1000 START MOV SI,1200
1004 MOV CX,000F
1008 MOV AL,10
100B OUT C2,AL
100D MOV AL,00
1010 OUT C2,AL
1012 MOV AL,90
1015 OUT C2,AL
1017 NEXT MOV AL,[SI]
1019 OUT C0,AL
101B CALL 1500 DELAY
101E INC SI
101F LOOP 1017 NEXT
1021 JMP 1000 START
DELAY

ADDRE
LABEL MNEMONIC LABEL
SS
1500 DELAY MOV DX,0A0FF
1504 LOOP1 DEC DX
1505 JNZ 1504 LOOP1
1507 RET

LOOK UP TABLE:
1200 FF
1201 FF
1202 FF
1203 FF
1204 FF
1205 FF
1206 FF
1207 FF
1208 98
1209 68
120A 7C
120B C8
120C FF
120D 1C
120E 29
120F FF

EC8681-MPMC LAB Page 59


Block diagram:

µprocessor Interface kit


8086kit
8279

RESULT:
Thus the interface 8279 with 8086 was performed successfully.

EC8681-MPMC LAB Page 60


3. INTERFACING A STEPPER MOTOR WITH µP 8086

AIM:

To Interface Stepper motor with the micro processor 8086 and rotate the motor both forward and
reverse direction.

APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microprocessor kit with LCD µP8086 1
display
2. Keyboard with connector ------ 1
3 Stepper motor with Interface ------ 1
board
4 Data bus 56 Pin 1

PROGRAM:

TABLE:

Address Field Forward Direction Reverse Direction


1018 09 0A
1019 05 06
1020 06 05
1021 0A 09

PROCEDURE:

1. Connect the Stepper motor Interface to the microprocessor kit using Bus connecter.
2. Enter the program in 8086 kit.
3. Execute the program.
4. After the execution of the program the motor was rotated both forward and reverse direction.

EC8681-MPMC LAB Page 61


Jumper settings in stepper motor Interface:

EC8681-MPMC LAB Page 62


Block diagram:

Stepper motor
µprocessor Interface
8086kit board

Stepper motor

RESULT:

Thus the Interface Stepper motor is connected with the microprocessor 8086 and rotate the
motor both forward and reverse direction was successfully done.

EC8681-MPMC LAB Page 63


4. INTERFACING ADC WITH µP 8086

AIM:

To Interface ADC (0803) with the micro processor 8086.


APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microprocessor kit with LCD µP8086 1
display
2. Keyboard with connector ------ 1
3 ADC Interface board ADC(0803) 1
4 Data bus 56 Pin 1

PROGRAM:

ADDRESS OPCODE MNEMONIC


1000 C6 C0 10 MOV AL,10
1003 E6 C8 OUT C8,AL
1005 C6 C0 18 MOV AL,18
1008 E6 C8 OUT C8,AL
100A F4 HLT

PROCEDURE:
1. Place jumper J2 in B Position.
2. Place jumper J5 in A position.
3. Enter and execute the above program.
4. Vary the analog input (using trim pot) and give the SOC by pressing the SOC switch.
5. See the corresponding digital value in the LED display.

Jumper(J2)

EC8681-MPMC LAB Page 64


Jumper(J5)

Block diagram:

µprocessor Interface kit


8086kit
ADC (0803)

RESULT:
Thus the interface ADC with 8086 was performed successfully.

EC8681-MPMC LAB Page 65


5. INTERFACING DAC WITH µP 8086

AIM:

To Interface DAC (0809) with the micro processor 8086.


APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microprocessor kit with LCD µP8086 1
display
2. Keyboard with connector ------ 1
3 DAC Interface board DAC(0809) 1
4 Data bus 56 Pin 1

Block diagram:

µprocessor Interface kit


8086kit DAC (0809)

DAC output Pins:

EC8681-MPMC LAB Page 66


PROGRAM:
To generate square wave at DAC2:

To generate Saw-tooth wave at DAC1:

To generate Triangular wave at DAC2:

RESULT:
Thus the interface DAC with 8086 was performed successfully.

EC8681-MPMC LAB Page 67


1. INTERFACE 8255 WITH 8051

AIM:

To interface the programmable peripheral interface 8255 with 8051 microcontroller Kit.

APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microcontroller kit with LCD µP8051 1
display
2. Keyboard with connector ------ 1
3 Interface Kit 8255 1

PROGRAM: To initialize Port A as Input port:

Procedure:
1. Enter the program starting from 4100H
2. Set a known data using DPDT switch.
3. Execute the program.
4. After that the data set by the DPDT switch is stored in the memory location 4500H.

PROGRAM: To initialize Port A as Input port and Port B as Output Port:

EC8681-MPMC LAB Page 68


Procedure:
1. Enter the program starting from 4100H
2. Set a known data using DPDT switch.
3. Execute the program.
4. After that the data set by the DPDT switch is made output to Port B and visually seen on
LEDs glow.

Block diagram:

µcontroller Interface kit


8051kit
8255

RESULT:
Thus the interface 8255 with 8086 was performed successfully.

EC8681-MPMC LAB Page 69


2.INTERFACING 8279 WITH µC

AIM:

To Interface 8279 with the microcontroller 8051.

APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microcontroller kit with LCD µC8051 1
display
2. Keyboard with connector ------ 1
3 Interface kit 8279 1
4 Data bus 56 Pin 1

BLOCK DIAGRAM:

µCONTROLL KEYBOARD SEVEN


ER INTERFACE SEGMENT
8279 LED DISPLAY
8051

PROCEDURE:

1. Connect the Interface 8279 to the microcontroller 8051 kit at the I/O Port using Bus connecter.
2. Enter the program in 8051 kit.
3. Execute the program.
4. After execution of the program the Letter “A” was displayed on the seven segment display of an
Interface Kit 8279.

EC8681-MPMC LAB Page 70


PROGRAM:

Functional Block diagram of 8279:

RESULT:
Thus the interface 8279 was successfully connected with microcontroller Kit and the given
program was executed.

EC8681-MPMC LAB Page 71


3.INTERFACING A STEPPER MOTOR WITH µC

AIM:

To Interface Stepper motor with the microcontroller 8051 and rotate the motor both forward and
reverse direction.

APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microcontroller kit with LCD µC8051 1
display
2. Keyboard with connector ------ 1
3 Stepper motor Interface ------ 1
4 Data bus 56 Pin 1

BLOCK DIAGRAM:

EC8681-MPMC LAB Page 72


PROCEDURE:

1. Connect the Stepper motor Interface to the microcontroller 8051 kit at the I/O Port1 using Bus
connecter.
2. Enter the program in 8051 kit.
3. Execute the program.
4. After the execution of the program the motor was rotated both forward and reverse direction.

PROGRAM:

EC8681-MPMC LAB Page 73


Jumper settings in stepper motor Interface:

EC8681-MPMC LAB Page 74


TABLE:

Address Field Forward Direction Reverse Direction


4500 09 0A
4501 05 06
4502 06 05
4503 0A 09

RESULT:

Thus the Interface Stepper motor is connected with the microcontroller 8051 and rotate the
motor both forward and reverse direction was successfully done.

EC8681-MPMC LAB Page 75


4. INTERFACING ADC WITH µC 8051

AIM:

To Interface ADC (0803) with the microcontroller 8051.


APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microcontroller kit with LCD µc8051 1
display
2. Keyboard with connector ------ 1
3 ADC Interface board ADC(0803) 1
4 Data bus 56 Pin 1

PROGRAM:

ADDRESS OPCODE MNEMONIC


4100 90 FF C8 MOV DPTR,#FFC8
4103 74 10 MOV A,#10
4105 F0 MOVX@DPTR,A
4106 74 18 MOVXA,#18
4108 F0 MOVX@DPTR,A
4109 80 FE SJMP 4100

PROCEDURE:
1. Place jumper J2 in B Position.
2. Place jumper J5 in A position.
3. Enter and execute the above program.
4. Vary the analog input (using trim pot) and give the SOC by pressing the SOC switch.
5. See the corresponding digital value in the LED display.

Jumper(J2)

EC8681-MPMC LAB Page 76


Jumper(J5)

Block diagram:

µC0ntroller Interface kit


8051kit
ADC (0803)

RESULT:
Thus the interface ADC with 8051 was performed successfully.

EC8681-MPMC LAB Page 77


5. INTERFACING DAC WITH µC 8051

AIM:

To Interface DAC (0809) with the microcontroller 8051.


APPARATUS REQUIRED:

S.No Name of the item Range Quantity


1 Microcontroller kit with LCD µc8051 1
display
2. Keyboard with connector ------ 1
3 DAC Interface board DAC(0809) 1
4 Data bus 56 Pin 1

Block diagram:

µController Interface kit


8051kit DAC (0809)

DAC output Pins:

EC8681-MPMC LAB Page 78


PROGRAM:
To generate square wave at DAC2:

To generate Saw-tooth wave at DAC1:

EC8681-MPMC LAB Page 79


To generate Triangular wave at DAC2:

RESULT:
Thus the interface DAC with 8086 was performed successfully.

EC8681-MPMC LAB Page 80

You might also like