Вы находитесь на странице: 1из 49

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING EC 2308 MICROPROCESSOR AND MICROCONTROLLER LAB V SEMSTER 2012-2013

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

SYLLABUS

EC2308 MICROPROCESSOR AND MICROCONTROLLER LAB 1. Programs for 16 bit Arithmetic operations (Using 8086). 2. Programs for Sorting and Searching (Using 8086). 3. Programs for String manipulation operations (Using 8086). 4. Programs for Digital clock and Stop watch (Using 8086). 5. Interfacing ADC and DAC. 6. Parallel Communication between two MP Kits using Mode 1 and Mode 2 of 8255. 7. Interfacing and Programming 8279, 8259, and 8253. 8. Serial Communication between two MP Kits using 8251. 9. Interfacing and Programming of Stepper Motor and DC Motor Speed control. 10. Programming using Arithmetic, Logical and Bit Manipulation instructions of 8051 microcontroller. 11. Programming and verifying Timer, Interrupts and UART operations in 8051 microcontroller. 12. Communication between 8051 Microcontroller kit and PC.

G.KUMARAN.M.E, Assistant Professor

Department of ECE

SKP ENGINEERING COLLEGE ADDITION OF TWO 16-BIT NUMBERS EXPT NO: 1 DATE:

TIRUVANNAMALAI

AIM: To write an Assembly Language Program (ALP) for performing the addition operation of two byte numbers. APPARATUS REQUIRED: SL.N O 1. 2. ITEM Microprocessor kit Power Supply SPECIFICATION 8086 kit +5 V dc QUANTITY 1 1

PROBLEM STATEMENT: Write an ALP in 8086 to add and subtract two byte numbers stored in the memory location 1200H to 1202H and store the result in the memory location 1204H to 1205H.Also provide an instruction in the above program to consider the carry also and store the carry in the memory location 1206H. ALGORITHM: 1. 2. 3. 4. 5. 6. 7. Initialize the CX to count the carry Get the first number in AX. Get the second number in BX. Add the content of AX with BX If there is carry, increment CX by 1. Store the sum. Store the carry

PROGRAM MEMORY ADDRESS 1100 1103 1106 110A 110C 110E 110F 1113 1116 LABEL PROGRAM MOV CX, 0000H MOV AX,[1200] MOV BX, [1202] ADD AX,BX JNC L1 INC CX MOV [1206],CX MOV [1204], AX HLT OPCODE COMMENTS

L1 :

B9 00 00 Initialize counter CX A1 00 12 Get the first data in AX reg 8B 1E 02 12 Get the second data in BX reg Add the contents of both the regs 03 C3 AX & BX 73 01 Check for carry 41 If carry exists, increment the CX 89 0E 06 12 Store the carry A3 04 12 Store the sum F4 Stop the program Department of ECE 3

G.KUMARAN.M.E, Assistant Professor

SKP ENGINEERING COLLEGE FLOWCHART START

TIRUVANNAMALAI

Initialize the CX for Carry

GET FIRST OPERAND in AX

GET SECOND OPERAND IN BX

A=A+B

YES IS THERE ANY CARRY COUNTER = COUNTER + 1 NO STORE THE SUM

STORE THE CARRY

STOP

OBSERVATION
INPUT MEMORY DATA MANUAL CALCULATION 1200 1201 1202 1203 1204 OUTPUT 1205 1206

RESULT:

Thus addition of two 16-bit numbers is performed and the result is stored.
G.KUMARAN.M.E, Assistant Professor Department of ECE 4

SKP ENGINEERING COLLEGE TIRUVANNAMALAI SUBTRACTION OF TWO 16-BIT NUMBERS EXPT NO:2 DATE:

AIM: To write an Assembly Language Program (ALP) for performing the subtraction operation of two byte numbers. APPARATUS REQUIRED: SL.N ITEM O 1. Microprocessor kit 2. Power Supply PROBLEM STATEMENT Write an ALP in 8086 to add and subtract two byte numbers stored in the memory location 1000H to 1003H and store the result in the memory location 1004H to 1005H.Also provide an instruction in the above program to consider the barrow and store the barrow in the memory location 1006H. ALGORITHM 1. 2. 3. 4. 5. 6. 7. Initialize the CX to count the barrow Get the first number in AX. Get the second number in BX. Subtract the content of BX from AX If there is barrow, increment CX by 1 and take twos complement for difference. Store the difference. Store the barrow

