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

22EC2106 - P&C LAB Manual

This document is a laboratory manual for the course "Processors & Controllers" (code 22EC2106). It contains information about the course coordinators, objectives, list of experiments to be performed, and evaluation criteria. The manual is intended to guide students in conducting 13 experiments related to microprocessors, microcontrollers, and their applications using tools like Emu 8086, MCU IDE 8051, KEIL and Proteus. It describes the organization of experiments into pre-lab, in-lab, and post-lab sections to reinforce concepts through analysis and feedback.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
144 views

22EC2106 - P&C LAB Manual

This document is a laboratory manual for the course "Processors & Controllers" (code 22EC2106). It contains information about the course coordinators, objectives, list of experiments to be performed, and evaluation criteria. The manual is intended to guide students in conducting 13 experiments related to microprocessors, microcontrollers, and their applications using tools like Emu 8086, MCU IDE 8051, KEIL and Proteus. It describes the organization of experiments into pre-lab, in-lab, and post-lab sections to reinforce concepts through analysis and feedback.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

ELECTRONICS AND COMMUNICATION ENGINEERING

LABORATORY MANUAL
22EC2106
Processors & Controllers

II B.TECH 2023-24 ODD SEMESTER


K L UNIVERSITY| Processors & Controllers -22EC2106
Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

LABORATORY MANUAL
22EC2106
Processors & Controllers

ELECTRONICS AND COMMUNICATION ENGINEERING

STUDENT NAME

REG.NO

YEAR

SEMESTER

SECTION

FACULTY

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

COURSE INTRODUCTION
Course Title : Processors & Controllers
Course Code : 22 EC 2106
L-T-P-S structure : 3-0-2-2
Credits :4
Pre-Requisite : COA
Course Coordinator : Dr.N.Prabakaran
Team of Instructors :
Dr. N.Prabakaran (CC) 4966

Dr. Suman Maloji 841

Dr.Syed.Shameem 2497

Mr. K Sureshkumar 4573

Dr.Ch.Raghava Prasad 2994

Dr. C.S.Preetham Reddy 5129

Dr. K.V.Sowmya 4822

Dr.S.S.Aravinth 6619

Dr.Iwin Thanakumar Joseph 6905

Dr.A.Nesa Rani 6922

Dr.T.Anuradha 6728

Dr.T.Narendra Babu 2924

Mr. P V SIVA RAMBABU 7809

Dr. P . Satyanarayana 2462

Dr.J.R.K.Kumar Dabbakuti 5240


Ms. G.N. LAKSHMI
SOWJANYA 6617

Dr.A.RAJA BASHA 6992

Team of Associates : NIL

Course Objective:
This course provides comprehensive knowledge on the working of Microprocessor
Intel 8086 Microprocessor, Intel 8051 microcontrollers and provides a basic understanding of
advanced microcontrollers like ARM 7, PIC, CORTEX STM-32. The course will give an idea
about different architectures and the programming skills for microprocessor and

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

microcontrollers. The course gives the practical idea to interface different application modules
using microcontrollers.

Course Rationale:
The purpose of this course is to teach students the fundamentals of microprocessor and
microcontroller systems. The student will be able to incorporate these concepts into their
electronic designs for other courses where control can be achieved via a
microprocessor/controller implementation. Upon gaining the fundamental knowledge of
microprocessor and microcontroller architecture and programming, the students will be able to
design systems for embedded applications like home appliances, consumer electronics, and the
telephone industry and in the field of instrumentation control.

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

ACKNOWLEDGEMENT

Hereby acknowledge the following faculty members and lab manual prepared faculties for their
fruitful efforts for the establishment of “Processors & Controllers Lab” for the subject titled
“Processors & Controllers -22EC2106”.

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Department of Electronics and Communication Engineering


PROFESSIONAL CORE
Course Title: Processors & Controllers
Course Code: 22EC2106 L-T-P-S 3-0-2-2

Pre-requisite: Course Title: COA Credits 4

S. No. List of Experiments


1 Develop an 8086 Assembly language Program to perform the following (i) Arithmetic
operations a) Addition b) Subtraction c) Multiplication d) Division.

2 (a) Write an 8086 ALP to find the POSITIVE and NEGATIVE numbers in an array.
(b) Write an ALP to find the EVEN and ODD numbers in an array using 8086
programming
3 Write an ALP to Sort the Array of Numbers in ascending and descending order using
8086 Programming.

4 Develop an 8051 ALP on Addition of an array of elements of 8-bit data

5 To Develop an ALP Involving Bit/Byte Manipulations to Toggle a LED with random


delay (using Set, Clear, and Complement)

