Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 11

KNOWLEDGE INSTITUTE OF TECHNOLOGY

(An Autonomous Institution)


Approved by AICTE, New Delhi and Affiliated to Anna University, Chennai
Kakapalayam (PO), Salem - 637 504.

LABORATORY MANUAL

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

NAME OF THE LABORATORY: ET3491- EMBEDDED SYSTEMS AND IOT DESIGN


LABORATORY

PREPARED BY APPROVED BY

KIOT/ECE/ES&IOT DESIGN LAB MANUAL Page 1


SYLLABUS

Subject Code/Name: ET3491- EMBEDDED SYSTEMS AND IOT DESIGN LAB


Year/Sem/Sec: III/VI/A&B

LIST OF EXPERIMENTS:

Experiments using 8051


1. Programming Arithmetic and Logical Operations in 8051.
2. Generation of Square waveform using 8051.
3. Programming using On–Chip ports in 8051.
4. Programming using Serial Ports in 8051.
5. Design of a Digital Clock using Timers/Counters in 8051.
Experiments using ARM

6. Interfacing ADC and DAC


7. Blinking of LEDs and LCD
8. Interfacing keyboard and Stepper Motor.

Mini projects for IoT

9. Garbage Segregator and Bin Level Indicator


10. Colour-based Product Sorting
11. Image Processing-based Fire Detection
12. Vehicle Number Plate Detection
13. Smart Lock System

KIOT/ECE/ES&IOT DESIGN LAB MANUAL Page 2


LIST OF EXPERIMENTS
Subject Code/Name: ET3491- EMBEDDED SYSTEMS AND IOT DESIGN LAB
Year/Sem/Sec: III/VI/A&B

CYCLE I
1. Programming Arithmetic and Logical Operations in 8051.
2. Generation of Square waveform using 8051.
3. Programming using On–Chip ports in 8051.
4. Programming using Serial Ports in 8051.
5. Design of a Digital Clock using Timers/Counters in 8051.
6. Interfacing ADC and DAC
7. Blinking of LEDs and LCD
8. Interfacing keyboard and Stepper Motor

CYCLE II

9. Garbage Segregator and Bin Level Indicator


10. Colour-based Product Sorting
11. Image Processing-based Fire Detection
12. Vehicle Number Plate Detection
13. Smart Lock System

CONTENT BEYOND SYLLABUS

14. LCM of a number using MASM