SPECIFICATION 8086 kit +5 V dc

QUANTITY 1 1

PROGRAM MEMORY ADDRESS 1100 1103 1106 110A 110C 110E 110F 1111 1112 1116 1119 LABEL PROGRAM MOV CX, 0000H MOV AX,[1200] MOV BX, [1202] SUB AX,BX JNC L1 INC CX NOT AX INC AX L1 : MOV [1206],CX MOV [1204], AX HLT OPCODE B9 00 00 A1 00 12 8B 1E 02 12 2B C3 73 04 41 F7 D0 40 89 0E 06 12 A3 04 12 F4 COMMENTS Initialize counter CX Get the first data in AX reg Get the second data in BX reg Subtract the contents of BX from AX Check for borrow If borrow exists, increment the CX Twos complement of AX Store the borrow Store the difference Stop the program Department of ECE 5

L1 :

G.KUMARAN.M.E, Assistant Professor

SKP ENGINEERING COLLEGE FLOWCHART START SET UP COUNTER (BORROW)

TIRUVANNAMALAI

GET FIRST OPERAND TO AX

SUBTRACT SECOND OPERAND FROM AX

YES IS THERE ANY CY NO CX=CX+1,2S COMP OF AX = COUNTER + 1

STORE THE DIFFERENCE

STORE THE CARRY

STOP

OBSERVATION
INPUT MEMORY DATA MANUAL CALCULATION 1200 1201 1202 1203 1204 OUTPUT 1205 1206

RESULT:

Thus subtraction of two 16-bit numbers is performed and the result is stored.
G.KUMARAN.M.E, Assistant Professor Department of ECE 6

SKP ENGINEERING COLLEGE TIRUVANNAMALAI MULTIPLICATION OF TWO 16-BIT NUMBERS EXPT NO:3 DATE: AIM:

To write an Assembly Language Program (ALP) for performing the multiplication operation of 16-bit numbers. APPARATUS REQUIRED: SL.N O 1. 2. ITEM Microprocessor kit Power Supply SPECIFICATION 8086 +5 V dc QUANTITY 1 1

PROBLEM STATEMENT: Write an ALP in 8086 MP to multiply two 16-bit binary numbers and store the result in the memory location. ALGORITHM: 1. Get the multiplier in AX. 2. Get the multiplicand in BX 3. Multiply the content of AX with BX 4. Store the result
FLOWCHART Start

Get Multiplier AX X

Get Multiplicand BX Multiplicand MULTIPLICAND =00 Multiply AX with BX STORE THE RESULT G.KUMARAN.M.E, Assistant Professor STOP Department of ECE 7

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

PROGRAM MEMORY ADDRESS 1100 1103 1107 1109 110C 110E 1111

LABEL

PROGRAM MOV AX,[1200] MOV BX, [1202] MUL BX MOV [1204],AX MOV AX,DX MOV [1206],AX HLT

OPCODE A1 00 12 8B 1E 02 12 F7 E3 A3 04 12 8B C2 A3 06 12 F4

COMMENTS Get the first data Get the second data Multiply both Store the lower order product Copy the higher order product to AX Store the higher order product Stop the program

OBSERVATION
INPUT MEMORY DATA 1200 1201 1202 1203 1204 OUTPUT 1205 1206 1207

MANUAL CALCULATION

RESULT

Thus multiplication of two byte numbers is performed and the result is stored.
G.KUMARAN.M.E, Assistant Professor Department of ECE 8

SKP ENGINEERING COLLEGE DIVISION OF TWO 16-BIT NUMBERS EXPT NO:4 DATE: AIM:

TIRUVANNAMALAI

To write an Assembly Language Program (ALP) for performing the division operation of 16-bit numbers. APPARATUS REQUIRED: SL.N ITEM O 1. Microprocessor kit 2. Power Supply

SPECIFICATION 8086 +5 V dc

QUANTITY 1 1

PROBLEM STATEMENT: Write an ALP in 8086 MP to DIVIDE two 16-bit binary numbers and store the result in the memory location. ALGORITHM: 1. 2. 3. 4. Get the dividend in AX Get the divisor in BX Divide the content of AX with BX Store the result

FLOWCHART Start

Get Dividend AX X

Get Divisor BX Multiplicand MULTIPLICAND =00 Divide AX with BX STORE THE RESULT