6 To Develop an ALP Creating Patterns using 8 LEDs without Timers

7 a) To Develop an ALP to generate a square wave of frequency 5kHz on P2.3, assume that
XTAL=11.052 MHz
b) To Develop an ALP to generate a square wave of frequency 5kHz with ON time on
P2.3 and OFF time on P3.3. Assume that XTAL=11.052 MHz (post lab)
8 Develop an ALP to Display Numbers using a 7-Segment Display and Timers
9 Write an ALP to interface 16X2 LCD to 8051 microcontrollers, then display your name
and ID number.
10 To Develop an ALP to count the number of events that occurred and to Display the count
on LCD
11 To Develop an ALP to accept the external interrupt and toggle the LED.
12 To develop an 8051 ALP to interface the stepper motor using an 8051 controller in the
clockwise and anti-clockwise direction
13 Project work

Tools to be used for Lab experiments:


Expt No: 1-3 – Emu 8086
Expt No: 4-12 – MCU IDE 8051, KEIL & PROTEUS

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Organization of the Student Lab Manual

The laboratory framework includes a creative element but shifts the time-intensive aspects
outside of the Two-Hour closed laboratory period. Within this structure, each laboratory
includes three parts: Prelab, In-lab, and post-lab.
A. Pre-Lab
The Prelab exercise is a homework assignment that links the lecture with the laboratory period
- typically takes 2 hours to complete. The goal is to synthesize the information they learn in
lecture with material from their Text book to produce a working piece of software. Prelab
Students attending a two-hour closed laboratory are expected to make a good-faith effort to
complete the Prelab exercise before coming to the lab. Their work need not be perfect, but their
effort must be real (roughly 80 percent correct).
B. In-Lab
The In-lab section takes place during the actual laboratory period. The First hour of the
laboratory period can be used to resolve any problems the students might have experienced in
completing the Prelab exercises. The intent is to give constructive feedback so that students
leave the lab with working Prelab software - a significant accomplishment on their part. During
the second hour, students complete the In-lab exercise to reinforce the concepts learned in the
Prelab. Students leave the lab having received feedback on their Prelab and In-lab work.
C. Post-Lab
The last phase of each laboratory is a homework assignment that is done following the
laboratory period. In the Post-lab, students analyse the efficiency or utility of a given system
call. Each Post-lab exercise should take roughly 120 minutes to complete.

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22EC2106)
2023-24 ODD SEMESTER LAB CONTINUOUS EVALUATION

S.NO DATE NAME OF THE PRE- IN-LAB POST- VIVA TOTAL FACULTY
EXPERIMENT LAB (35M) LAB SIGNATURE
Logic Execution Result Analysis WITH DATE

(5M)
(10M) (10M) (10M) (5M) (5M) (5M) (50M)
1

6
Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

S.NO DATE NAME OF THE PRE- IN-LAB POST- VIVA TOTAL FACULTY
EXPERIMENT LAB (35M) LAB SIGNATURE
Logic Execution Result Analysis WITH DATE

(5M) (10M) (10M) (10M) (5M) (5M) (5M) (50M)


7

10

11

12

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Processors & Controllers (22EC2106)


2023-24 ODD SEMESTER SKILLING CONTINUOUS EVALUATION

S.NO DATE NAME OF SKILLING IMPLEMENTATION DEMONSTRATION RESULTS VIVA TOTAL FACULTY
THE REPORT & METHODOLOGY & VOCE SIGNATURE
SKILLING ANALYSIS WITH DATE

(10) (10) (10) (10) (10) (50M)


1

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

10

11

12

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

EXPERIMENT NO.1:

Date of the Session: ___/___/___ Time of the Session: _____to______

AIM: To Develop an Assembly language Program to perform following Arithmetic operations on


8-bit & 16-bit data
a) Addition b) Subtraction c) Multiplication d) Division

PRE-REQUISITE:
 Assembly Language Programming (ALP)
 Embedded C Programming

SOFTWARE USED: Emu8086

Pre-Lab Work:
8086 has 16-bit flag register, and there are 9 valid flag bits. The format of flag register is like below.
Bit D D D D D D D D D D D D D D D D
s 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Fla O D I T S Z A P C
gs C Y

In 8086 there are 6 different flags which are set or reset after 8-bit or 16-bit operations. These flags
and their functions are listed below.
Flag Bit Function

S After any operation if the MSB is 1, then it indicates that the number is negative. And
this flag is set to 1

Z If the total register is zero, then only the Z flag is set

AC When some arithmetic operations generates carry after the lower half and sends it to
upper half, the AC will be 1