` 15. Factorial of a number using MASM

KIOT/ECE/ES&IOT DESIGN LAB MANUAL Page 3


EX. NO:01
PROGRAMMING WITH ARITHMETIC AND LOGICAL INSTRUCTIONS USING 8051
DATE:

AIM:
To write and execute assembly language programs for Addition, Subtraction,
Multiplication, Division, AND & OR operation using an 8051 microcontroller.
APPARATUS REQUIRED:
S.NO APPRATAUS NAME RANGE QUANTITY
1. 8051 Microcontroller Kit - 01
2. Power Supply Unit 5V 01

ALGORITHM:
ADDITION:
1. Clear carry
2. Move data1 to accumulator
3. Add data2 with accumulator.
4. Move content in memory location to DPTR.
5. Increment DPTR.
6. Add with carry
7. Move data to the DPTR location
8. Stop the program.
PROGRAM:
ADDITION:
ADDRESS LABEL OPCODE MNEMONICS OPERAND COMMENTS
8100 C3 CLR C Clear Carry
8101 74,04 MOV A, #DATA1 Move data1 to acc
8103 24,02 ADD A, #DATA2 Add data2 with acc
90,85,0 DPTR, Move content in 4500 to
8105 MOV
0 #8500h DPTR.
Move data to DPTR
8108 FO MOVX @DPTR, A
location
8109 A3 INC DPTR Increment DPTR
810A 74,12 MOV A, #DATA1 Move data1 to acc
810C 34,56 ADDC A, #DATA2 Add with carry
Move data to DPTR
810E FO MOVX @DPTR, A
location

KIOT/ECE/ES&IOT DESIGN LAB MANUAL Page 4


810F HERE 80, FE SJMP HERE End of program
FLOWCHART:

SUBTRACTION: MULTIPLICATION

TABULATION:
SUBTRACTION

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

TABULATION:
MULTIPLICATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

KIOT/ECE/ES&IOT DESIGN LAB MANUAL Page 5


ALGORITHM:

SUBTRACTION: MULTIPLICATION:
1. Clear carry 1. Move data1 to accumulator
2. Move data1 to accumulator 2. Move data2 to B reg.
3. Subtract data2 with accumulator. 3. Multiply accumulator with B reg.
4. Move content in memory location 4. Move content in memory location
to DPTR. to DPTR.
5. Move data to DPTR location 5. Move data to DPTR location
6. Stop the program. 6. Increment DPTR
7. Move Content of B reg to
accumulator.
8. Stop the program.

PROGRAM:
SUBTRACTION:

ADDRESS LABEL OPCODE MNEMONICS OPERAND COMMENTS


8100 C3 CLR C Clear carry
8101 74,20 MOV A, #DATA1 Move data1 to acc
8103 94, 10 SUBB A, #DATA2 Subtract data2 with acc
90,85,0 DPTR, Move content in 4500 to
8105 MOV
0 #8500h DPTR.
8108 FO MOVX @DPTR, A Move acc value to DPTR
location
8109 HERE 80, FE SJMP HERE End of program

PROGRAM:
MULTIPLICATION:
ADDRESS LABEL OPCODE MNEMONICS OPERAND COMMENTS

A,
8100 74,0A MOV Move data01 to acc
#DATA01
75, F0, B,
8102 MOV Move data02 to B reg
88 #DATA02
8105 A4 MUL AB Add data2 with acc
90,85,0 DPTR,#85 Move content in 4500 to
8106 MOV
0 00h DPTR.
Move acc value to DPTR
8109 FO MOVX @DPTR, A
location

KIOT/ECE/ES&IOT DESIGN LAB MANUAL Page 6


810A A3 INC DPTR INC DPTR
810B E5, F0 MOV A, B Move B register value to
acc
Move acc value to DPTR
810D FO MOVX @DPTR, A
location
810E HERE 80, FE SJMP HERE End of program
FLOWCHART:

DIVISION: AND OPERATION

TABULATION:
DIVISION

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

KIOT/ECE/ES&IOT DESIGN LAB MANUAL Page 7


TABULATION:
AND OPERATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

ALGORITHM:
DIVISION: AND OPERATION:
1. Move data1 to accumulator 1. Move data1 to accumulator
2. Move data2 to B reg. 2. Do AND operation between data1
3. Divide accumulator with B reg. & data2.
4. Move content in memory location to 3. Move content in memory location
DPTR. to DPTR.
5. Move data to DPTR location 4. Move data to DPTR location
6. Increment DPTR 5. Stop the program.
7. Move Content of B reg to
accumulator.
8. Stop the program.

PROGRAM:
DIVISION:

ADDRESS LABEL OPCODE MNEMONICS OPERAND COMMENTS


8100 74,0A MOV A, #DATA1 Move data1 to acc
75, F0,
8102 MOV B, #DATA2 Move data1 to B reg
88
8105 84 DIV AB Divide A by B
90,85,0 DPTR, Move content in 4500 to
8106 MOV
0 #8500h DPTR.
Move acc value to DPTR
8109 FO MOVX @DPTR, A
location
810A A3 INC DPTR INC DPTR
Move B register value to
810B E5, F0 MOV A, B
acc
Move acc value to DPTR
810D FO MOVX @DPTR, A
location
810E HERE 80, FE SJMP HERE End of program

KIOT/ECE/ES&IOT DESIGN LAB MANUAL Page 8


PROGRAM:
AND OPERATION:
ADDRESS LABEL OPCODE MNEMONICS OPERAND COMMENTS
8100 74,56 MOV A, #DATA1 Move data1 to acc
8102 54, E3 ADL A, #DATA2 Add data2 with acc
8104 90,85,0 MOV DPTR, Move content in 4500 to
0 #8500H DPTR.
8107 FO MOVX @DPTR, A Move acc value to DPTR
location
8108 HERE 80, FE SJMP HERE End of program

FLOWCHART:
OR OPERATION:

TABULATION:
OR OPERATION:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

KIOT/ECE/ES&IOT DESIGN LAB MANUAL Page 9


ALGORITHM:
OR OPERATION:
1. Move data1 to accumulator
2. Do AND operation between data1 & data2.
3. Move content in memory location to DPTR.
4. Move data to DPTR location
5. Stop the program.

PROGRAM:
OR OPERATION:

ADDRESS LABEL OPCODE MNEMONICS OPERAND COMMENTS


8100 74,56 MOV A, #DATA1 Move data1 to acc
8102 44, E3 ORL A, #DATA2 Perform OR of data2 with
acc
8104 90,85,0 MOV DPTR, Move content in 4500 to
0 #8500H DPTR.
8107 FO MOVX @DPTR, A Move acc value to DPTR
location
8108 HERE 80, FE SJMP HERE End of program

VIVA VOCE:
1. What is the difference between microprocessor and microcontroller?
2. Why is microcontroller 8051 called as 8 bit controller?
3. Name any 2 logical operation instructions.
4. Explain about the instruction SJMP

RESULT:
Thus assembly language program for Addition, Subtraction, Multiplication,
Division, AND & OR operation has been written and executed successfully
using 8051 microcontrollers.

KIOT/ECE/ES&IOT DESIGN LAB MANUAL Page 10


KIOT/ECE/ES&IOT DESIGN LAB MANUAL Page 11

You might also like