STOP G.KUMARAN.M.E, Assistant Professor Department of ECE 9

SKP ENGINEERING COLLEGE PROGRAM MEMORY ADDRESS 1100 1103 1106 110A 110C 110E 110F

TIRUVANNAMALAI

LABEL

PROGRAM MOV AX,[1200] MOV BX, [1202] DIV BX MOV [1204],AX MOV AX,DX MOV [1206],AX HLT

OPCODE A1 00 12 8B 1E 02 12 F7 F3 A3 04 12 8B C2 A3 06 12 F4

COMMENTS Get the dividend Get the divisor Divide the dividend by divisor Store the quotient Copy the reminder Store the reminder Stop the program

OBSERVATION
INPUT MEMORY DATA 1200 1201 1202 1203 1204 OUTPUT 1205 1206 1207

MANUAL CALCULATION

RESULT

Thus Division of two byte numbers is performed and the result is stored.

G.KUMARAN.M.E, Assistant Professor

Department of ECE

10

SKP ENGINEERING COLLEGE TIRUVANNAMALAI SORTING THE ARRAY IN ASCENDING ORDER EXPT NO:5 DATE: AIM:

To write an Assembly Language Program (ALP) to sort a given array in ascending order. APPARATUS REQUIRED: SL.NO ITEM 1. Microprocessor kit 2. Power Supply

SPECIFICATION 8086 +5 V dc

QUANTITY 1 1

PROBLEM STATEMENT: An array of length 10 is given from the location. Sort it into descending and ascending order and store the result. ALGORITHM 1. Start the program 2. Move data to CX register and move CX data to DI register 3. Move 1200 to the BX register and move the content of 1200 to memory of AX 4. Compare the content of AX with 1202 5. Jump on borrow to rep 6. Move the data in memory to AX and move Data from AX to AI 7. Add Data to BX register and go to loop2 8. Perform no operation and move data & DI to CX 9. Go to the loop. PROGRAM

G.KUMARAN.M.E, Assistant Professor

Department of ECE

11

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

G.KUMARAN.M.E, Assistant Professor

Department of ECE

12

SKP ENGINEERING COLLEGE FLOWCHART

TIRUVANNAMALAI

RESULT: Thus the assembly language programs for sorting- ascending order was executed are verified.

G.KUMARAN.M.E, Assistant Professor

Department of ECE

13

SKP ENGINEERING COLLEGE TIRUVANNAMALAI SORTING THE ARRAY IN DESCENDING ORDER EXPT NO:6 DATE: AIM:

To write an Assembly Language Program (ALP) to sort a given array in ascending order. APPARATUS REQUIRED: SL.NO ITEM 1. Microprocessor kit 2. Power Supply

SPECIFICATION 8086 +5 V dc

QUANTITY 1 1

PROBLEM STATEMENT: An array of length 10 is given from the location. Sort it into descending and ascending order and store the result. ALGORITHM 1. Start the program 2. Move data to CX register and move CX data to DI register 3. Move 1200 to the BX register and move the content of 1200 to memory of AX 4. Compare the content of AX with 1202 5. Jump on no borrow to rep 6. Move the data in memory to AX and move Data from AX to AI 7. Add Data to BX register and go to loop2 8. Perform no operation and move data & DI to CX 9. Go to the loop 10. Stop the program PROGRAM

FLOWCHART

G.KUMARAN.M.E, Assistant Professor

Department of ECE

14

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

G.KUMARAN.M.E, Assistant Professor

Department of ECE

15

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

RESULT: Thus the assembly language programs for sorting- descending order was executed are verified.

G.KUMARAN.M.E, Assistant Professor

Department of ECE

16

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

STRING MANIPULATION USING 8086


EXPT NO:7 DATE: AIM:

To write an assembly language program to move a byte of string of length FF from a source to a destination. APPARATUS REQUIRED: SL.NO ITEM 1. Microprocessor kit 2. Power Supply SPECIFICATION 8086 +5 V dc QUANTITY 1 1

ALGORITHM 1. Start the program. 2. Set the SI to point the source array and DI at destination location. 3. Move the string size to CX register. 4. Direction Flag is cleared so that SI & DI will auto increment after each loop. 5. Move the bytes of the string using MOVSB instruction. 6. Stop the program.

G.KUMARAN.M.E, Assistant Professor

Department of ECE

17

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

RESULT: Thus the string was moved from source to destination using the assembly language of 8086.
G.KUMARAN.M.E, Assistant Professor Department of ECE 18