P This is even parity flag. When result has even number of 1, it will be set to 1, otherwise
0 for odd number of 1s

CY This is carry bit. If some operations are generating carry after the operation this flag is
set to 1

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Flag Bit Function

O The overflow flag is set to 1 when the result of a signed operation is too large to fit.

PROGRAM:
a) PROGRAM:

ORG 100H
.DATA
NUM1 DB 01H,00H,02H,00H
NUM2 DB 00H,00H
.CODE
MOV AX,@DATA
MOV DS,AX

LEA SI,NUM1
LEA DI,NUM2
MOV AX,[SI]
INC SI
INC SI
MOV BX,[SI]
ADD AX,BX
MOV [DI],AX
RET

B) PROGRAM :

ORG 100H
.DATA
NUM1 DB 02H,00H,01H,00H
NUM2 DB 00H,00H
.CODE
MOV AX,@DATA
MOV DS,AX

LEA SI,NUM1
LEA DI,NUM2
MOV AX,[SI]
INC SI
INC SI
MOV BX,[SI]
SBB AX,BX
MOV [DI],AX
RET
Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP
Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

C) PROGRAM:
ORG 100H
.DATA
NUM1 DB 02H,01H,01H,04H
NUM2 DB 00H,00H
.CODE
MOV AX,@DATA
MOV DS,AX

LEA SI,NUM1
LEA DI,NUM2
MOV AX,[SI]
INC SI
INC SI
MOV BX,[SI]
MUL BX
MOV [DI],AX
INC DI
INC DI
MOV [DI],DX
RET

d) PROGRAM :
ORG 100H
.DATA
NUM1 DB 00H,00H,07H,00H,02H,00H
NUM2 DB 00H,00H
.CODE
MOV AX,@DATA
MOV DS,AX

LEA SI,NUM1
LEA DI,NUM2
MOV DX,[SI]
INC SI
INC SI
MOV AX,[SI]
INC SI
INC SI
MOV BX,[SI]
DIV BX
MOV [DI],AX
INC DI
INC DI
MOV [DI],DX
RET
Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP
Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Post Lab Requirements:

1. Save the screenshot/Pictures of Program and output obtained and bring the same in next lab.

2. Note the readings as instructed by your advisor.

3. Submit practical report in next lab for correction.

Evaluator’s Observation

Marks Secured: _______ out of ________

Signature of the Evaluator with Date

Comment of the Evaluator (if Any)

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

EXPERIMENT NO.2:

Date of the Session: ___/___/___ Time of the Session: _____to______

EXPERIMENT NO.2:

AIM: To Develop an Assembly language Program to find No. of Positive numbers and No. of
Negative numbers in a given Array

SOFTWARE USED: Emu8086

Pre-Lab Work:
Standard numbers, anything greater than zero, are described as ‘positive’ numbers. We don’t put a
plus sign (+) in front of them because we don’t need to since the general understanding is that
numbers without a sign are positive.

Numbers that are less than zero are known as 'negative' numbers. These have a minus sign (−) in
front of them to indicate that they are less than zero (for example, -10 or 'minus 10').

PROGRAM:
ORG 100H
.DATA
NUM1 DB 85H,0D2H,50H,32H,0A6H,79H,98H,0F7H
LEN EQU 08H
.CODE
MOV AX,@DATA
MOV DS,AX
LEA SI,NUM1
MOV BX,0000H
MOV CL,LEN
AGAIN: MOV AL,[SI]
RCL AL,01
JNC PLUS
INC BL
JMP NXT
PLUS: INC BH
NXT: INC SI
DEC CL
JNZ AGAIN
RET

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

RESULT:

BL – 05 No.of Negative numbers

BH – 03 No.of Positive numbers

Post Lab Requirements


1. Save the screenshot/Pictures of Program and output obtained, and bring printout of the same in
next lab.
2. Note the readings as instructed by your advisor.
3. Submit practical report in next lab for correction.

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

EXPERIMENT NO.2 B:

AIM: To Develop an Assembly language Program to find No. of Even numbers and No. of ODD
numbers.

ORG 00H
MOV SI,5000H
MOV CL,08H ; COUNT
MOV BL,00H ; INITIALIZE THE RESULT BECOME 00H (COUNT FOR +VE NO)
MOV BH,00H ; INITIALIZE THE RESULT BECOME 00H (COUNT FOR -VE NO)
LOOP: MOV AL,[SI]
RCR AL,01H ;( ROTATE THE ACCUMULATOR LOWER BYTE (AL) RIGHT WITH CARRY BY 1 BIT POSITION)
JC NEGATIVE ; cy = 1 then it jumps otherwise it goto next step
INC BL
JMP REPEAT ; jump
NEGATIVE:INC BH ;(BH= ADD 1 IN LSB)
REPEAT:INC SI ; SI = 5001 AND SO ON
DEC CL ; COUNT = 07H
JNZ LOOP ; JUMP IF NO ZERO FOR PREVIOUS INSTRUCTION
HLT
Viva Questions:

1. What is the difference between min mode and max mode of 8086?
2. What is the difference between near and far procedure?
3. What is the difference between Macro and procedure?
4. What is the difference between instructions RET & IRET?
5. What is the difference between instructions MUL & IMUL?

Evaluator’s Observation

Marks Secured: _______ out of ________

Signature of the Evaluator with Date

Comment of the Evaluator (if Any)

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

EXPERIMENT NO.3:

Date of the Session: ___/___/___ Time of the Session: _____to______

AIM: Write ALP to Sort the Array of Numbers in ascending and descending order using 8086
Programming.

PRE-REQUISITE:
 Embedded C Programming
 Assembly Language Programming (ALP)

SOFTWARE USED: Emu8086

Pre-Lab Work:
Here we are sorting the number in bubble sorting technique. In this sorting technique there will be
n passes for n different numbers. In ith pass the ith largest element will be placed at the end. This is
comparison-based sort. We are taking two consecutive numbers, compare them, and then swap
them if the numbers are not in correct order. The following diagram is showing how the sorting is
working.

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Flow Diagram:

PROGRAM:

org 100h
.data
STR DB 0D2H,3EH,76H,12H,0E3H,44H,2AH,69H
LEN EQU ($-STR)
.code
MOV AX,@data
MOV DS,AX
MOV CL,LEN-1
AGAIN:MOV DL,CL
LEA SI,STR
UP:MOV AL,[SI]
CMP AL,[SI+1]

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

JBE NXT
XCHG AL,[SI+1]
XCHG AL,[SI]
NXT: INC SI
DEC DL
JNZ UP
DEC CL
JNZ AGAIN
ret

RESULT:

DATA BEFORE EXECUTION DATA AFTER EXECUTION


0700:0102 – D2 0700:0102 – 12
0700:0103 – 3E 0700:0103 – 2A
0700:0104 – 76 0700:0104 – 3E
0700:0105 – 12 0700:0105 – 44
0700:0106 – E3 0700:0106 – 69
0700:0107 – 44 0700:0107 – 76
0700:0108 – 2A 0700:0108 – D2
0700:0109 – 69 0700:0109 – E3

Before Execution

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

After Execution

Post Lab Requirements

1. Save the screenshot/Pictures of Program and output obtained and bring to the same in next lab.

2. Note the readings as instructed by your advisor.

3. Submit practical report in next lab for correction.

Viva Questions:
1. What is the size of instruction queue in 8086?
2. Which are the registers present in 8086?
3. What is pipelining in 8086?
4. How many 16-bit registers are available in 8086?
5. Specify addressing modes for any
instruction? Evaluator’s Observation

Marks Secured: _______ out of ________

Signature of the Evaluator with Date

Comment of the Evaluator (if Any)

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

EXPERIMENT NO.4:

Date of the Session: ___/___/___ Time of the Session: _____to______

AIM: To Develop an ALP on Addition of array of elements of 8-bit data


SOFTWARE USED: MCU 8051

PROGRAM:
org 00h
mov dptr,#num1
mov r0,#05h
clr a
movc a,@a+dptr
mov b,a
back : inc dptr
mov a,#00h
movc a,@a+dptr
add a,b
mov b,a
djnz r0, back
sjmp back
here:
here :sjmp here
org 200h
num1: db 1h,2h,3h,4h,5h
end

Result: The 8-bit array of addition is done using 8051 IDE.

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Evaluator’s Observation

Marks Secured: _______ out of ________

Signature of the Evaluator with Date

Comment of the Evaluator (if Any)

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

EXPERIMENT NO.5:

Date of the Session: ___/___/___ Time of the Session: _____to______

AIM: a) To Develop an ALP Involving Bit/Byte Manipulations to Toggle a LED with random delay
(using Set, Clear and Complement)

SOFTWARE USED: MCU8051

PROGRAM:
a)Bit Manipulation Programs

a) Toggling Pin
clr p1.0
back:setb p1.0
acall delay
clr p1.0
acall delay
sjmp back
delay: mov r0,#5d
here1:mov r1,#2d
here:djnz r1,here
djnz r0,here1
ret
end

OUTPUT:
Toggling pin

After some delay

RESULT: The toggling of pin p1.0 is performed.


Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP
Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

