Updated microcontroller-lab-EC-606 - Removed
Updated microcontroller-lab-EC-606 - Removed
List Of Experiments
Experiment No 1
Apparatus required:
8085
microprocessor
kitDAC
interface kit
Keyboard
Algorithm:
Addition / Subtraction
Step 1 : Move 1H data to memory
Step 2 : Add or subtract 1H data with
2nd dataStep 3 : Initialize data pointer.
Step 4 : Move result to memory pointed by DPTR.
START
Initialize DPTR
Stop
Multiplication / Division
Step 1 : Get 1H data and 2nd data to memory
Step 2 :Multiply or divide 1H data with 2nd
dataStep : Initialize data pointer.
Step 4 : Move result to memory pointed by DPTR (first
port Step 5 :Increment DPTR
Step 6 : Move 2nd part of result to register A
Step 7 : Move result to 2nd memory location pointer by DPTR
Execution:
Addition:
ML Input ML Output
4103 4500
4109
Execution:
Subtraction:
ML Input ML Output
4101 4500
4103
Execution:
Multiplication:
ML Input Output Address Value
4101 4500
4103
Execution:
Division:
ML Input Output Address Value
4101 4500
4103
Result:
Thus 8-bit addition, subtraction, multiplication and division is performed using 8051.
Signature of Faculty
Experiment No 2
Aim: Write an assembly language program to find the biggest number in
an array of 8-bit unsigned numbers of predetermined length.
Apparatus required:
8051 microcontroller
kit(0-5V) DC battery
Algorithm:
1. Initialize pointer and counter.
2. Load internal memory location 40H as zero.
3. Move the first element of an array to r5 register.
4. Compare the data stored in memory location 40H is equal to or less than the
value of first element of an array.
5. If it is lesser, then move the data of first element to 40H memory location
ELSE increment pointer and decrement counter.
6. Check the counter. If counter is not equal to zero, repeat from the 2nd
step else Move the R5 register to 40H memory location.
7. Stop the program.
Program:
Memory Label Opcode Mnemonics
Location
4100 90 42 00 MOV DPTR,#4200H
MOV 40H,#00H
4103
75 40 00
4106
7D 0A MOV R5,#0AH
4108
LOOP2: E0 MOVX A,@DPTR
4109
B5 40 08 CJNE A,40H,LOOP1
410C
LOOP 3 A3 INC DPTR
410D
DD F9 DJNZ R5,LOOP2
410F
E5 40 MOV A,40H
4111
F0 MOVX @DPTR,A
4112 HLT 80 FE SJMP HLT
INPUT:
Memory address
Data
4200
OUTPUT:
RESULT:
Thus the assembly language program was written to find the largest element in anarray and executed using 8051
microcontroller
Signature of Faculty
Experiment No 3
Aim: Write an assembly language program to convert a binary number to
its equivalent ASCII code and display the result in the address field.
Apparatus required:
8051 microcontroller kit
(0-5V) DC battery
Algorithm:
INPUT:
OUTPUT:
Result:
Thus the assembly language program was written to converter Hexadecimal number to
equivalent ASCII Code and executed using 8051 microcontroller.
Signature of Faculty
Date of Experiment:_________
Experiment No 4
Aim: To write an assembly language program to find the square root of a
given data
Apparatus required:
8051 microcontroller kit
(0-5V) DC battery
Algorithm:
1. Enter a program.
2. Enter the input hex value to location 4200h.
3. Execute the program.
4. The output square root value stored in a location 4500h.
PROGRAM:
Memory Label Opcode Mnemonics Comments
Location
4100 Origin: 90 42 00 MOV DPTR,#4200h Get a input data
4103 e0 MOVX A,@DPTR
4104 f9 MOV R1,a
4105 7a 01 MOV R2, #01h Initialize counter
4107 LOOPI: e9 MOV A,R1
4108 8a f0 MOV B,R2
410a 84 DIV AB divide the given value
and counter
410b fb MOV R3,A
410c ac f0 MOV R4,B
410e 9a SUBB A ,R2 compare
410f 60 03 JZ RESULT Dividend and counter
4111 0a INC R2
4112 80 f3 SJMP L1
Result:
Thus an assembly language program is written to find the square root of a given data and
executed successfully
Signature of Faculty
Date of Experiment______
Experiment 5
Aim: To write an assembly language program Transmitting and Receiving the
data between two kits.
Apparatus required:
8051 microcontroller kit
(0-5V) DC battery
Algorithm:
1. Initialize TMOD with 20H
2. Set the values for TCON and SCON
3. Set the input address to DPTR
4. Based on the bit value on SCON store the data in SBUF
5. Increment DPTR and check for the loop end value
1 00 00
2 11 11
3 22 22
4 33 33
Result:
Thus an assembly language program displaying characters on seven segment display has been
executed.
Signature of Faculty
Date of Experiment___
Experiment 6
Aim: To write an assembly language program to display characters on a seven
display interface.
Apparatus required:
8051 microcontroller kit
(0-5V) DC battery
Algorithm:
1. Enter a program.
2. Initialize number of digits to Scan
3. Select the digit position through the port address C0
4. Display the characters through the output at address C8.
5. Check whether all the digits are display.
6. Repeat the Process.
PROGRAM:
Result:
Thus an assembly language program displaying characters on seven segment display has been
executed.
Signature of Faculty
Date of Experiment:_____
Experiment 7
Aim: To write an assembly language program to convert the digital to analog
signal.
Apparatus required:
8051 microcontroller
kit(0-5V) DC battery
Algorithm:
1. Move the Port Address of DAC 2 FFC8 to the DPTR.
2. Move the Value of Register A to DPTR and then Call the delay.
3. Move the Value of Register A (FFh) to DPTR and the call the dalay.
4. Repeat the steps 2 and 3.
Result:
Thus an assembly language program for Digital to Analog has been executed.
Signature of Faculty
Date of Experiment:______
Experiment -8
Aim: To write an assembly language for analog to digital conversion.
Apparatus required:
8051 microcontroller kit
(0-5V) DC battery
Algorithm:
1. Make ALE low/high by moving the respective data from A register to
DPTR.
2. Move the SOC( Start Of Conversion) data to DPTR from FFD0
3. Check for the End Of Conversion and read data from Buffer at address
FFC0
4. End the Program.
PROGRAM:
Result:
Thus an assembly language program is executed for analog to digital conversion.
Signature of Faculty
Date of Experiment:______
Experiment-9
Aim: To write an assembly program to make the stepper motor run in forward
and reverse direction.
Apparatus required:
Stepper motor
8051 microprocessor kit
(0-5V) power supply
Algorithm:
1. Fix the DPTR with the Latch Chip address FFC0
2. Move the values of register A one by one with some delay based on the 2-
Phase switching Scheme and repeat the loop.
3. For Anti Clockwise direction repeat the step 3 by reversing the value
sequence.
4. End the Program
Result:
Thus an assembly language program to control of stepper motor was executed
successfully using 8051 Microcontroller kit.
Signature of Faculty
Date of Experiment:_____
Experiment-10
Aim: To write an assembly language program to control the Traffic Light.
Apparatus required:
8051 microcontroller kit
(0-5V) DC battery
Algorithm:
1. Fix the control the control and move the control word to control register.
2. Move the Traffic Light LED Position values to Port A, Port B and Port C
respectively based on the logic.
3. Fix the delay based on the requirement.
3. Execute the program.
PROGRAM:
Result:
Thus an assembly language program for the Traffic Light Control has been executed.
Signature of Faculty