SKP ENGINEERING COLLEGE EXPT NO:8 DATE:

TIRUVANNAMALAI

SEARCHING THE LARGEST NUMBER USING 8086

AIM:

To write an Assembly Language Program (ALP) to find the largest number in a given array. APPARATUS REQUIRED: SL.N O 1. 2. ITEM Microprocessor kit Power Supply SPECIFICATION 8086 +5 V dc QUANTITY 1 1

PROBLEM STATEMENT: An array of length 10 is given from the location. Find the largest number and store the result. ALGORITHM: 1. Load the array count in a register C1. 2. Get the first two numbers. 3. Compare the numbers and exchange if the number is small. 4. Get the third number from the array and repeat the process until C1 is 0.
PROGRAM MEMORY ADDRESS 1100 1103 1105 1106 1108 110A 110B 110D 110F 1111 1113 1115 1118 111A L1 : L2 :

LABEL

PROGRAM MOV SI,1200H MOV CL,[SI] INC SI MOV AL,[SI] DEC CL INC SI CMP AL,[SI] JNB L1 MOV AL,[SI] DEC CL JNZ L2 MOV DI,1300H MOV [DI],AL HLT

OPCODE BE 00 12 8A 0C 46 8A 04 FE C9 46 3A 04 73 02 8A 04 FE C9 75 F5 BF 00 13 88 05 F4

COMMENTS Initialize array size Initialize the count Go to next memory location Move the first data in AL Reduce the count Move the SI pointer to next data Compare two datas If AL > [SI] then go to L1 ( no swap) Else move the large number to AL Decrement the count If count is not zero go to L2 Initialize DI with 1300H Else store the biggest number in 1300 location Stop Department of ECE 19

G.KUMARAN.M.E, Assistant Professor

SKP ENGINEERING COLLEGE FLOWCHART START

TIRUVANNAMALAI

INITIALIZE COUNT POINTER MAX = 0 PONITER = POINTER + 1

IS MAX POINTER YES NO MAX = POINTER

COUNT = COUNT-1 NO IS COUNT = 0? YES STORE MAXIMUM NO

STOP

OBSERVATION INPUT MEMORY DATA 1200 1201 1202 1203 1204 1205 1206 OUTPUT 1300

RESULT

Thus largest number is found in a given array.


G.KUMARAN.M.E, Assistant Professor Department of ECE 20

SKP ENGINEERING COLLEGE EXPT NO:9 DATE: AIM:

TIRUVANNAMALAI

SEARCHING THE SMALLEST NUMBER USING 8086

To write an Assembly Language Program (ALP) to find the smalest number in a given array. APPARATUS REQUIRED: SL.N ITEM O 1. Microprocessor kit 2. Power Supply PROBLEM STATEMENT: An array of length 10 is given from the location. Find the smallest number and store the result. ALGORITHM: 5. Load the array count in a register C1. 6. Get the first two numbers. 7. Compare the numbers and exchange if the number is large. 8. Get the third number from the array and repeat the process until C1 is 0.
PROGRAM MEMORY ADDRESS 1100 1103 1105 1106 1108 110A 110B 110D 110F 1111 1113 1115 1118 111A L1 : L2 :

SPECIFICATION 8086 +5 V dc

QUANTITY 1 1

LABEL

PROGRAM MOV SI,1200H MOV CL,[SI] INC SI MOV AL,[SI] DEC CL INC SI CMP AL,[SI] JC L1 MOV AL,[SI] DEC CL JNZ L2 MOV DI,1300H MOV [DI],AL HLT

OPCODE BE 00 12 8A 0C 46 8A 04 FE C9 46 3A 04 72 02 8A 04 FE C9 75 F5 BF 00 13 88 05 F4

COMMENTS Initialize array size Initialize the count Go to next memory location Move the first data in AL Reduce the count Move the SI pointer to next data Compare two datas If AL > [SI] then go to L1 ( no swap) Else move the large number to AL Decrement the count If count is not zero go to L2 Initialize DI with 1300H Else store the biggest number in 1300 location Stop Department of ECE 21

G.KUMARAN.M.E, Assistant Professor

SKP ENGINEERING COLLEGE FLOWCHART START

TIRUVANNAMALAI

INITIALIZE COUNT POINTER MAX = 0 PONITER = POINTER + 1

ISMAX<= POINTER YES NO MAX = POINTER