b) Toggling Port
mov p1,#00h
mov a,#55h
back:mov p1,a
acall delay
cpl a
sjmp back
delay: mov r0,#5d
here1:mov r1,#2d
here:djnz r1,here
djnz r0,here1
ret
end
Output:
Toggling port:

After some delay

RESULT: The toggling of port1 is performed.

Evaluator’s Observation

Marks Secured: _______ out of ________

Signature of the Evaluator with Date

Comment of the Evaluator (if Any)

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


EXPERIMENT NO.6:

Date of the Session: ___/___/___ Time of the Session: _____to______

AIM:
To Develop an ALP Creating Patterns using 8 LED's

SOFTWARE USED: MCU8051

PROGRAM:
Bit Manipulation Programs
Pattern Generation (Sending values individually)

mov p1,#00h
back:mov p1,#01h acall delay
mov p1,#03h
acall delay
mov p1,#07h
acall delay
mov p1,#0Fh
acall delay
mov p1,#1Fh
acall delay
mov p1,#3Fh
acall delay
mov p1,#7Fh
acall delay
mov p1,#0FFh
acall delay
mov p1,#7Fh
acall delay
mov p1,#3Fh
acall delay
mov p1,#1Fh
acall delay mov
p1,#0Fh
acall delay
mov p1,#07h
acall delay
mov p1,#03h
acall delay
mov p1,#01h
acall delay
mov p1,#00h
acall delay s
jmp back
Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

delay: mov r0,#5d


here1:mov r1,#2d
here:djnz r1,
here djnz r0,here1
ret
end

Output:
Pattern generation:

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Result: The pattern is generated in port1 from right to left.

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Evaluator’s Observation

Marks Secured: _______ out of ________

Signature of the Evaluator with Date

Comment of the Evaluator (if Any)

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

EXPERIMENT NO.7:

Date of the Session: ___/___/___ Time of the Session: _____to______

AIM: a) To Develop an ALP to generate a square wave of frequency 5kHz on P2.3 , assume
that XTAL=11.052 MHz.
a) To Develop an ALP to generate a square wave of frequency 5kHz with ON time on
P2.3 and OFF time on P3.3. Assume that XTAL=11.052 MHz
SOFTWARE USED: MCU8051
Pre-Lab Work:

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

a) PROGRAM:
ORG 00H

MOV TMOD,#10H

CLR P2.3

BACK: MOV TL1,#9BH

MOV TH1,#0FFH

SETB TR1

HERE: JNB TF1, HERE

CLR TR1

CPL P2.3

CLR TF1

SJMP BACK

END

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

b) PROGRAM:
ORG 00H

MOV TMOD,#10H

CLR P2.3

SETB P3.3

BACK: MOV TL1,#9BH

MOV TH1,#0FFH

SETB TR1

HERE: JNB TF1, HERE

CLR TR1

CPL P2.3

CPL P3.3

CLR TF1

SJMP BACK

END

RESULT: The pin p2.1 is used to generate the signal.

Post Lab Requirements:

1. Save the screenshot/Pictures of Program and output obtained and bring the same in next
lab.

2. Note the readings as instructed by your advisor.

3. Submit practical report in next lab for correction.

Viva Questions:

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

1. Along with an 8-bit timer what are the other timer modes present in an 8051
microcontroller
2. Which of the following bit of TMOD register in an 8051 microcontroller decides whether it
is a delay generator
3. What is the source of crystal frequency in an 8051 microcontroller
4. What is the value of TMOD register to operate timer in Mode1,Timer1 in an 8051
microcontroller
5. What is the timer's clock frequency if the crystal frequency is 16MHz in an 8051
microcontroller
6. What is the time period if the crystal frequency is 16MHz in an 8051 microcontroller
7. What is the source of clock for timer if C/T=0 in an 8051 microcontroller
8. The 8051 system communicates with IBM PC without any errors with the following crystal
frequency
9. What are the means of starting and stopping a timer in an 8051 microcontroller
10. Which of the following bits in TCON register in an 8051 microcontroller are responsible
for starting and stopping the timer

Evaluator’s Observation

Marks Secured: _______ out of ________

Signature of the Evaluator with Date

Comment of the Evaluator (if Any)

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

EXPERIMENT NO.8:

Date of the Session: ___/___/___ Time of the Session: _____to______

AIM: Write an ALP to interface 7 segment display to 8051 microcontroller.

SOFTWARE USED: MCU 8051

Hardware Required:
1. Microcontroller 8051 Kit
2. 16X2 LCD
3. Push Button
4. Connecting Wires
5. Bread Board

Pre-Lab Work:

A Seven segment display is the most basic electronic display. It consists of eight LEDs which
are associated in a sequence manner so as to display digits from 0 to 9 when proper
combinations of LEDs are switched on.
A 7-segment display uses seven LEDs to display digits from 0 to 9 and the 8th LED is used for
dot. A typical seven segment looks likes as shown in figure below.

The 7-segment displays are used in a number of systems to display the numeric information.
They can display one digit at a time. Thus the number of segments used depends on the
number of digits to display. Here the digits 0 to 9 are displayed continuously at a predefined
time delay.
The 7-segment displays are available in two configurations which are common anode and
common cathode. Here common anode configuration is used because output current of the

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

microcontroller is not sufficient enough to drive the LEDs. The 7-segment display works on
negative logic, we have to provide logic 0 to the corresponding pin to make on LED glow.
The 7-segment displays are used in a number of systems to display the numeric information.
They can display one digit at a time. Thus the number of segments used depends on the
number of digits to display. Here the digits 0 to 9 are displayed continuously at a predefined
time delay.
The 7-segment displays are available in two configurations which are common anode and
common cathode. Here common anode configuration is used because output current of the
microcontroller is not sufficient enough to drive the LEDs. The 7-segment display works on
negative logic, we have to provide logic 0 to the corresponding pin to make on LED glow.

Types of Seven segment displays


As mentioned in previous paragraphs, seven segment displays come up with two different
configurations. They are the common anode and a common cathode.
One pin each from each segment is connected to a common terminal. According to the pins
which are connected to the common terminal, the seven segment display is categorized as a
common anode and common cathode.

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Digit Drive Pattern.

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

PROGRAM:
mov p1,#00h
main: mov dptr,#codes
back: clr a
movc a,@a+dptr
jz next
mov p1,a
acall delay
inc dptr
sjmp back
next: sjmp main
delay: mov r0,#5d
here1:mov r1,#2d
here:djnz r1,here
djnz r0,here1
ret
codes: db 3Fh,06h,5Bh,4Fh,66h,6Dh,7Dh,07h,7Fh,6Fh,0
end

7segment display: Output

Result: The numbers from 0 to 9 are displayed on 7-segment display

Evaluator’s Observation

Marks Secured: _______ out of ________

Signature of the Evaluator with Date

Comment of the Evaluator (if Any)

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

EXPERIMENT NO.9:

Date of the Session: ___/___/___ Time of the Session: _____to______

AIM: Write an ALP to interface 16X2 LCD to 8051 microcontroller and then display your
name and ID number

SOFTWARE USED: MCU 8051

Hardware Required:
1. Microcontroller 8051 Kit
2. 16X2 LCD
3. Push Button
4. Connecting Wires
5. Bread Board

Pre-Lab Work:
We come across LCD displays everywhere around us. Computers, calculators, television sets,
mobile phones, digital watches use some kind of display to display the time. An LCD is an
electronic display module which uses liquid crystal to produce a visible image. The 16×2 LCD
display is a very basic module commonly used in DIYs and circuits. The 16×2 translates o a
display 16 characters per line in 2 such lines. In this LCD each character is displayed in a 5×7
pixel matrix.

RS (Register select)
A 16X2 LCD has two registers, namely, command and data. The register select is used to
switch from one register to other. RS=0 for command register, whereas RS=1 for data register.

Command Register
The command register stores the command instructions given to the LCD. A command is an
instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

the cursor position, controlling display etc. Processing for commands happens in the
command register.

Data Register
The data register stores the data to be displayed on the LCD. The data is the ASCII value of
the character to be displayed on the LCD. When we send data to LCD it goes to the data
register and is processed there. When RS=1, data register is selected.

Important command codes for LCD


Sr.No. Hex Code Command to LCD instruction Register
1 01 Clear display screen
2 02 Return home
3 04 Decrement cursor (shift cursor to left)
4 06 Increment cursor (shift cursor to right)
5 05 Shift display right
6 07 Shift display left
7 08 Display off, cursor off
8 0A Display off, cursor on
9 0C Display on, cursor off
10 0E Display on, cursor blinking
11 0F Display on, cursor blinking
12 10 Shift cursor position to left
13 14 Shift cursor position to right
14 18 Shift the entire display to the left
15 1C Shift the entire display to the right
16 80 Force cursor to beginning ( 1st line)
17 C0 Force cursor to beginning ( 2nd line)
18 38 2 lines and 5×7 matrix

PROGRAM:

ORG 00H

AGAIN:
MOV A,#38H
ACALL COMMAND
ACALL DELAY
MOV A,#0EH
ACALL COMMAND
ACALL DELAY
MOV A,#01H
ACALL COMMAND
ACALL DELAY
MOV A,#06H
ACALL COMMAND
ACALL DELAY
MOV A,#84H
ACALL COMMAND
ACALL DELAY
MOV A,#”K”

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

ACALL NEXT
ACALL DELAY
MOV A,#”L”
ACALL NEXT
ACALL DELAY
MOV A,#”U”
ACALL NEXT
ACALL DELAY
MOV A,#”E”
ACALL NEXT
ACALL DELAY
MOV A,#”C”
ACALL NEXT
ACALL DELAY
MOV A,#”E”
ACALL NEXT
ACALL DELAY
SJMP AGAIN

COMMAND:
MOV P1,A
CLR P2.0
CLR P2.1
SETB P2.2
ACALL DELAY
CLR P2.2
RET

NEXT:
MOV P1,A
SETB P2.0
CLR P2.1
SETB P2.2
ACALL DELAY
CLR P2.2
RET

DELAY:
MOV R3,#05h
HERE2:MOV R4,#02h
HERE:DJNZ R4,HERE
DJNZ R3,HERE2
RET

END

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

CIRCUIT DIAGRAM:

RESULT:The pin p3.4 is pressed for 2 times in a 5seconds.(counter value is 2 with in a


5seconds)

Post Lab Requirements:

1. Save the screenshot/Pictures of Program and output obtained and bring the same in next
lab.

2. Note the readings as instructed by your advisor.

3. Submit practical report in next lab for correction.

Viva Questions:

1. How many rows and columns are present in a 16*2 alphanumeric LCD?

2. How many data lines are there in a 16*2 alphanumeric LCD?

3. Which pin of the LCD is used for adjusting its contrast?

4. For writing commands on an LCD, RS bit is?

5. Which command of an LCD is used to shift the entire display to the right?

6. What changes are to be made to send data to an LCD?

7. For reading operation from an LCD what changes in the software are introduced?

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

8. The RS pin is an input/output for a controller?

Evaluator’s Observation

Marks Secured: _______ out of ________

Signature of the Evaluator with Date

Comment of the Evaluator (if Any)

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

EXPERIMENT NO.10:

Date of the Session: ___/___/___ Time of the Session: _____to______

AIM: Design a System to count the number of students entering to a class. And then:
(a) Display the same on 16X2 LCD.

SOFTWARE USED: MCU 8051

Hardware Required:
1. Microcontroller 8051 Kit
2. 16X2 LCD
3. Push Button
4. Connecting Wires
5. Bread Board

Pre-Lab Work:
We come across LCD displays everywhere around us. Computers, calculators, television sets,
mobile phones, digital watches use some kind of display to display the time. An LCD is an
electronic display module which uses liquid crystal to produce a visible image. The 16×2 LCD
display is a very basic module commonly used in DIYs and circuits. The 16×2 translates o a
display 16 characters per line in 2 such lines. In this LCD each character is displayed in a 5×7
pixel matrix.

RS (Register select)
A 16X2 LCD has two registers, namely, command and data. The register select is used to
switch from one register to other. RS=0 for command register, whereas RS=1 for data register.

Command Register
The command register stores the command instructions given to the LCD. A command is an
instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

the cursor position, controlling display etc. Processing for commands happens in the
command register.

Data Register
The data register stores the data to be displayed on the LCD. The data is the ASCII value of
the character to be displayed on the LCD. When we send data to LCD it goes to the data
register and is processed there. When RS=1, data register is selected.

Important command codes for LCD


Sr.No. Hex Code Command to LCD instruction Register
1 01 Clear display screen
2 02 Return home
3 04 Decrement cursor (shift cursor to left)
4 06 Increment cursor (shift cursor to right)
5 05 Shift display right
6 07 Shift display left
7 08 Display off, cursor off
8 0A Display off, cursor on
9 0C Display on, cursor off
10 0E Display on, cursor blinking
11 0F Display on, cursor blinking
12 10 Shift cursor position to left
13 14 Shift cursor position to right
14 18 Shift the entire display to the left
15 1C Shift the entire display to the right
16 80 Force cursor to beginning ( 1st line)
17 C0 Force cursor to beginning ( 2nd line)
18 38 2 lines and 5×7 matrix

PROGRAM:

org 00h
mov tmod,#06h
mov tl0,#00h

setb p3.4

wait: setb tr0


back: mov p1,#38h
acall l1
acall l2
mov p1,#0eh
acall l1
acall l2
mov p1,#01h
acall l1
acall l2
mov p1,#06h
acall l1

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