COUNT = COUNT-1 NO IS COUNT = 0? YES STORE MAXIMUM NO

STOP

OBSERVATION INPUT MEMORY DATA RESULT 1200 1201 1202 1203 1204 1205 1206 OUTPUT 1300

Thus smallest number is found in a given array.


G.KUMARAN.M.E, Assistant Professor Department of ECE 22

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

INTERFACING ADC WITH 8086


EXPT NO:10 DATE: AIM:

To write an Assembly Language Program (ALP) to interface ADC with 8086 microprocessor. APPARATUS REQUIRED: SL.NO ITEM 1. Microprocessor kit 2. Power Supply 3. ADC Interface card 4. CRO ALGORITHM Analog to Digital Convertor 1. Initialaize the ADC 2. Start the conversion. 3. Wait for end of conversion. 4. Store the converted digital output.

SPECIFICATION 8086 +5 V dc 30MHz

QUANTITY 1 1 1 1

G.KUMARAN.M.E, Assistant Professor

Department of ECE

23

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

PROGRAM-ADC

OBSERVATION

RESULT Thus, the programs for Interfacing ADC have been executed using 8086 Microprocessor
G.KUMARAN.M.E, Assistant Professor Department of ECE 24

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

INTERFACING DAC WITH 8086


EXPT NO:11 DATE: AIM:

To write an Assembly Language Program (ALP) to interface DAC with 8086 microprocessor. APPARATUS REQUIRED: SL.NO ITEM 1. Microprocessor kit 2. Power Supply 3. DAC Interface card 4. CRO ALGORITHM Generating square wave 1. Send 00h to DAC to generate lower amplitude. 2. Call delay based on required frequency. 3. Send FFh to DAC to generate higher amplitude. 4. Call delay based on required frequency. 5. Repeat the above steps continuously. Generating saw tooth wave 1. Initialize AL with 00h. 2. Increment the AL by one. 3. Send the content of AL to DAC. 4. Go to the step1. Generating Triangular wave 1. Initialize AL with 00h. 2. Increment the AL by one. 3. Check the content of AL. If AL=00h then go to step 6. 4. Send the content of AL to DAC. 5. Go to step2. 6. Move FFh to AL. 7. Decrement the AL by one. 8. Check the content of AL. If AL=00h then go to step 11. 9. Send the content of AL to DAC. 10. Go to step7. 11. Go to the step1.
G.KUMARAN.M.E, Assistant Professor Department of ECE 25

SPECIFICATION 8086 +5 V dc 30MHz

QUANTITY 1 1 1 1

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

PROGRAM-Saw tooth wave

OBSERVATION S.No Amplitude (volts) Time period( ) Frequency( )

PROGRAM-Square wave

G.KUMARAN.M.E, Assistant Professor

Department of ECE

26

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

OBSERVATION S.No Amplitude (volts) Time period( ) Frequency( ON Time OFF Time )

PROGRAM-Triangular wave

OBSERVATION S.No Amplitude (volts) Time period( ) Frequency( )

RESULT Thus, the programs for Interfacing DAC operations have been executed using 8086 Microprocessor
G.KUMARAN.M.E, Assistant Professor Department of ECE 27

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

PARALLEL COMMUNICATION BETWEEN TWO MP KITS USING 8255


EXPT NO:12 DATE:

AIM To perform interface program of parallel communication between two mp kits Using 8255. APPARATUS REQUIRED: SL.NO ITEM 1. Microprocessor kit 2. Power Supply 3. 8255 Interface card VXT PARALLEL BUS 4.
I/O MODES: Control Word:

SPECIFICATION 8086 +5 V dc

QUANTITY 2 2 2 1

G.KUMARAN.M.E, Assistant Professor

Department of ECE

28

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

TRANSMITTER ALGORITHM 1. Initialize port-A as output port. 2. Send the sample data (ABh) on Port-A. PROGRAM ADDRESS LABEL MNEMONICS 1000 MOV AL,80 1002 OUT 0F,AL 1004 MOV AL,AB (DATA) 1006 OUT 0C,AL 1008 HLT RECEIVER ALGORITHM 1. Initialize port-A as input port. 2. Receive the sample data (ABh) from Port-A. PROGRAM ADDRESS LABEL MNEMONICS 1000 MOV AL,90 1002 OUT 26,AL 1004 IN AL,20H 1006 MOV BX,[1250] 1009 MOV [BX],AL 100B HLT OBSERVATION
MEMORY DATA 1250

OPCODES B0 80 E6 26 B0 AB E6 20 F4

OPCODES B0 90 E6 26 E4 20 BB 50 12 88 07 F4

RESULT: Thus, the programs for parallel communication between two 8086 microprocessor kits using 8255 have been executed.

G.KUMARAN.M.E, Assistant Professor

Department of ECE

29

SKP ENGINEERING COLLEGE EXPT NO:13 DATE: AIM:

TIRUVANNAMALAI

INTERFACING AND PROGRAMMING OF 8279

To write an Assembly Language Program (ALP) to interface 8279 and to perform rolling display.

APPARATUS REQUIRED: SL.N ITEM O 1. Microprocessor kit 2. Power Supply 3. 8279 Interface board 4. VXT parallel bus
PROGRAM

SPECIFICATION 8086 +5 V dc

QUANTITY 1 1 1 1

G.KUMARAN.M.E, Assistant Professor

Department of ECE

30

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

SUBROUTINE-DELAY

LOOKUP TABLE ADDRESS DATA 1200 FF FF FF FF 1204 97 93 97 FF 1208 FF C7 FF FF 120C FF FF FF FF RESULT Thus the 8279 was interfaced with 8086, programmed to Display the word ECE-A and output was verified.

G.KUMARAN.M.E, Assistant Professor

Department of ECE

31

SKP ENGINEERING COLLEGE EXPT NO:14 DATE: AIM:

TIRUVANNAMALAI

INTERFACING AND PROGRAMMING OF 8253

To write an Assembly Language Program (ALP) to interface 8253 and generating square wave. APPARATUS REQUIRED: SL.NO ITEM 1. Microprocessor kit 2. Power Supply 3. 8253 Interface board 4. VXT parallel bus PROGRAM

SPECIFICATION 8086 +5 V dc

QUANTITY 1 1 1 1

OBSERVATION Amplitude (volts) S.No Time period( ) Frequency( )

RESULT Thus the 8253 was interfaced with 8086, programmed to generate square wave and output was verified.
G.KUMARAN.M.E, Assistant Professor Department of ECE 32

SKP ENGINEERING COLLEGE EXPT NO:15 DATE: AIM:

TIRUVANNAMALAI

INTERFACING AND PROGRAMMING OF 8259

To write an Assembly Language Program (ALP) to interface 8259 and accept an interrupt. APPARATUS REQUIRED: SL.NO ITEM 1. Microprocessor kit 2. Power Supply 3. 8259 Interface board 4. VXT parallel bus
PROGRAM

SPECIFICATION 8086 +5 V dc

QUANTITY 1 1 1 1

G.KUMARAN.M.E, Assistant Professor

Department of ECE

33

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

OBSERVATION Press the switch IR0. The CPU control is transferred to ISR. Data is displayed on interface board. Since no EOI command is given the 8259 will not accept further interrupts. However due to special mask mode, 8259 will accept interrupt only at IRI

RESULT Thus the 8259 was interfaced with 8086, programmed to accept an interrupt and output was verified.

G.KUMARAN.M.E, Assistant Professor

Department of ECE

34

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

SERIAL COMMUNICATION USING 8251


EXPT NO:16 DATE: AIM:

To write an Assembly Language Program (ALP) to interface 8251 and perform serial communication. APPARATUS REQUIRED: SL.NO ITEM 1. Microprocessor kit 2. Power Supply 3. 8251 Interface board 4. VXT parallel bus PROGRAM
MEMORY LABEL PROGRAM ADDRESS 1100 L1 IN AL,0A TEST 1102 AL,04 1104 JZ L1 MOV 1106 AL,A2 1108 OUT 08,AL 110A L2 IN AL,0A TEST 110C AL,02 110E JZ L2 IN AL,08 1110 1112 1115 MOV [1200],AL HLT OPCODE E4 0A A8 04 74 FA B0 A2 E6 08 E4 0A A8 02 74 FA E4 08 A2 00 12 F4 COMMENTS Move 0A to AL Test with 04 If Z repeat testing Move A2 to AL Send AL to serial port Move 0A to AL Test with 02 If Z repeat testing Receive the data from serial port Store the data in 1200 Stop the process

SPECIFICATION 8086 +5 V dc

QUANTITY 1 1 1 1

OBSERVATION
OUTPUT MEMORY DATA 1200

RESULT Thus the 8251 was interfaced with 8086, programmed to transfer data serially and output was verified.
G.KUMARAN.M.E, Assistant Professor Department of ECE 35

SKP ENGINEERING COLLEGE EXPT NO: 17 DATE:

TIRUVANNAMALAI

INTERFACING AND PROGRAMMING OF STEPPER MOTOR

AIM To write an assembly language program to interface stepper motor with 8086. APPARATUS REQUIRED SL.NO ITEM 1. Microprocessor kit 2. Power Supply 3. Stepper motor Interface board 4. VXT parallel bus 5. Stepper Motor THEORY A motor in which the rotor is able to assume only discrete stationary angular position is a stepper motor. The rotary motion occurs in a step-wise manner from one equilibrium position to the next. Stepper Motors are used very wisely in position control systems like printers, disk drives, process control machine tools, etc. The basic two-phase stepper motor consists of two pairs of stator poles. Each of the four poles has its own winding. The excitation of any one winding generates a North Pole. A South Pole gets induced at the diametrically opposite side. The rotor magnetic system has two end faces. It is a permanent magnet with one face as South Pole and the other as North Pole. The Stepper Motor windings A1, A2, B1, B2 are cyclically excited with a DC current to run the motor in clockwise direction. By reversing the phase sequence as A1, B2, A2, B1, anticlockwise stepping can be obtained. 2-PHASE SWITCHING SCHEME In this scheme, any two adjacent stator windings are energized. The switching scheme is shown in the table given below. This scheme produces more torque.

SPECIFICATION 8086 +5 V dc

QUANTITY 1 1 1 1 1

G.KUMARAN.M.E, Assistant Professor

Department of ECE

36

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

ADDRESS DECODING LOGIC The 74138 chip is used for generating the address decoding logic to generate the device select pulses, CS1 & CS2 for selecting the IC 74175.The 74175 latches the data bus to the stepper motor driving circuitry. Stepper Motor requires logic signals of relatively high power. Therefore, the interface circuitry that generates the driving pulses uses silicon Darlington pair transistors. The inputs for the interface circuit are TTL pulses generated under software control using the Microcontroller Kit. The TTL levels of pulse sequence from the data bus are translated to high voltage output pulses using a buffer 7407 with open collector. PROGRAM

RESULT Thus, the program for interfacing of stepper motor was written and executed using 8086 microprocessor.

G.KUMARAN.M.E, Assistant Professor

Department of ECE

37

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

DIGITAL CLOCK AND STOP WATCH


EXPT NO:18 DATE: AIM:

To write an Assembly Language Program (ALP) to design digital clock and stop watch using 8086 microprocessor. APPARATUS REQUIRED: SL.N ITEM O 1. Microcontroller kit 2. Power Supply
PROGRAM

SPECIFICATION 8086 +5 V dc

QUANTITY 1 1

G.KUMARAN.M.E, Assistant Professor

Department of ECE

38

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

G.KUMARAN.M.E, Assistant Professor

Department of ECE

39

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

RESULT: Thus, the programs for Digital clock have been executed using 8086 Microprocessor

G.KUMARAN.M.E, Assistant Professor

Department of ECE

40

SKP ENGINEERING COLLEGE EXPT NO:19 DATE: AIM:

TIRUVANNAMALAI

ADDITION OF TWO 8-BIT NUMBERS USING 8051

To write an assembly language program to add the two 8-bit numbers Using 8051 Microcontroller instruction set. APPARATUS REQUIRED: SL.NO ITEM 1. Microcontroller kit 2. Power Supply

SPECIFICATION 8051 +5 V dc

QUANTITY 1 1

ALGORITHM 1. Clear C-register for carry. 2. Move the first data to Accumulator. 3. Add the second data with Accumulator. 4. Store the sum in memory pointed by DPTR.

RESULT Thus, the assembly language program to add the two 8-bit numbers Using 8051 instruction set was written and executed successfully.
G.KUMARAN.M.E, Assistant Professor Department of ECE 41

SKP ENGINEERING COLLEGE EXPT NO:20 DATE: AIM:

TIRUVANNAMALAI

SUBTRACTION OF TWO 8-BIT NUMBERS USING 8051

To write an assembly language program to subtract the two 8-bit numbers Using 8051 Microcontroller instruction set. APPARATUS REQUIRED: SL.NO ITEM 1. Microcontroller kit 2. Power Supply

SPECIFICATION 8051 +5 V dc

QUANTITY 1 1

ALGORITHM 1. Clear C-register for carry. 2. Move the first data to Accumulator. 3. Subtract the second data with Accumulator. 4. Store the sum in memory pointed by DPTR.

RESULT Thus, the assembly language program to add the two 8-bit numbers Using 8051 instruction set was written and executed successfully.
G.KUMARAN.M.E, Assistant Professor Department of ECE 42

SKP ENGINEERING COLLEGE EXPT NO:21 DATE: AIM:

TIRUVANNAMALAI

MULTIPLICATION OF TWO 8-BIT NUMBERS USING 8051

To write an assembly language program to multiply the two 8-bit numbers Using 8051 Microcontroller instruction set. APPARATUS REQUIRED: SL.NO ITEM 1. Microcontroller kit 2. Power Supply ALGORITHM 1. Clear C-register for carry. 2. Move the first data to Accumulator. 3. Move the second data to B-register. 4. Multiply the second data with Accumulator. 5. The higher order of the result is in B-register. 6. The lower order of the result is in Accumulator. 7. Store the sum in memory pointed by DPTR.

SPECIFICATION 8051 +5 V dc

QUANTITY 1 1

G.KUMARAN.M.E, Assistant Professor

Department of ECE

43

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

RESULT Thus, the assembly language program to multiply the two 8-bit numbers Using 8051 instruction set was written and executed successfully.

G.KUMARAN.M.E, Assistant Professor

Department of ECE

44

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

DIVISION OF TWO 8-BIT NUMBERS USING 8051


EXPT NO:22 DATE: AIM:

To write an assembly language program to divide the two 8-bit numbers Using 8051 Microcontroller instruction set. APPARATUS REQUIRED: SL.NO ITEM 1. Microcontroller kit 2. Power Supply ALGORITHM 1. Clear C-register for carry. 2. Move the first data to Accumulator. 3. Move the second data to B-register. 4. Multiply the second data with Accumulator. 5. The remainder of the result is in B-register. 6. The quotient of the result is in Accumulator. 7. Store the sum in memory pointed by DPTR.

SPECIFICATION 8051 +5 V dc

QUANTITY 1 1

G.KUMARAN.M.E, Assistant Professor

Department of ECE

45

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

RESULT Thus, the assembly language program to divide the two 8-bit numbers using 8051 instruction set was written and executed successfully.

G.KUMARAN.M.E, Assistant Professor

Department of ECE

46

SKP ENGINEERING COLLEGE EXPT NO:23 DATE:

TIRUVANNAMALAI

ONES AND TWOS COMPLEMENT USING 8051

AIM To write an assembly language program to find the 1s and 2s complement of an 8-bit number using microcontroller instruction set. APPARATUS REQUIRED: SL.NO ITEM 1. Microcontroller kit 2. Power Supply SPECIFICATION 8051 +5 V dc QUANTITY 1 1

ALGORITHM 1. Move the data to Accumulator. 2. Complement the accumulator. 3. Move the ones complement output to the memory 6500H. 4. Add 01H with accumulator. 5. Move the twos complement output to the memory 6501H. PROGRAM

G.KUMARAN.M.E, Assistant Professor

Department of ECE

47

SKP ENGINEERING COLLEGE

TIRUVANNAMALAI

RESULT Thus the assembly language program to find the 1s and 2s complement of an 8bit number using 8051 instruction set was written and executed successfully.

G.KUMARAN.M.E, Assistant Professor

Department of ECE

48

SKP ENGINEERING COLLEGE EXPT NO:24 DATE:

TIRUVANNAMALAI

MASKING BITS IN AN 8 BIT NUMBERS USING 8051

AIM To write an assembly language program to find the Masking bits an 8-bit number using microcontroller instruction set. APPARATUS REQUIRED: SL.NO ITEM 1. Microcontroller kit 2. Power Supply

SPECIFICATION 8051 +5 V dc

QUANTITY 1 1

ALGORITHM 1. Move the data to Accumulator. 2. Perform AND operation with accumulator. 3. Move the accumulator output to the memory 6500H. PROGRAM

RESULT Thus the assembly language program to masking bits an 8-bit number using microcontroller instruction set was written and executed successfully.
G.KUMARAN.M.E, Assistant Professor Department of ECE 49

Вам также может понравиться