acall l2
mov p1,#84h
acall l1
acall l2
mov a,#'C'
mov p1,a
acall l3
acall l2
mov a,#'O'
mov p1,a
acall l3
acall l2
mov a,#'U'
mov p1,a
acall l3
acall l2
mov a,#'N'
mov p1,a
acall l3
acall l2
mov a,#'T'
mov p1,a
acall l3
acall l2
mov a,#':'
mov p1,a
acall l3
acall l2
mov a,tl0
add a,#48d
mov p1,a
acall l3
acall l2
sjmp back
jnb tf0, wait

l1: clr p2.0


clr p2.1
setb p2.2
acall l2
clr p2.2
ret

l3: setb p2.0


clr p2.1
setb p2.2
acall l2

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

clr p2.2
ret

l2: mov r0,#05h


l: mov r1,#05h
w: djnz r1,w
djnz r0,l
ret
end

CIRCUIT DIAGRAM:

RESULT:The pin p3.4 is pressed for 2 times in a 5seconds.(counter value is 2 with in a


5seconds)

Post Lab Requirements:

1. Save the screenshot/Pictures of Program and output obtained and bring the same in next
lab.

2. Note the readings as instructed by your advisor.

3. Submit practical report in next lab for correction.

Viva Questions:

1. How many rows and columns are present in a 16*2 alphanumeric LCD?

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

2. How many data lines are there in a 16*2 alphanumeric LCD?

3. Which pin of the LCD is used for adjusting its contrast?

4. For writing commands on an LCD, RS bit is?

5. Which command of an LCD is used to shift the entire display to the right?

6. What changes are to be made to send data to an LCD?

7. For reading operation from an LCD what changes in the software are introduced?

8. The RS pin is an input/output for a controller?

Evaluator’s Observation

Marks Secured: _______ out of ________

Signature of the Evaluator with Date

Comment of the Evaluator (if Any)

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

EXPERIMENT NO.11:

Date of the Session: ___/___/___ Time of the Session: _____to______

AIM: To Develop an ALP to accept the external interrupt and to toggle the LED

SOFTWARE USED: MCU8051


PROGRAM:
ORG 0000H
LJMP MAIN
ORG 0003H
CPL P1.0
acall delay
acall delay
acall delay
acall delay
acall delay
RETI
ORG 0013H
CPL P1.1
acall delay
acall delay
acall delay
acall delay
acall delay
RETI
MAIN:
MOV IE,#85H
again:
mov p2,#00h
mov a,#01h
mov p2,a
acall delay
acall delay
acall delay
mov a,#03h
mov p2,a
acall delay
acall delay
acall delay
mov a,#07h
mov p2,a
acall delay
acall delay
acall delay
mov a,#0fh
mov p2,a
acall delay
acall delay
acall delay
SJMP again
delay:

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

mov r0,#0ffh
here1: mov r1,#0ffh
here: djnz r1,here
djnz r0,here1
ret
END

RESULT: An ALP is developed to accept the external interrupt and accordingly the LED’s were
made to toggle.

Evaluator’s Observation

Marks Secured: _______ out of ________

Signature of the Evaluator with Date

Comment of the Evaluator (if Any)

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

EXPERIMENT NO.12:

Date of the Session: ___/___/___ Time of the Session: _____to______

AIM: To develop an 8051 ALP to interface the stepper motor using an 8051 controller in the
clockwise and anti-clockwise direction

SOFTWARE USED: MCU8051 & KEIL & PROTEUS

PROGRAM:

ORG 0H
MOV A,#00110011B
LOOP1: MOV P2,A
ACALL DELAY
RL A;RR A ROTATE LEFT OR ROTATE RIGHT
SJMP LOOP1
DELAY: MOV R7,#0FFH
HERE2: MOV R6,#0FFH
HERE1: DJNZ R6,HERE1
DJNZ R7,HERE2
RET
END
OUTPUT:

RESULT: PERFORMED THE MOVEMENT OF STEPPER MOTOR IN ANTICLOCKWISE


DIRECTION.

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

Evaluator’s Observation

Marks Secured: _______ out of ________

Signature of the Evaluator with Date

Comment of the Evaluator (if Any)

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP


Processors & Controllers (22 EC 2106) LABORATORY MANUAL 2023-2024

EXPERIMENT NO.13:

Date of the Session: ___/___/___ Time of the Session: _____to______

Project Review 1

Rubrics Marks out of 50


Objective (10)
Methodology & Implementation (10)
Block Diagram(10)
Work Flow (10)
Hardware/Software Implementation
(10)
Total

Outcome:

Course Co-ordinator HOD

Department of ECE| KLEF (Deemed to be University), NAAC - “A++”, Guntur, AP

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy