0% found this document useful (0 votes)
51 views116 pages

MPMC Manual 23 PDF

The document is a laboratory manual for the EE3413 Microprocessor and Microcontroller course at JCT College of Engineering and Technology. It outlines the vision and mission of the institution and department, program educational objectives, specific outcomes, and outcomes for engineering graduates. Additionally, it details course objectives, programming exercises, and instructions for students regarding laboratory conduct and experiments.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views116 pages

MPMC Manual 23 PDF

The document is a laboratory manual for the EE3413 Microprocessor and Microcontroller course at JCT College of Engineering and Technology. It outlines the vision and mission of the institution and department, program educational objectives, specific outcomes, and outcomes for engineering graduates. Additionally, it details course objectives, programming exercises, and instructions for students regarding laboratory conduct and experiments.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 116

JCT COLLEGE OF ENGINEERING AND TECHNOLOGY

Pichanur, Coimbatore - 641 105

JCT
COLLEGE OF ENGINEERING AND
TECHNOLOGY DEPARTMENT OF
ELECTRICAL AND ELECTRONICS ENGINEERING

FOURTH SEMESTER

EE3413 – MICROPROCESSOR AND


MICROCONTROLLER LABORATORY MANUAL

NAME :

SEMESTER / YEAR :

BRANCH :
REGISTER NUMBER :
JCT COLLEGE OF ENGINEERING AND TECHNOLOGY
PICHANUR, COIMBATORE – 641105

Department of Electrical and Electronics Engineering

B.E - PROGRAMME

Vision and Mission Statements - Institution

Vision:

To emerge as a Premier Institute for developing industry ready Engineers with


competency, initiative and character to meet the challenges in global environment.

Mission:

 To impart state-of-the-art engineering and professional education through strong


theoretical basics and hands on training to students in their choice of field.
 To serve our students by teaching them leadership, entrepreneurship, teamwork, values,
quality, ethics and respect for others.
 To provide opportunities for long-term interaction with academia and industry.
 To create new knowledge through innovation and research.
JCT COLLEGE OF ENGINEERING AND TECHNOLOGY
PICHANUR, COIMBATORE – 641105
JCT COLLEGE OF ENGINEERING AND TECHNOLOGY
PICHANUR, COIMBATORE – 641105

Department of Electrical and Electronics Engineering

B.E - PROGRAMME

Vision and Mission Statements - Department

VISION:

Emerging as a Center of Excellence in Electrical and Electronics


Engineering Education for studies and research.

MISSION:

 To create state-of art facilities for teaching, learning, laboratory practices and research.
 To develop competent engineers through value addition programs, products incubation,
interactive seminars, communication programs, group discussions, trainings, etc.
 To initiate collaborative relationships with Industries and Institutions for real-life
experiences.
JCT COLLEGE OF ENGINEERING AND TECHNOLOGY
PICHANUR, COIMBATORE – 641105
JCT COLLEGE OF ENGINEERING AND TECHNOLOGY
PICHANUR, COIMBATORE – 641105

PROGRAM EDUCATIONAL OBJECTIVES

PEO1: Graduates shall have successful career in industry or have motivation for higher
education or research.

PEO2: Graduates shall apply their knowledge of Electrical and Electronics Engineering and
work as part of a team on multidisciplinary projects.

PEO3: Graduates shall have lifelong learning skills, professional ethics and good
communication capabilities along with entrepreneur skills and leadership, so that they can
succeed in their life.

PROGRAM SPECIFIC OUTCOMES (PSO)

PSO1: Have abilities to apply their knowledge in the domain of Electronics, Electrical Drives,
Power Generation and Transmission, Power Electronics and Control system for the benefits of
the society and the Nation.

PSO2: Have abilities to successfully qualify in national level competitive examinations for
higher studies and employment.
JCT COLLEGE OF ENGINEERING AND TECHNOLOGY
PICHANUR, COIMBATORE – 641105
JCT COLLEGE OF ENGINEERING AND TECHNOLOGY
PICHANUR, COIMBATORE – 641105

PROGRAM OUTCOMES (POs)


1. Engineering Knowledge: Apply the knowledge of mathematics, science, engineering fundamentals and an
engineering specialization to the solution of complex engineering problems.
2. Problem Analysis: Identify, formulate, review research literature, and analyze complex engineering
problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and
engineering sciences.
3. Design / Development of solutions: Design solutions for complex engineering problems and design system
components or processes that meet the specified needs with appropriate consideration for the public health
and safety, and the cultural, societal, and environmental considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and research methods
including design of experiments, analysis and interpretation of data, and synthesis of the information to
provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern engineering
and IT tools including prediction and modeling to complex engineering activities with an understanding of
the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess societal,
health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional
engineering practice.
7. Environment and sustainability: Understand the impact of the professional engineering solutions in
societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable
development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of the
engineering practice.
9. Individual and team work: Function effectively as an individual and as a member or leader in diverse
teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the engineering
community and with society at large, such as, being able to comprehend and write effective reports and
design documentation, make effective presentations, and give and receive clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the engineering
management principles and apply these to one’s own work, as a member and leader in a team, to manage
projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for and have the preparation and ability to engage in independent
and lifelong learning in the broadest context of technological change.
JCT COLLEGE OF ENGINEERING AND TECHNOLOGY
PICHANUR, COIMBATORE – 641105
JCT COLLEGE OF ENGINEERING AND TECHNOLOGY
PICHANUR, COIMBATORE – 641105

INSTRUCTION TO THE STUDENTS

1. Students have to go to respective lab classes according to the lab time table.

2. They have to wear the shoes & the prescribed uniform.

3. They have to know about the procedure of the experiment before start doing the experiment. It will be

checked by the staff members.

4. After the viva, they have to get the indent slip from stores and get the required apparatus.

5. They have to give the circuit connections by involving themselves in their batch.

6. They have to take readings in proper manner without any error and get verified from the staff.

7. They have to submit their completed previous experiment record at the time of entering into the

laboratory.

8. After completing the experiment, they have to return all the apparatus to the stores and get back the

indent slip.

9. Strict discipline is solicited inside the laboratory.


JCT COLLEGE OF ENGINEERING AND TECHNOLOGY
PICHANUR, COIMBATORE – 641105
JCT COLLEGE OF ENGINEERING AND TECHNOLOGY
PICHANUR, COIMBATORE – 641105

EE3413 MICROPROCESSOR AND MICROCONTROLLER LABORATORY LTPC


0 0 3 1.5
COURSE OBJECTIVES:
• To perform simple arithmetic operations using assembly language
program and study the addressing modes & instruction set of 8085
& 8051
• To develop skills in simple program writing in assembly languages
• To write an assembly language program to convert Analog input to
Digital output and Digital input to Analog output.
• To perform interfacing experiments with µP8085
• To perform interfacing experiments with µC8051.

PROGRAMMING EXERCISES / EXPERIMENTS WITH µP8085:


1. Simple arithmetic operations: Multi precision addition/ subtraction
/multiplication /division.
2. Programming with control instructions: Increment / Decrement, Ascending /
Descending order, Maximum / Minimum of numbers, rotate instructions, Hex /
ASCII / BCD code conversions.
3. Interface Experiments: A/D Interfacing. D/A Interfacing. Traffic light controller
4. Stepper motor controller interface.
5. Displaying a moving/ rolling message in the student trainer kit’s output device.
PROGRAMMING EXERCISES / EXPERIMENTS WITH µC8051:
6. Simple arithmetic operations with 8051: Multi precision addition / subtraction
/multiplication/ division.
7. Programming with control instructions: Increment / Decrement, Ascending /
Descending order, Maximum / Minimum of numbers, rotate instructions, Hex /
ASCII / BCD code conversions.
8. Interface Experiments: A/D Interfacing. D/A Interfacing. Traffic light controller
9. Stepper motor controller interface.
10. Displaying a moving/ rolling message in the student trainer kit’s output device.
11. Programming PIC architecture with software tools.
TOTAL: 45 PERIODS
COURSE OUTCOMES:
After studying the above subject, students should have the:
CO1: Ability to write assembly language program for microprocessor.
CO2: Ability to write assembly language program for microcontroller
CO3: Ability to design and implement interfacing of peripheral with microprocessor
and microcontroller
CO4: Ability to analyze, comprehend, design and simulate microprocessor based systems
used for control and monitoring.
CO5: Ability to analyze, comprehend, design and simulate microcontroller based systems
used for control and monitoring
CONTENT BEYOND SYLLABUS:
1. Programs to verify timer and interrupts in 8051 Microcontroller
2. Study of ARM Processor
DEPARTMENT OF EEE

CYCLE PLAN
CYCLE – I

1. Simple arithmetic operations: Multi precision addition/ subtraction


/multiplication /division.
2. Programming with control instructions: Increment / Decrement, Ascending /
Descending order, Maximum / Minimum of numbers, rotate instructions,
Hex / ASCII / BCD code conversions.
3. Interface Experiments: A/D Interfacing. D/A Interfacing. Traffic light controller
4. Stepper motor controller interface.
5. Displaying a moving/ rolling message in the student trainer kit’s output device.
6. Simple arithmetic operations with 8051: Multi precision addition /
subtraction /multiplication/ division.

CYCLE -II
7. Programming with control instructions: Increment / Decrement, Ascending /
Descending order, Maximum / Minimum of numbers, rotate instructions, Hex /
ASCII / BCD code conversions.
8. Interface Experiments: A/D Interfacing. D/A Interfacing. Traffic light controller
9. Stepper motor controller interface.
10. Displaying a moving/ rolling message in the student trainer kit’s output device.
11. Programming PIC architecture with software tools.
12. Programs to verify timer and interrupts in 8051 Microcontroller
13. Study of ARM Processor

EE3414 – MPMC LABORATORY Page | 1


DEPARTMENT OF EEE

INDEX
S. No Date Name of the Experiment Page. Marks Faculty
no sign

EE3414 – MPMC LABORATORY Page | 2


DEPARTMENT OF EEE

s. no Date Name of the Experiment Page. Marks Faculty


no sign

EE3414 – MPMC LABORATORY Page | 3


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 4


DEPARTMENT OF EEE
PROGRAM
ADDRESS OPCODE LABEL MNEMONICS COMMENTS
3100 3A 00 32 LDA 3200Н Get first data in A
3103 47 MOV BA Move A to B
3104 3A 01 32 LDA 3201Η Get second data in A
3107 0E 00 MVI C00H Clear C register to account for carry
3109 80 ADD B Get Sum in A reg
310A D2 0E 31 JNC AHEAD If CY-0 go to AHEAD
310D 0C INR C If CY-1 increment C reg
310E 32 02 32 AHEAD STA 3202H Store the sum in memory
3111 79 MOV A,C Move C to A
3112 32 03 32 STA 3203H Store the carry in memory
3115 76 HLT Terminate the program

FLOW CHART FOR 8 BIT ADDITIONS

START

INITIALIZE THE
DATA

ADD DATA

IF INCREMENT CARRY
CARRY =

YES

STORE THE RESULT

STOP

OUTPUT RESULT
I/O MEMORY ADDRESS DATA 1 DATA 2 (WITH
(WITHOUT CARRY)
CARRY)
3200H 02 06
INPUT
3201H 03 05

3202H (SUM) 05 10
OUTPUT
3203H (CARRY) 06 01

EE3414 – MPMC LABORATORY Page | 5


DEPARTMENT OF EEE

Exp.No: SIMPLE ARITHMETIC OPERATIONS: ADDITION/ SUBTRACTION


/ MULTIPLICATION/DIVISION
Date :

AIM

To write an assembly language program for adding, subtracting, multiplying division two 8
bit numbers using 8085 microprocessor kit

APPARATUS REQUIRED

S.No Name of Apparatus Quantity


1. 8085 Microprocessor kit 1

ALGORITHM FOR 8-BIT ADDITION

1. Start the program.

2. Load the first data in the accumulator

3. Move the content of A to B register

4. Load the second data in the accumulator

5. Initialize the carry with zero

6. Add the content of B register to the accumulator,

7. If the carry is "0" then store the result in address which is specified.

8 If the carry is "1" then increment the C register and store the result.

9 Stop the program

EE3414 – MPMC LABORATORY Page | 6


DEPARTMENT OF EEE

PROGRAM
ADDRESS OPCODE LABEL MNEMONICS COMMENTS
3100 3A 01 32 LDA 3201H Get the subtrahend in Breg
3103 47 MOV BA Move A to B
3104 3A 00 32 LDA 3200Η Get the minuend in A reg
3107 0E 00 MVI C,00H Clear C register to account for carry
3109 90 SUB B Get Difference in A reg
310A D2 0E 31 JNC AHEAD If CY=0 go to AHEAD
310D 0C INR C If CY-1 increment C reg
310E 32 02 32 AHEAD STA 3202H Store the sum in memory
3111 79 MOV A,C Move C to A
3112 32 03 32 STA 3203H Store the carry in memory
3115 76 HLT Terminate the program

FLOW CHART FOR 8 BIT ADDITIONS

START

INITIALIZE THE
DATA

SUBTRACT DATA

IF
BORROW = INCREMENT BORROW

YES

STORE THE RESULT

STOP

OUTPUT
INPUT OUTPUT

ADDRESS DATA ADDRESS DATA

3200 05 3202 02

3201 03 3203

EE3414 – MPMC LABORATORY Page | 7


DEPARTMENT OF EEE

ALGORITHM FOR 8 BIT SUBTRACTION

1. Start the program.

2. Load the first data in the accumulator

3. Move the content of A to B register

4. Load the second data in the accumulator

5. Subtract the content of B register from the accumulator:

6. If the borrow is "0" then co to step 7.

7. Store the result.

8. Stop the program

EE3414 – MPMC LABORATORY Page | 8


DEPARTMENT OF EEE

PROGRAM
ADDRESS OPCODE LABEL MNEMONICS COMMENTS
3100 21 00 32 LX1 3200H Set pointer for data
3103 0E 00 MVI C, 00H Clear to account for Overflow
3105 AF XRA A Clear accumulator
3106 46 MOV B,M Get first data in B reg
3107 23 INX H Increment the HL pair
3108 56 MOV D,M Get second data in Dreg
3109 82 REPT ADD D Add D reg to accumulator
310A D2 0E 31 JNC AHEAD If no Carry jump to A
310D 0C INR C If CY=1 increment Creg
310E 05 AHEAD DCR B Decrement the Breg Content
310F C2 09 31 JNC REPT Repeat addition until ZF=1
3112 23 INX H Increment the HL Pair
3113 77 MOV M,A Store lower byte of product in memory
3114 23 INX H Increment the HL Pair
3115 71 MOV M,C Store higher byte of product in
memory
3116 76 HLT Terminate the program

OUTPUT

INPUT OUTPUT

ADDRESS DATA ADDRESS DATA

3200 05 3202 06

3201 03 3203 00

EE3414 – MPMC LABORATORY Page | 9


DEPARTMENT OF EEE

ALGORITHM FOR 8 BIT MULTIPLICATION

1. Load the address of the first data in HL pair.


2. Clear C register for overflow.
3. Clear the Accumulator.
4. Move the first data to B register.
5. Increment the Pointer.
6. Move the second data to D register.
7. Add the content of D register to accumulator
8. Check for carry, If carry=1 go to step 9 else carry=0 go to step 10.
9. Increment the C register,
10. Decrement the B register.
11. Check whether count has reached zero. If ZF=0, repeat steps7 through 11 or of ZF-
1 go to next step.
12. Terminate the program

EE3414 – MPMC LABORATORY Page | 10


DEPARTMENT OF EEE

FLOWCHART

A
START

[HL] [HL] +1
[HL] 4500

B M
[M] [A]

[HL] [HL] +1
[HL] [HL] +1

A 00

[M] [C]
C 00

[A] [A ]+ [M] STOP

Is there
any

C C+1

B B+ 1

IS B =
0

STOP

EE3414 – MPMC LABORATORY Page | 11


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 12


DEPARTMENT OF EEE

PROGRAM
ADDRESS OPCODE LABEL MNEMONICS COMMENTS
3100 3A 01 32 LD, 3201H Load the Accumulator
3103 47 MOV B,A Get the divisor in B reg
3104 3A 00 32 LDA 3200H Get the dividend in A reg
3107 0E 00 MVI C,00H Clear C reg for Quotient
3109 B8 AGAIN CMP B Compare B Reg wit ACC
310A DA12 31 JC STORE If divisor is less than dividend go to STOP
310D 90 SUB B Subtract divisor from dividend
310E 0C INR C Increment quotient by 1 for each subtraction
310F C3 09 31 JMP AGAIN Jump to Label Again
3112 32 03 32 STORE STA 3202H Store the remainder in memory
3115 79 MOV A,C Move C Reg to Acc
3116 32 02 32 STA 3202H Store the quotient in memory
3119 76 HLT Halt the Program

OUTPUT

INPUT OUTPUT

ADDRESS DATA ADDRESS DATA

3200 06 3202 03

3201 02 3203

EE3414 – MPMC LABORATORY Page | 13


DEPARTMENT OF EEE

ALGORITHM FOR 8 BIT DIVISION

1. Load the divisor in accumulator and move it to reg


2. Load the dividend in accumulator
3. Clear C-Register to account for quotient.
4. Check whether divisor is less than dividend. If diviser is less than dividend go to
step & otherwise go to next step.
5. Subtract the content of B reg from accumulator.
6. Increment the content of C reg, go to step 4.
7. Store the content of accumulator in memory.
8. Move the content of C reg to accumulator and store in memory.
9. Terminate the program.

EE3414 – MPMC LABORATORY Page | 14


DEPARTMENT OF EEE

FLOWCHART

START

B 0
0

[HL 450
] 0

A M

[HL [HL]
] +1

M A-M

[B [B] +
] 1

IS
A<0

A A+
M

B B-
1

[HL [HL] +
] 1

[M [A
] ]

[HL [HL]
] +1

[M [B
] ]

STOP

EE3414 – MPMC LABORATORY Page | 15


DEPARTMENT OF EEE

RESULT

Thus the program for B-bit Addition, Subtraction, Multiplication and Division was
implemented and verified successfully.

EE3414 – MPMC LABORATORY Page | 16


DEPARTMENT OF EEE

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


3100 3A 00 32 LDA 3200H Load the count value in A reg
3103 47 MOV B,A Set count for N-1 repetition
3104 05 DCR B Decrement the B Reg
3105 21 00 32 LOOP LXIH 3200H Set pointer for array
3108 4E MOV C, M Set count for N-1 comparison
3109 0D DCR C Decrement the C Reg
310A 23 INX H Increment pointer
310B 7E LOOP1 MOV A,M Get one data of array in A
310C 23 INX H Increment the HL Pair
310D BE CMP M Compare next data with A reg
310E DA 16 31 JC AHEAD If content of A is less than
memory then Go to AHEAD
3111 56 MOV D, M If the content A is greater than the
content memory pointed by HL
previous location
3112 77 MOV M, A Move ACC to Memory
3113 2B DCX H Decrement the HL Pair
3114 72 MOV M,D Move D Reg to Memory
3115 23 INX H Increment the HL Pair
3116 0D AHEAD DCR C Decrement the C Reg Content
3117 C2 0B 31 JNZ LOOP1 Repeat comparison until count is zero
311A 05 DCR B Decrement the B Reg Content
311B C2 05 31 JNZ LOOP2 Repeat N-1 comparison until B
count is zero
311E 76 HLT Terminate the program

OUTPUT
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
3200 05 3200 01
3201 02 3201 02
3202 04 3202 03
3203 03 3203 04
3204 01 3204 05

EE3414 – MPMC LABORATORY Page | 17


DEPARTMENT OF EEE

Exp.No:
ASCENDING ORDER
Date :

AIM

To write an assembly language program to sort an array of data in ascending

APPARATUS REQUIRED

S. No Name of Apparatus Quantity

1. 8085 Microprocessor Kit 1

ALGORITHM

1. Load the count value from memory to A register and save it in B register
2. Decrement B register. Set HL pair as data array address pointer.
3. Set C register as counter for N-1 comparison.
4. Load the data of the array in accumulator using the data address pointer.
5. Increment the HL pair. Compare the data pointed by HL with accumulator.
6. If carry flag is set then go to step 10 else Go to next step.
7. Exchange the content of memory pointed by HL and accumulator
8. Decrement C reg. If zero flag is reset go to step 6 else go to next step.
9. Decrement B reg. If zero flag is reset go to step 3 else go to next step.
10. Terminate the program.

EE3414 – MPMC LABORATORY Page | 18


DEPARTMENT OF EEE

FLOWCHAT: START

[B] 04H

[HL] [8100H]

[C] 04H

[A] [HL]

[HL [HL]
] +1

IS [HL]
[A] ?

[HL] [HL]

[HL] [A]

[HL] [HL] - 1

IS [C]
[HL] [D]
=0

[HL] [HL] +1

[B] [B] - 1
[C] [C] – 01H

A IS [B]
=
0?

STOP

EE3414 – MPMC LABORATORY Page | 19


DEPARTMENT OF EEE

RESULT:

Thus the program for ascending order was implemented and verified successfully.

EE3414 – MPMC LABORATORY Page | 20


DEPARTMENT OF EEE

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


3100 3A 00 32 LDA 3200H Load the count value in A reg
3103 47 MOV B,A Set count for N-1 repetition
3104 05 DCR B Decrement the B Reg
3105 21 00 32 LOOP2 LXIH 3200H Set pointer for array
3108 4E MOV C, M Set count for N-1 comparison
3109 0D DCR C Decrement the C Reg
310A 23 INX H Increment pointer
310B 7E LOOP1 MOV A,M Get one data of array in A
310C 23 INX H Increment the HL Pair
310D BE CMP M Compare next data with A reg
310E DA 16 31 JC AHEAD If content of A is less than
memory then Go to AHEAD
3111 56 MOV D, M If the content A is greater than the
content memory pointed by HL
previous location
3112 77 MOV M, A Move ACC to Memory
3113 2B DCX H Decrement the HL Pair
3114 72 MOV M,A Move ACC to Memory
3115 23 INX H Increment the HL Pair
3116 0D AHEAD DCR C Decrement the C Reg Content
3117 C2 0B 31 JNZ LOOP1 Repeat comparison until count is zero
311A 05 DCR B Decrement the B Reg Content
311B C2 05 31 JNZ LOOP2 Repeat N-1 comparison until B
count is zero
311E 76 HLT Terminate the program

OUTPUT
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
3200 05 3200 06
3201 03 3201 05
3202 01 3202 03
3203 02 3203 02
3204 06 3204 01
3205 3205

EE3414 – MPMC LABORATORY Page | 21


DEPARTMENT OF EEE

Exp.No:
DESCENDING ORDER
Date :

AIM

To write an assembly language program to sort an array of data in descending.

APPARATUS REQUIRED

S. NO Name of Apparatus Quantity


1. 8085 Microprocessor kit 1

ALGORITHM

1. Load the count value from memory to A register and save it in B register

2. Decrement B register. Set HL pair as data array address pointer

3. Set C register as counter for N-1 comparison.

4. Load the data of the array in accumulator using the data address pointer

5. Increment the HL pair. Compare the data pointed by HL with accumulator

6. If carry flag is reset then go to step 10 else go to next step

7. Exchange the content of memory painted by HL and accumulator

8. Decrement C reg. If zero flag is reset go to step 6 else go to next step.

9. Decrement B reg, If zero flag is reset go to step 3 else go to next step.

10. Terminate the program.

EE3414 – MPMC LABORATORY Page | 22


DEPARTMENT OF EEE

FLOWCHART: START

[B] 04H

[HL] [8100H]

[C] 04H

[A] [HL]

[HL [HL]
] +1

IS [HL]
[A] ?

[D] [HL]

[HL] [A]

[HL] [HL] - 1

IS [C]
[HL] [D]
=0

[HL] [HL] +1

[B] [B] - 1
[C] [C] – 01H

A IS [B]
=
0?

STOP

EE3414 – MPMC LABORATORY Page | 23


DEPARTMENT OF EEE

RESULT

Thus the program for descending order was implemented and verified successfully.

EE3414 – MPMC LABORATORY Page | 24


DEPARTMENT OF EEE

PROGRAM (SEARCH THE MINIMUM NUMBER) SMALLEST NUMBER

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


3000 21 00 31 LXI H, 3100H Load immediate 3100 to HL Pair
3003 06 05 MVI B,05 Comparison of 5 No's
3005 05 DCR B Decrement the B Reg
3006 7E MOV A,M Move memory to Acc
3007 23 LOOP1 INX H Increment the HL Pair
3008 BD CMP M Compare Memory with Acc
3009 DA JC if carry occur jump to Ahead
OD 30 AHEAD(300
D)
300C 7E MOV A,M Move memory to Acc
300D 05 AHEAD DCR B Decrement the B reg
300E C2 07 30 JNZ If no zero jump to Loop1
LOOP1(3007)
3011 32 33 32 STA 3200H Store the result
3014 76 HLT Terminate the program

OUTPUT

I /O MEMORY DAT DATA 2


LOCATION A1
INPUT 3100 01 02
3101 02 03
3102 03 05
3103 04 06
3104 05 07
OUTPUT 3200 01 02

EE3414 – MPMC LABORATORY Page | 25


DEPARTMENT OF EEE

Exp.No:
TO FIND A MINIMUM AND MAXIMUM NUMBER
Date :

AIM

To write an assembly language program to sort an array of data in descending order

APPARATUS REQUIRED

S. NO Name of appartus Quantity


1. 8085 Microprocessor Kit 1

ALGORITHM FOR FIND A MINIMUM NUMBER

1. Place all the elements of an array in the consecutive memory locations.

2. Fetch the first element from the memory location and load it in the accumulator:

3. Initialize a counter (register) with the total number of elements in an array.

4. Decrement the counter by 1

5. Increment the memory pointer to paint to the next element.

6. Compare the accumulator content with the memory content (next element)

7. If the accumulator content is smaller, then move the memory content (largest
element) to the accumulator. Else continue.

8. Decrement the counter by 1.

9. Repeat steps 5 to 8 until the counter reaches zero

10. Store the result (accumulator content) in the specified memory location

EE3414 – MPMC LABORATORY Page | 26


DEPARTMENT OF EEE

PROGRAM (SEARCH THE MAXIMUM NUMBER) LARGEST NUMBER

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


3000 21 00 31 LXI H, 3100H Load immediate 3100 to HL Pair
3003 06 05 MVI B,05 Comparison of 5 No's
3005 05 DCR B Decrement the B Reg
3006 7E MOV A,M Move memory to Acc
3007 23 LOOP1 INX H Increment the HL Pair
3008 BD CMP M Compare Memory with Acc
3009 DA JC if carry occur jump to Ahead
OD 30 AHEAD(300
D)
300C 7E MOV A,M Move memory to Acc
300D 05 AHEAD DCR B Decrement the B reg
300E C2 07 30 JNZ If no zero jump to Loop1
LOOP1(3007)
3011 32 00 32 STA 3200H Store the result
3014 76 HLT Terminate the program

OUTPUT
I /O MEMORY DAT DATA 2
LOCATION A1
INPUT 3100 01 02
3101 02 06
3102 03 07
3103 04 08
3104 05 09
OUTPUT 3200 05 09

EE3414 – MPMC LABORATORY Page | 27


DEPARTMENT OF EEE

ALGORITHM FOR FIND A MAXIMUM NUMBER

1. Place all the elements of an array in the consecutive memory location

2. Fetch the first element from the memory location and load it in the accumulator.

3. Initialize a counter (register) with the total number of elements in an array.

4. Decrement the counter by 1.

5. Increment the memory pointer to point to the next element

6. Compare the accumulator content with the memory content (next element).

7. If the accumulator content is smaller, then move the memory content (largest
element) to the accumulator. Else continue.

8. Decrement the counter by 1.

9. Repeat steps 5 to 8 until the counter reaches zero

10. Store the result (accumulator content) in the specified memory location.

RESULT

Thus the program for find a maximum and minimum number in a given set was
implemented and verified successfully.

EE3414 – MPMC LABORATORY Page | 28


DEPARTMENT OF EEE

PROGRAM USING RLC INSTRUCTION

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


3100 21 00 35 LXI H, 3500 Load immediate 3500 to HL Pair
3103 7E MVI A,M Move memory to ACC
3104 23 INX H Increment the HH Pair
3105 86 ADD M Add ACC with Memory content
3106 07 RLC Rotate ACC content Left with Carry
3107 32 00 36 STA 3600 Store the result
310A 76 HLT Terminate the Program

OUTPUT

INPUT OUTPUT

Memory Address Data Memory Address Data

3500 04 3600 0A

3501 01

PROGRAM USING RRC INSTRUCTION


ADDRESS OPCODE LABEL MNEMONICS COMMENTS
3100 21 00 35 LXI H, 3500 Load immediate 3500 to HL Pair
3103 7E MVI A,M Move memory to ACC
3104 23 INX H Increment the HH Pair
3105 86 ADD M Add ACC with Memory content
3106 0F RRC Rotate ACC content Right with
Carry
3107 32 00 36 STA 3600 Store the result
310A 76 HLT Terminate the Program

OUTPUT

INPUT OUTPUT

Memory Address Data Memory Address Data

3500 00 3600 128

3501 01

EE3414 – MPMC LABORATORY Page | 29


DEPARTMENT OF EEE

Exp.No:
PROGRAMS USING ROTATE INSTRUCTIONS
Date :

AIM

To rotate and execute an assembly language program to perform instruction.

APPARATUS REQUIRED

S. NO Name of Apparatus Quantity

1. 8085 Microprocessor kit 1

ALGORITHM FOR USING RLC INSTRUCTION

1. Start the program

2. Load the input and add them

3. Then the input values are rotated using RLC

4. Stop the program

ALGORITHM FOR USING RRC INSTRUCTION

1. Start the program

2. Load the input and add them

3. Then the input values are rotated using RRC

4. Stop the program

EE3414 – MPMC LABORATORY Page | 30


DEPARTMENT OF EEE

PROGRAM USING RAL INSTRUCTION

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


3100 21 00 35 LXI H, 3500 Load immediate 3500 to HL Pair
3103 7E MVI A,M Move memory to ACC
3104 23 INX H Increment the HH Pair
3105 86 ADD M Add ACC with Memory content
3106 17 RAL Rotate ACC content Left
3107 32 00 36 STA 3600 Store the result
310A 76 HLT Terminate the Program

OUTPUT

INPUT OUTPUT

Memory Address Data Memory Address Data

3500 05 3600 64

3501 00

PROGRAM USING RAR INSTRUCTION

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


3100 21 00 35 LXI H, 3500 Load immediate 3500 to HL Pair
3103 7E MVI A,M Move memory to ACC
3104 23 INX H Increment the HH Pair
3105 86 ADD M Add ACC with Memory content
3106 1F RAR Rotate ACC content Right
3107 32 00 36 STA 3600 Store the result
310A 76 HLT Terminate the Program

OUTPUT

INPUT OUTPUT

Memory Address Data Memory Address Data

3500 8A 3600 45

3501 00

EE3414 – MPMC LABORATORY Page | 31


DEPARTMENT OF EEE

ALGORITHM FOR USING RAL INSTRUCTION

1. Start the program

2. Load the input and add them

3. Then the input is rotated using rotate accumulator left through carry

4. Stop the program

ALGORITHM FOR USING RALR INSTRUCTION

1. Start the program

2. Load the Input data and add them

3. Then the input is rotated using rotate the accumulator right through carry

4. Stop the program

RESULT

Thus the program for using Rotate Instructions was implemented and verified
successfully.

EE3414 – MPMC LABORATORY Page | 32


DEPARTMENT OF EEE

PROGRAM FOR ASCII TO HEXA DECIMAL CONVERSION

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


3100 32 00 32 LDA 3200 Load Accumulator
3103 D6 30 SUI 30 Subtract immediate 30 with ACC
3105 FE 0A CPI 0A Compare immediate DA with ACC
3107 DA 0C 31 JC LOOP If carry jump to Loop
310A D6 07 SUI 07 Subtract immediate 07 with ACC
310C 32 00 36 STA 3300 Store the result
310F 76 HLT Terminate the Program

OUTPUT

INPUT OUTPUT

Memory Address Data Memory Address Data

3200 A 3300 41

EE3414 – MPMC LABORATORY Page | 33


DEPARTMENT OF EEE

Exp.No:
HEX/ASCII / BCD CODE CONVERSIONS
Date :

AIM

To write an assembly language program to convert

i. ASCII to Hexa ii. Hexa to ASCII iii. BCD to Hexa iv. Неxаtо BCD

APPARATUS REQUIRED

S. NO Name of Apparatus Quantity

1. 8085 Microprocessor Kit 1

ALGORITHM FOR ASCII TO HEXA DECIMAL CONVERSION

1. Load the given data in A register

2. Subtract 30H from A-register

3. Compare the content of A- register with OAH

4. If A<0AH, jump to step 6, else proceed to next step

5. Subtract 07H from A register

6. Store the result

7. Terminate the Program

EE3414 – MPMC LABORATORY Page | 34


DEPARTMENT OF EEE

PROGRAM FOR HEXA DECIMAL TO ASCII CONVERSION

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


3100 32 00 32 LDA 3200 Load Accumulator
3103 47 MOV B,A Subtract immediate 30 with ACC
3104 E6 0F ANI 0F Compare immediate DA with ACC
3107 CD 18 31 CALL LOOP If carry jump to Loop
3108 32 01 32 STA 3201 Subtract immediate 07 with ACC
3109 78 MOV B,A Store the result
310C E6 F0 ANI F0 AND immediate 0F with ACC
310D 07 RLC Rotate ACC left with carry
310E 07 RLC Rotate ACC left with carry
310F 07 RLC Rotate ACC left with carry
3112 07 RLC Rotate ACC left with carry
3113 CD 18 31 CALL LOOP Call loop
3115 32 02 32 STA 3202 Store the result
3117 76 HLT Terminate the program
3118 FE 0A LOOP CPI 0A Compare immediate 0A with ACC
3119 DA 1E 31 JC LOOP2 If carry occur jump to loop2
311C C6 07 ADI 07 Add immediate 07 to ACC
311E C6 30 LOOP2 ADI 30 Add immediate 30 to ACC
3120 C9 RET Return to main program

OUTPUT

INPUT OUTPUT

Memory Address Data Memory Address Data

3300 2
3200 32 3202

EE3414 – MPMC LABORATORY Page | 35


DEPARTMENT OF EEE

ALGORITHM FOR HEXA DECIMAL TO ASCII CONVERSION

1. Load the given data in A register and move to B-register

2. Mask the upper nibble of the Hexa decimal number in A rep

3. Call subroutine to get ASCII of lower nibble

4. Store it in memory

5. Move B-register to A register and mask the lower nibble

6. Rotate the upper nibble to lower nibble position

7. Call subroutine to get ASCII of upper nibble

8. Store it in memory

9. Terminate the Program

EE3414 – MPMC LABORATORY Page | 36


DEPARTMENT OF EEE

PROGRAM FOR BCD TO HEX CONVERSION


ADDRESS OPCODE LABEL MNEMONICS COMMENTS
3000 21 00 32 LXI H, 3200 Load immediate 3200H into HL pair
3003 7E MOV A,M Move memory Content into ACC
3004 87 ADD A Add ACC content with ACC
3005 47 MOV A,B Move ACC content into B reg
3006 87 ADD A Add ACC content with ACC
3007 87 ADD A Add ACC content with ACC
3008 80 ADD B Add ACC content with B reg
3009 23 INX H Increment HL pair
300A 86 ADD M Add memory content with ACC
300B 23 INX H Increment HL pair
300C 77 MOV M,A Move ACC content into memory (HL)
300D 76 HLT Terminate the program

OUTPUT

INPUT OUTPUT

Memory Address Data Memory Address Data

3200 0011 3202 30


3201 0000

EE3414 – MPMC LABORATORY Page | 37


DEPARTMENT OF EEE

ALGORITHM FOR BCD TO HEX CONVERSION

1. Initialize the memory Pointer to 8200H

2. Get the most Significant Digit (MSD)

3. Multiply the MSD by ten using repeated addition

4. Add the Least Significant Digit (LSD) to the result obtained by previous step

5. Store the HEX data in memory

EE3414 – MPMC LABORATORY Page | 38


DEPARTMENT OF EEE

PROGRAM FOR HEX TO BCD CONVERSION

ADDRESS OPCODE LABE MNEMONICS COMMENTS


L
3000 21 00 32 LXI H, 3200 Load immediate 3200H into HL pair
3003 16 00 MVID,00 Move immediate 00 to D reg
3004 AF XRA A EX – OR with ACC
3005 4E MOV C,M Move memory content into C reg
3006 C6 01 LOOP 2 ADI 01 Add immediate 01 to ACC
3008 27 DAA Decimal Adjustment with ACC
3009 D2 0D 30 JNC LOOP1 If no carry jump to loop1
300C 14 INR D Increment D reg
300D 0D LOOP 1 DCR C Decrement C reg
300E C2 06 30 JNZ LOOP2 If no carry jump to loop2
3011 32 00 33 STA 3300 Store the result
3014 7A MOV A,D Move D reg content into ACC
3015 32 01 33 STA 3301 Store the result
3018 76 HLT Terminate the program

OUTPUT

INPUT OUTPUT

Memory Address Data Memory Address Data

3300 0011
3200 32 3301 0010

EE3414 – MPMC LABORATORY Page | 39


DEPARTMENT OF EEE

ALGORITHM FOR HEX TO BCD CONVERSTON

1. Initialize memory Pointer to 3200H

2. Get the Hexa decimal number in C register

3. Perform repeated addition for C number of times

4. Adjust for BCD in each step

5. Store the BCD data in Memory

RESULT

Thus the program for Hexa, ASCII and BCD Conversion was implemented and verified
successfully.

EE3414 – MPMC LABORATORY Page | 40


DEPARTMENT OF EEE

PROGRAM
ADDRESS OPCODE LABEL MNEMONICS COMMENTS
2000 3E 98 MVI A, 98H INIT 8255 PA & PC upper as I/P
2002 D3 03 OUT 03H PB & PC lower as o/p
2004 3E 00 MVI A,00H Select channel-0
2006 D3 01 OUT 01H Out at port B
2008 3E 00 LP MVI A, 00H Select SOC & ALE Pulse as 0
200A D3 02 OUT 02H Out at port-C
200C 3E 03 MVI A, 03H Select SOC & ALE Pulse as 1
200E D3 02 OUT 02H Out at port-C
2010 3E 00 MVI A, 00H Select SOC & ALE Pulse as 0
2012 D3 02 OUT 02H Out at port-C
2014 DB 02 LP1 IN 02H Read EOC at PC4 bit
2016 E6 10 ANI 10H Mask bit
2018 CA 14 20 JZ LP1
201B 3E 04 MVI A,04H Give OE as1
201D D3 02 OUT 02H Out at port-C
201F SB 00 IN 00H Read EOC at PC4 bit
2021 32 F6 27 STA 27F6H Store ACC at 27F6 location
2024 CD 33 F4 CALL FA33H Call Display Routine
2027 11 40 90 LXI D, 9040H Load De pair data 9040H
202A CD A6 03 CALL 03A6H Call Delay Routine
202D C3 08 20 JMP LP Jump loop

EE3414 – MPMC LABORATORY Page | 41


DEPARTMENT OF EEE

Exp.No:
A/D INTERFACING
Date :

AIM

To write an assembly language program for interfacing the Analog to Digital Converter
with 8085 Microprocessor.

APPARATUS REQUIRED

S. NO Name of Apparatus Quantity

1. 8085 Microprocessor Kit 1

2. A/D Board 1

ALGORITHM

1. Connect the 26pin FRC to kit and insert power cable.

2. Switch ON the trainer kit.

3. Check all 8 channel input's and measure it.

4. Enter the given ADC program into the MP/MC kit.

5. If the channel selection is pb2 to pb0 [0 0 0] the CHO will connect to the MA
output line. Now we get to CHO corresponding digital value see in LCD Smiley
CHO to CH7are connected to the MUX output line based on the status of the
channel selection for pb2to pb0.

6. Execute the program.

7. Now check stepno.3.

8. Repeat the steps 3 and 5. Observe the multiplexer output and ADC output:

EE3414 – MPMC LABORATORY Page | 42


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 43


DEPARTMENT OF EEE

INTRODUCTION
ADC-0509 A/D Cards is an 8-bit analog to digital converter with 8 channel
multiplexer and microprocessor compatible control logic

The heart of the card is ADC-0809 monolithic CMOS Device. Its conversion is 100
micro sec. It eliminates the need for external zero and full scale adjustment. The card selects
one of the eight uni polar inputs by using the address decoder. ADC -0809 uses successive
approximation as conversion techniques. Input is latched to the decoder on the low to high
transition of the address latch enable signal. The conversion starts on the falling edge of the
start of conversion signal. During the process end of conversion signal goes low otherwise it
remains high. Digital output can be read from ADC making output enable signal high.

ADC CALCULATION

Calculate 1 count value

V.REF *2/digital count = 1count

2.5v*2/256 = .0195313v = 19mv

Calculate voltage vs digital count

[E:g]

2500mv/19mv = 131.57895

Decimal value Hexadecimal value


131.57895 83

RESULT

Thus the Interfacing of ADC with 8065 microprocessor was implemented and its

output is verified.
EE3414 – MPMC LABORATORY Page | 44
DEPARTMENT OF EEE

PROGRAM

ADDRESS OPCODE LABE MNEMONICS COMMENTS


L
2000 3E 80 MVI A, 80H Initialize 8255
2002 D3 03 OUT 03H PA & PB as Output
2004 3E 00 MVI A,00H Select A as Data 00
2006 D3 00 Loop 1 OUT 00H Out at X-out
2008 D3 01 OUT 01H Out at Y-out
200A 3C INR A Increment A
200B C3 06 20 JMP Loop 1

EE3414 – MPMC LABORATORY Page | 45


DEPARTMENT OF EEE

Exp.No:
D/A INTERFACING
Date :

AIM

To write an assembly language program for interfacing the Digital to Analog Converter with
8085 Microprocessor.

APPARATUS REQUIRED

S. NO Name of Apparatus Quantity

1. 8085 Microprocessor Kit 1

2. A/D Board 1

PORT DETAILS FOR 8085

8255 control register address -


23H 8255 Port A address -
20H
8255 Port B address -21H
8255 Port Caddress -22H

ALGORITHM
1. Connect the 9 pin D type connector from the DAC module to the Mp/Mc kit.
2. Connect the 26-pin connector from the DUAL CHANNEL DAC module toMp/Mc kit
3. Connect the keyboard to the Mp/Mc kit.
4. Switch on the power supply.
5. Assemble your program.
6. Execute it and measure the output voltage at the front panel of the DAC module.
7. Vary the digital count, execute the program and measure the outputanalog
voltage.
8. Take number of readings and if required draws the graph, DAC input count
output Voltage to check the linearity.
9. Switch off the power supply and remove all the connections.

EE3414 – MPMC LABORATORY Page | 46


DEPARTMENT OF EEE

CALCULATION

1 count = VCC/256
(decimal) =5/256
=0.0196v

OUTPUT

Digital Input Output Voltage


00 0.0
19 0.5
33 1.0
4C 1.5
66 2.0
7F 2.5
99 3.0
B2 3.5
CC 4.0
E5 4.5
FF 5.0

EE3414 – MPMC LABORATORY Page | 47


DEPARTMENT OF EEE

INTRODUCTION

A digital number can be converted to an analog voltage by selectively adding voltage which
is proportional to the weight of each binary digit. The module finds a great use in feedback
system, like output of a channel is fed to a control circuit to contain output in the form of
signal is observed at an oscilloscope or for a hard copy fed to an X Y Recorder/ X-T
Recorder. Different wave forms can be generated by using this DAC- 0800 Module.

CIRCUIT DESCRIPTION:

Port A& Port B are connected to channel 1 and channel 2 respectively. A reference voltage
of 8V is generated using 723 and is given to Verify points of the DAC 0800. The standard
output voltage will be 7.98V when FF is outputted and will be OV when 00 is outputted. The
output of DAC-0800 is fed to the operational amplifier to get the final output as X Out and Y
Out Several interesting waveforms can be generated and observed on Oscilloscope.

EE3414 – MPMC LABORATORY Page | 48


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 49


DEPARTMENT OF EEE

RESULT

Thus the Interfacing of DAC with 8085 microprocessor was implemented and itsoutput is
verified.

EE3414 – MPMC LABORATORY Page | 50


DEPARTMENT OF EEE

PROGRAM
ADDRESS OPCODE LABEL MNEMONICS COMMENTS
2000 3E 80 MVI A, 80H Set All Ports as Output
2002 D3 03 OUT 03H
2004 3E 11 MVI A, 11H Set All Square Red(Stop)
2006 D3 00 OUT 00H
2008 D3 02 OUT 02H
200A CD 50 20 Call delay1 Call Delay 10MSEC
200D 3E 44 Loop: MVI A, 44H Set Green (Go Led) of N & S
200F D3 00 OUT 00H Set Green (Go Led) of E& W
2011 CD 50 20 Call Delay1 Call Delay 10MSEC
2014 3E 22 MVI A, 22H
2016 D3 00 OUT 00H Set Yellow (Go LED) of N & S
2018 CD 63 20 Call Delay 2 Call Delay 5MSEC
201B 3E 99 MVI A, 99H Set All Square Red(Stop)
201D D3 00 OUT 00H Set Green (Go-Left Led) of N & S
201F CD 50 20 Call Delay 1 Call Delay 10MSEC
2022 3E 22 MVI A, 22H
2024 D3 00 OUT 00H Set Yellow (Start LED) of N & S
2026 CD 63 20 Call Delay2 Call Delay 5 MSEC
2029 3E 11 MVI A, 11H Set All Square Red(Stop)
202B D3 00 OUT 00H
202D 3E 44 MVI A, 44H Set Green (Go LED) of E & W
202F D3 02 OUT 02H
2031 CD 50 20 Call Delay1 Call Delay 10MSEC
2034 3E 22 MVI A, 22H
2036 D3 02 OUT 02H Set Yellow (Start LED) of E & W
2038 CD 63 20 Call Delay2 Call Delay 5MSEC
203B 3E 99 MVI A, 99H Set All Square Red (Stop)
203D D3 02 OUT 02H Set Green (go-left led) of E & W
203F CD 50 20 Call Delay 1 Call Delay 10MSEC
2042 3E 22 MVI A, 22H Set Yellow (start LED) of E & W
2044 D3 02 OUT 02H
2046 CD 63 20 Call Delay 2 Call Delay 5 MSEC
2049 3E 11 MVI A, 11H Set All Square Red (Stop)
204B D3 02 OUT 02H
204D C3 0D 20 JMP Loop Jump to Loop
2050 06 25 Delay1: MVI B, 25H 10 MSEC DelayRoutine
2052 0E FF LP3 MVI C, 0FFH
2054 16 FF LP2 MVI D, 0FFH
2056 15 LP1 DCR D
2057 C2 56 20 JNZ LP1
205A 0D DCR C
205B C2 54 20 JNZ LP2
205E 05 DCR B
205F C2 52 20 JNZ LP3
2062 C9 RET
2063 06 05 Delay2: MVI B, 05H 5 MSEC Delay Routine
2065 0E FF LP6: MVI C, 0FFH

EE3414 – MPMC LABORATORY Page | 51


DEPARTMENT OF EEE

Exp.No:
TRAFFIC LIGHT CONTROLLER
Date :

AIM

To write an assembly language program for interfacing the Traffic Light Controller with
8085 Microprocessor.

APPARATUS REQUIRED

S. NO Name of Apparatus Quantity

1. 8085 Microprocessor Kit 1

2. Traffic Light Controller 1

ALGORITHM

1. The port address was initialized for the above table,

2. Enter the op code with specified initialization address

3. Execute the program.

4. Verify the output result.

INTRODUCTION

In this modern life, the number of vehicles increases more day by day. The increase of
vehicle may cause accidents and other problems on the road. Controlling traffic at regular
intervals of time with accuracy and uniformity has become a necessity to avoid accidents,
discomfort of drivers. The microprocessor controls the traffic signals very effectively and
with accurate timings.

EE3414 – MPMC LABORATORY Page | 52


DEPARTMENT OF EEE

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


2067 16 FF LP5: MVI D, 0FFH
2069 15 LP4: DCR D
206A C2 69 20 JNZ LP4
206D 0D DCR C
206E C2 67 20 JNZ LP5
2071 05 DCR B
2072 C2 65 20 JNZ LP6
2075 C9 RET

EE3414 – MPMC LABORATORY Page | 53


DEPARTMENT OF EEE

CIRCUIT DESCRIPTION

In this Traffic Light Module one square is shown which has four ends called East, West, and
North & South. The Traffic light Module is interfaced with Port A and Fort C of 8255. Port
A is connected with North and South LED's, Port C is connected with East and West LED's.
Each end has four LED's called Stop, Start, and GO straight & GO LEFT.

Port A
North South
PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0

GO GO- Start Stop GO GO- Start Stop

Lefft STR Lefft STR

Port B
North South
PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0
GO GO- Start Stop GO GO- Start Stop

Lefft STR Lefft STR

RESULT

Thus the Interfacing of Traffic Light Controller with 8085 microprocessor was implemented
and its output is verified

EE3414 – MPMC LABORATORY Page | 54


DEPARTMENT OF EEE

PROGRAM
ADDRESS OPCODE LABEL MNEMONICS COMMENTS
MOV SI, 1200 MOV 1200 TO SI
MOV DI, 1300 MOV 1300 TO DI
MOV CX, 0006 Assign Count Value CX As 6
CLD Clear Direction Flag
L1: MOVSB Copies A Single Byte and
Increment
LOOP L1 Repeat Till it Completes Block
Transfer
HLT Halt

OUTPUT

INPUT OUTPUT

Memory Data Memory Data


Address Address
2000H 1300H
2001H 1301H

2002H 1302H

2003H 1303H

2004H 1304H

2005H 1305H

EE3414 – MPMC LABORATORY Page | 55


DEPARTMENT OF EEE

Exp.No:
DISPLAY THE DATA
Date :

AIM

To write an assembly language program to move a block of data using 8085


microprocessor.

APPARATUS REQUIRED

S. NO Name of Apparatus Quantity

1. 8085 Microprocessor Kit 1

ALGORITHM

Step 1:
Move the contents to DS
Step 2:
Place it in an array
Step 3:
Move the contents to source index Step
4:
Increment SI and DI
Step 5:
Loop it till it gets completed
Step 6:
End

Result:
Thus the above program was written executed and desired output was obtained.

EE3414 – MPMC LABORATORY Page | 56


DEPARTMENT OF EEE

PROGRAM FOR ADDITION


ADDRESS OPCODE LABEL MNEMONICS COMMENTS
3100 START CLR C Clear C reg
3101 MOV R0, #00 Move 0H immediate to R0 reg
3103 MOV A, #05 Move 5H immediate to ACC
3105 MOV B, #03 Move 3H immediate to B reg
3107 ADD A,B Add A and B reg
3109 MOV DPTR,#3200 Move 3200H to DPTR
310D JNC AHEAD(3110) If no carry jump to ahead
310F INC R0 Increment R0 reg
3110 AHEAD MOVX @DPTR,A Move ACC to DPTR
3111 INC DPTR Increment the DPTR Address
3112 MOV A,R0 Move R0 Reg Content into ACC
3113 MOV X @DPTR,A Move ACC to DPTR
3114 HERE SJMP HERE Stop the program

OUTPUT

INPUT OUTPUT

Memory Address Data Memory Address Data

3200 05
A Reg 02
B Reg 03 3201 00

EE3414 – MPMC LABORATORY Page | 57


DEPARTMENT OF EEE

Exp.No:
DEMONSTRATION OF BASIC INSTRUCTIONS WITH 8051 MICRO
Date : CONTROLLER EXECUTION, INCLUDING CONDITIONAL JUMPS,
LOOPING (8-BIT ADDITION AND SUBTRACTION)

AIM

To write an assembly language program for 8-bit addition and subtraction using 8051.

APPARATUS REQUIRED

S. NO Name of Apparatus Quantity

1. 8051 Micro Controller Kit 1

ALGORITHM FOR ADDITION

1) Start the program

2) Get the data

3) Add two numbers

4) Store the result

5) Stop the program

EE3414 – MPMC LABORATORY Page | 58


DEPARTMENT OF EEE

PROGRAM FOR SUBTRACTION


ADDRESS OPCODE LABEL MNEMONICS COMMENTS
3100 START CLR C Clear C reg
3101 MOV R0, #00 Move 0H immediate to R0 reg
3103 MOV A, #05 Move 5H immediate to ACC
3105 MOV B, #03 Move 3H immediate to B reg
3107 ADD A,B Subtract with borrow A and B reg
3109 MOV DPTR,#3200 Move 3200H to DPTR
310D JNC AHEAD If no carry jump to ahead
310F INC R0 Increment R0 reg
3110 AHEAD MOVX @DPTR,A Move ACC to DPTR
3111 INC DPTR Increment the DPTR Address
3112 MOV A,R0 Move R0 Reg Content into ACC
3113 MOV X @DPTR,A Move ACC to DPTR
3114 HERE SJMP HERE Stop the program

OUTPUT

INPUT OUTPUT

Memory Address Data Memory Address Data

3200 07
A Reg 33
B Reg 02 3201 00

EE3414 – MPMC LABORATORY Page | 59


DEPARTMENT OF EEE

ALGORITHM FOR SUBTRACTION

1) Start the program

2) Get the data

3) Subtract two numbers

4) Store the result

5) Stop the program

RESULT

Thus the program for Addition and Subtraction was implemented and verified
successfully.

EE3414 – MPMC LABORATORY Page | 60


DEPARTMENT OF EEE

PROGRAM FOR MULTIPLICATION


ADDRESS OPCODE LABEL MNEMONICS COMMENTS
3500 MOV Move 3600H to DPTR
DPTR,
#3600H
3503 MOVX A, @DPTR Move DPTR to ACC
3504 MOV B,A Move ACC to B Reg
3506 MOV Move 3601H to DPTR
DPTR,
#3601H
3509 MOVX A, @DPTR Move DPTR to ACC
350A MUL AB Multiply the B-Reg content to
ACC
350B MOV Move 3701H to DPTR
DPTR,
#3701H
350E MOVX @DPTR, A Move ACC to DPTR
350F MOV Move 3700H to DPTR
DPTR,
#3700H
3512 MOV A,B Move B reg Content into ACC
3514 MOVX @DPTR,A Move ACC to DPTR
3515 HERE SJMP HERE Stop the Program

OUTPUT

INPUT OUTPUT

Memory Address Data Memory Address Data

3701 06
3600 02
3601 03 3700 00

EE3414 – MPMC LABORATORY Page | 61


DEPARTMENT OF EEE

Exp.No:
DEMONSTRATION OF BASIC INSTRUCTIONS WITH 8051 MICRO
Date : CONTROLLER EXECUTION, INCLUDING CONDITIONAL JUMPS,
LOOPING (8-BIT MULTIPLICATION AND DIVISION)

AIM

To write an assembly language program for 8-bit multiplication and division using8051.

APPARATUS REQUIRED

S. NO Name of Apparatus Quantity

1. 8051 Micro Controller Kit 1

ALGORITHM FOR MULTIPLICATION

1) Start the program

2) Get the two numbers

3) Multiply two numbers

4) Store the result

5) Stop the program

EE3414 – MPMC LABORATORY Page | 62


DEPARTMENT OF EEE

PROGRAM FOR DIVISION


ADDRESS OPCODE LABEL MNEMONICS COMMENTS
3500 MOV Move 3600H to DPTR
DPTR,
#3600H
3503 MOVX A, @DPTR Move DPTR to ACC
3504 MOV B,A Move ACC to B Reg
3506 MOV Move 3601H to DPTR
DPTR,
#3601H
3509 MOVX A, @DPTR Move DPTR to ACC
350A DIV AB Divide the B-Reg content to ACC
350B MOV Move 3701H to DPTR
DPTR,
#3701H
350E MOVX @DPTR, A Move ACC to DPTR
350F MOV Move 3700H to DPTR
DPTR,
#3700H
3512 MOV A,B Move B reg Content into ACC
3514 MOVX @DPTR,A Move ACC to DPTR
3515 HERE SJMP HERE Stop the Program

OUTPUT

INPUT OUTPUT

Memory Address Data Memory Address Data

3701 02
3600 06
3601 03 3700 00

EE3414 – MPMC LABORATORY Page | 63


DEPARTMENT OF EEE

ALGORITHM FOR DIVISION

1) Start the program

2) Get the two numbers

3) Multiply two numbers

4) Store the result

5) Stop the program

RESULT

Thus the program for Multiplication and Division was implemented and verified successfully.

EE3414 – MPMC LABORATORY Page | 64


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 65


DEPARTMENT OF EEE

Exp.No:
LARGEST ELEMENT IN AN ARRAY
Date :

AIM:

To write an assembly language program to find the largest element in an array and to
execute it using 8051.

APPARATUS REQUIRED:

S. NO Name of Apparatus Quantity

1. 8051 Micro Controller Kit 1

ALGORITHM

1. Start.

2. Load the array count in a register

3. Get the first two numbers.

4. Compare the numbers and swap them so that the two numbers are in ascending
order.

5. Repeat steps 3 and 4 till the array is completed.

6. Repeat the steps 3, 4 and 5 and store the largest number as the result in memory.

7. Stop.

EE3414 – MPMC LABORATORY Page | 66


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 67


DEPARTMENT OF EEE

RESULT:
Thus an assembly language program written to find the largest element in an array was
executed using 8051 microcontroller and the output was verified.

EE3414 – MPMC LABORATORY Page | 68


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 69


DEPARTMENT OF EEE

Exp.No:
SMALLEST ELEMENT IN AN ARRAY
Date :

AIM:

To write an assembly language program to find the smallest element in an array and to
execute it using 8051.

APPARATUS REQUIRED:

S. NO Name of Apparatus Quantity

1. 8051 Micro Controller Kit 1

ALGORITHM
1. Start.
2. Load the array count in a register
3. Get the first two numbers.
4. Compare the numbers and swap them so that the two numbers are in ascending
order.
5. Repeat steps 3 and 4 till the array is completed.
6. Repeat the steps 3, 4 and 5 and store the largest number as the result in memory.
7. Stop.

EE3414 – MPMC LABORATORY Page | 70


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 71


DEPARTMENT OF EEE

RESULT:
Thus an assembly language program written for finding the smallest element in an array was
executed using 8051 microcontroller and the output was verified.

EE3414 – MPMC LABORATORY Page | 72


DEPARTMENT OF EEE

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


3000 90 FF 03 MOV DPTR, # FF03H
3003 74 80 MOV A, #80H Set all ports as output
3005 F0 MOVX @DPTR, A INIT Ports of 8255
3006 90 FF 00 START MOV DPTR, #FF00H
3009 74 FA MOV A, #0FAH Output code for step0
300B F0 MOVX @DPTR, A Set PA1 & PA3 coil high
300C 11 1F ACALL DELAY Delay between two steps
(301F)
300E 74 F6 MOV A, #0F6H Output code for step1
3010 F0 MOVX @DPTR, A Set PA1 & PA2 coil high
3011 11 1F ACALL DELAY Delay between two steps
(301F)
3013 74 F5 MOV A, #F5H Output code for step2
3015 F0 MOVX @DPTR, A Set PA0 & PA2 coil high
3016 11 1F ACALL DELAY Delay between two steps
(301F)
3018 74 F9 MOV A, #F9H Output code for step3
301A F0 MOVX @DPTR, A Set PA0 & PA3 coil high
301B 11 1F ACALL DELAY Delay between two steps
(301F)
301D 80 E7 SJMP START(3006) Jump to start
301F 7F 3F DELAY MOV R7, #3FH Delay Count
3021 7E 3F DELAY MOV R6, #3FH
3023 00 NOP
3024 00 NOP
3025 00 BOP
3026 DE FB DJNZ R6, DELAY
3028 DF F7 DJNZ R7, DELAY
302A 22 RET

This program will move the motor in Anti-clock wise direction. For Clock wise
direction change F9, F5, F6, FA in place of FA, F6, F5, F9.

EE3414 – MPMC LABORATORY Page | 73


DEPARTMENT OF EEE

Exp.No:
PROGRAM FOR STEPPER MOTOR CONTROLLER
Date :

AIM

To interface a stepper motor with 8051 microcontroller and operate it.

APPARATUS REQUIRED

S. NO Name of Apparatus Quantity

1. 8051 Micro Controller Kit 1

2. Stepper Motor 1

THEORY

There are many systems to monitor various processes and give out control signals in the
form of digits but there is only one device to convert these digital pulses into precise
incremental motion and that device is stepping motor Stepper motor is a device which
converts digital pulses into precise angular of linear steps of desired valve Stepper Motor has
two phase bifilar form with having a Step Angle of 1.8 Stepper Motor module can hold
Motor in infinitely static condition. It can control speed up to 3,000 RPM i.e. O to 10,000
Step per second. It can be program in three parameters the Speed, Direction & Number of
steps. The speed of motor is generated by frequency of switching not the supply voltage. A
pulse input to two phase clock will move the shaft of motor by on step for every pulse: Thus
number of steps can be moved and can be precisely controlled. If there is no pulse the motor
will remain lock up in the portion in which the last step was taken. Since at any time of two
winding always energized which lock the motor electromagnetically.

STEPPER MOTOR:
Stepping Motors differ from conventional Servo Motors in following respect:

 There is no control winding in stepping motors Both windings we Identical.


 The stepping rates (speed of rotation) are governed by frequency 2 switching and not
supply voltage.

EE3414 – MPMC LABORATORY Page | 74


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 75


DEPARTMENT OF EEE

A pulse input two phase clock (instead of continuous pulses) will move the shaft of motor by
one step for every pulse, thus number of steps be moved can be precisely controlled When
there is no pulse input, the rotor will remain locked up in the portion in which the last step
was taken since at any time two winding always energized which fock the rotor
electromagnetically.
Stepping motors can be programmed in three parameters namely:

(a) Direction

(b) Speed and

(c) Number of Steps

WORKING OF STEPPING MOTOR

The stepping action is caused by sequential switching of supply to the two phases of the
motor as described in switching diagram. All stepping motors are of bifilar type with six
leads. Watch of the two phases of motor has double winding with a centre top switching the
supply from one side to another of a phase causes reversal of magnetic polar without actually
reversing the polarity of supply. For step input sequence gives 1.8° (full) after and eight step
input sequences give 0.9° (half) step function.

Switching Sequence

Step Q4 Q2 Q3 Q1 Modes Direction


1 0 0 1 0 1 Phase
2 0 1 0 0 excitation
3 0 0 0 1 wave device
4 1 0 0 0
CW ROTATION
CCW ROTATION

1 1 0 1 0 2 Phase
2 0 1 1 0 Excitation
3 0 1 0 1
4 1 0 0 1
1 1 0 1 0
2 0 0 1 0
3 0 1 1 0
4 0 1 0 1
5 0 1 0 1
6 0 0 0 1
7 1 0 0 1
8 1 0 0 0

The above switching Sequence/Logic will move shaft in one direction. To change direction
of rotation read the sequence upward.
The specified torque of any stepping motor is the torque at stand still (holding torque). This
torque is directly proportional to the current in the winding. The current in winding is
governed by the DC resistance of winding.

EE3414 – MPMC LABORATORY Page | 76


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 77


DEPARTMENT OF EEE

As the switching sequence starts the inductive reactance of the winding which increases with
the frequency of switching opposes the rise of current to desired level within the time given
for one step depending upon the speed of stepping. This is mainly due to L/R time constant
of winding. The drop in current level causes drop in torque as the speed increases. In order to
improve torque at high speeds it is necessary to maintain current at the desired level. This
can be done by one of the following methods:

1. By increasing supply voltage and introducing current limiting resistances in each


phase. Introduction of resistances improves the time constant of winding. Seven to
nine time the winding resistance in each phase will give very good movement
torque/speed Characteristics.
2. By using a constant current source with or without a chopper instead of constant
voltage source which will give even better performance.

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 buffer 7407 with open collector.

BLOCK DIAGRAM:

8051 DRIVER CIRCUIT


8255 STEPPER MOTOR
MICROCONTROLLER

PROCEDURE

1. Enter the above program starting from location 3000 and execute the same.
2. The stepper motor rotates.
3. Varying the count at R4 and RS can vary the speed.

RESULT

Thus stepper motor was interfaced with 8051 and run in forward and reverse directions at
various speeds.

EE3414 – MPMC LABORATORY Page | 78


DEPARTMENT OF EEE

PROGRAM

EE3414 – MPMC LABORATORY Page | 79


DEPARTMENT OF EEE

Exp.No:
TRAFFIC LIGHT CONTROLLER
Date :

AIM

To write an assembly language program for interfacing the Traffic Light Controller with
8051 Microcontroller.

APPARATUS REQUIRED

S. NO Name of Apparatus Quantity

1. 8085 Microcontroller Kit 1

2. Traffic Light Controller 1

ALGORITHM

1. The port address was initialized for the above table.

2. Enter the op code with specified initialization address.

3. Execute the program.

4. Verify the output result.

INTRODUCTION

In this modern life, the number of vehicles increases more day by day. The increase of
vehicle may cause accidents and other problems on the road. Controlling traffic at regular
intervals of time with accuracy and uniformity has become a necessity to avoid accidents,
discomfort of drivers. The microprocessor controls the traffic signals very effectively and
with accurate timings.

EE3414 – MPMC LABORATORY Page | 80


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 81


DEPARTMENT OF EEE

CIRCUIT DESCRIPTION

In this Traffic Light Module one square is shown which has four ends called East, West, and
North & South. The Traffic light Module is interfaced with Port A and Fort C of 8255. Port
A is connected with North and South LED's, Port C is connected with East and West LED's.
Each end has four LED's called Stop, Start, and GO straight & GO LEFT.

RESULT

Thus the Interfacing of Traffic Light Controller with 8051 microcontroller was implemented
and its output is verified

EE3414 – MPMC LABORATORY Page | 82


DEPARTMENT OF EEE

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


3000 90 FF 03 MOV DPTR, # FF03H
3003 74 98 MOV A, #98H INIT CWR OF 8255
3005 F0 MOVX @DPTR, A Port AC as Input, port B as
Output
3006 90 FF 01 START: MOV DPTR, #FF01H
3009 74 00 MOV A, #0H Select channel-0
300B F0 MOVX @DPTR, A Out at port-B
300C 90 FF 02 MOV DPTR, #FF02H
300E 74 00 MOV A, #0H Select SOC & ALE Pulse as 0
3011 F0 MOVX @DPTR, A Out at port-C
3012 74 03 MOV A, #03H Select SOC & ALE Pulse as 1
3014 F0 MOVX @DPTR, A Out at port-C
3015 74 00 MOV A, #0H Select SOC & ALE Pulse as 0
3017 F0 MOVX @DPTR, A Out at port-C
3018 E0 DL1: MOVX A, @DPTR Read EOC at PC4 Bit
3019 54 10 ANL A, #10H MASK bit
301B 60 FB JZ DL1 Jump TI;; EOC gets 1
301D 74 04 MOV A, #04H Give OE as 1
301F F0 DELAY MOVX @DPTR, A Out at port-C
3020 90 FF 00 DELAY MOV DPTR, # FF00H
3023 E0 MOVX A, @DPTR Read data at port-A
3024 F9 MOV R1, A Store ACC at reg R1
3025 12 30 2A LCALL DISP Call Display Routine
3028 80 DC SJMP Start Jump start
302A 90 31 04 DISP: MOV DPTR, # 3104H Display Routine
302D E9 MOV A,R1 Move R1 data to ACC
302E 54 F0 ANL A,F0H MASK LSB bit to get MSB
nibble
3030 C4 Swap A Swap ACC
3031 12 0B 77 LCALL 0B77H Call HEX to ASCII Code
3034 F0 MOVX @DPTR, A Store in pointer address
3035 A3 INC DPTR Increment pointer address
3036 E9 MOV A, R1 Move R1 data to ACC
3037 54 0F ANL A, #FH MASK MSB bit to get LSB
nibble
3039 12 0B 77 LCALL 0B77H Call HEX to ASSCII Code
303C F0 MOVX @DPTR, A Store in pointer address
303D A3 INC DPTR Increment pointer address
303E 74 20 MOV A, #20H Move 20H to ACC
3040 F0 MOVX @DPTR, A Store in pointer address
3041 90 31 00 MOVX Load pointer address to display
@DPTR,
#TBL1

EE3414 – MPMC LABORATORY Page | 83


DEPARTMENT OF EEE

Exp.No:
STUDY ON INTERFACE WITH ANALOG TO DIGITAL
Date : CONVERTOR

AIM

To interface A/D Converter with 8051 microcontroller.

APPARATUS REQUIRED

S. NO Name of Apparatus Quantity

1. 8051 Micro Controller Kit 1

2. A/D Converter 1

INTRODUCTION

ADC-0809 A/D Card is an 8-bit analog to digital converter with 8 channel multiplexer and
microprocessor compatible control logic. The heart of the card is ADC- 0809 monolithic C-
MOS Device. Its conversion time is 100 micro sec. It eliminates the need for external zero
and full scale adjustment. The card selects one of the eight uni polar inputs by using the
address decoder. ADC-0809 uses successive approximation as conversion techniques. Input
is latched to the deodar on the low to high transition of the address latch enable signal. The
conversion starts on the falling edge of the start of conversion signal. During the process end
of conversion signal goes low otherwise remains high. Digital output can be read from ADC
making output enable signal high.

EE3414 – MPMC LABORATORY Page | 84


DEPARTMENT OF EEE

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


3044 12 0A 3C LCALL 0A3CH Display Monitor Routine
3047 22 RET
3100: ORG 3100H; Table to Store ADC Data
3100 43 48 30 TBL1: DFB
2D 20
3105 20 20 20 DFB
20 20
310A 20 20 20 DFB
20 20
310F 20 20 20 DFB
20 20

EE3414 – MPMC LABORATORY Page | 85


DEPARTMENT OF EEE

CIRCUIT DESCRIPTION

The Data line of ADC-0809 00 to 07 is connected to Port A as input sort soc connected to
PCU as Output Port; EOC is connected to IC4 as Input Port & ALE is connected to PC1 as
Output Port. All eight inputs of 0-5 Volts ADC: 0809 analog with external clock, external
EOC, external SOC signals are brought to 26 pin connector. A Clock input of a specified
frequency is required for the operation of ADC-G009 A Counter 7:41 593 has been used for
this purpose

RESULT:

Thus the interfacing of analog to digital converter was interfaced with 8051
microcontroller and the output is verified.

EE3414 – MPMC LABORATORY Page | 86


DEPARTMENT OF EEE

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


3000 90 FF 03 MOV DPTR, # FF03H INIT CWR OF 8255
3003 74 98 MOV A, #80H PA & PB as Output
3005 F0 MOVX @DPTR, A
3006 74 00 MOV A, #0H Select A as Data 00
3008 90 FF 00 LP MOV DPTR, # FF00H X-Out Port A
300B F0 MOVX @DPTR, A
300C 90 FF 01 MOV DPTR, #FF01H Y-Out Port A
300F F0 MOVX @DPTR, A
3010 04 INC A Increment A
3011 80 F5 SJMP LP(3008)

EE3414 – MPMC LABORATORY Page | 87


DEPARTMENT OF EEE

Exp.No:
STUDY ON INTERFACE WITH DIGITAL TO ANALOG
Date : CONVERTER

AIM

To interface D/A Converter with 8051 microcontroller.

APPARATUS REQUIRED

S. NO Name of Apparatus Quantity

1. 8051 Micro Controller Kit 1

2. D/A Converter 1

INTRODUCTION

A digital number can be converted to an analog voltage by selectively adding voltage which
is proportional to the weight of each binary digit. The module finds a great use in feed back
system, like output of a channel is fed to a control circuit to contain output in the form of
signal is observed at an oscilloscope or for a hard copy fed to an X- Y Recorder/ X-T
Recorder. Different wave forms can be generated by using this DAC- 0800Module.

CIRCUIT DESCRIPTION

Port A& Port B are connected to channel 1 and channel 2 respectively. A reference voltage
of 8V is generated using 723 and is given to Verify points of the DAC 0800. The standard
output voltage will be 7.98V when FF is outputted and will be 0v when 00 is outputted. The
output of DAC-0800 is fed to the operational amplifier to get the final output as X Out and Y
Out. Several interesting waveforms can be generated and observed on Oscilloscope

EE3414 – MPMC LABORATORY Page | 88


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 89


DEPARTMENT OF EEE

RESULT:

Thus the interfacing of digital to analog converter was interfaced with 8051
microcontroller and the output is verified.

EE3414 – MPMC LABORATORY Page | 90


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 91


DEPARTMENT OF EEE

Exp.No:
DISPLAY THE DATA
Date :

AIM

To write an assembly language program to move a block of data using 8051


microcontroller.

APPARATUS REQUIRED

S. NO Name of Apparatus Quantity

1. 8051 Microcontroller Kit 1

ALGORITHM

Step 1:
Move the contents to DS
Step 2:
Place it in an array
Step 3:
Move the contents to source index Step
4:
Increment SI and DI
Step 5:
Loop it till it gets completed
Step 6:
End

Result:
Thus the above program was written executed and desired output was obtained.

EE3414 – MPMC LABORATORY Page | 92


DEPARTMENT OF EEE

Pin Diagram

EE3414 – MPMC LABORATORY Page | 93


DEPARTMENT OF EEE

Exp.No:
STUDY ON PIC ARCHITECTURE
Date :

AIM

To study of PIC system and describe the features of architecture.

ARCHITECTURE OF PIC PROCESSOR:

The PIC 16F877A PIC microcontroller is one of the most popular general purpose
microcontrollers. It is of 8-bit which means the most available operations are limited to 8-
bits.It is a 40-pin IC.

Ports:

There is one 6-bit ports: A , 3 8-bit ports: B ,C,D and one 3 bit port: E.

PORTA (Pin 2 to 7) and TRISA register: PORTA is a 6-bit wide, bidirectional port. The
corresponding data direction register is TRISA. Setting a TRISA bit ( = 1) will make the
corresponding. PORTA pin an input (i.e., put the corresponding output driver in a High-
Impedance mode).Clearing a TRISA bit (= 0) will make the corresponding PORTA pin an
output (i.e., put the contents of the output latch on the selected pin).Reading the PORTA
register reads the status of the pins, whereas writing to it will write to the port latch. All write
operations are read- modify write operations. Therefore, a write to a port implies that the port
pins are read, the value is modified and then written to the port data latch.

PORTB (Pin 33 to 40)and TRISB register: PORTB is an 8-bit wide, bidirectional port. The
corresponding data direction register is TRISB. Setting a TRISB bit (= 1) will make the
corresponding PORTB pin an input (i.e., put the corresponding output driver in a High-
Impedance mode). Clearing a TRISB bit (= 0) will make the corresponding PORTB pin an
output (i.e. put the contents of the output latch on the selected pin).Three pins of PORTB are
multiplexed with the In-Circuit. Debugger and Low- Voltage Programming function:
RB3/PGM, RB6/PGC and RB7/PGD.

PORTC (pin 15 to 18 and pin 24 to 26) and TRISC register: PORTC is an 8-bit wide,
bidirectional port. The corresponding data direction register is TRISC. Setting a TRISC bit
(= 1) will make the corresponding PORTC pin an input (i.e., put the corresponding output
driver in a High-Impedance mode). Clearing a TRISC bit (= 0) will make the corresponding
PORTC pin an output (i.e. put the contents of the output latch on the selected pin).PORTC is
multiplexed with several peripheral functions PORTC pins

EE3414 – MPMC LABORATORY Page | 94


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 95


DEPARTMENT OF EEE

have Schmitt Trigger input buffers. When the I2C module is enabled, the PORTC<4:3>pins
can be configured with normal I2C levels, or with SM Bus levels, by using the CKE bit
(SSPSTAT<6>).When enabling peripheral functions, care should be taken in defining TRIS
bits for each PORTC pin. Some peripherals override the TRIS bit to make a pin an output,
while other peripherals override the TRIS bit to make a pin an input.

Since the TRIS bit override is in effect while the peripheral is enabled, read-modify write
instructions (BSF, BCF, XOR WF) with TRISC as the destination, should be avoided. The
user should refer to corresponding peripheral section for the correct TRIS bit settings.

PORTD (Pin 19to22 and pin 27to30) and TRISD register: PORTD is an 8-bit port with
Schmitt Trigger input buffers. Each pin is individually configurable as an input or output.

PORTD can be configured as an 8-bit wide microprocessor port (Parallel Slave Port) by
setting control bit, PSPMODE (TRISE<4>). In this mode, the input buffers are TTL.

PORTE (Pin8 to 10) and TRISE register: PORTE has three pins (RE0/RD/AN5,
RE1/WR/AN6 and RE2/CS/AN7) which are individually configurable as inputs or outputs.

These pins have Schmitt Trigger input buffers. The PORTE pins become the I/O control
inputs for the microprocessor port when bit PSPMODE (TRISE<4>) is set. In this mode, the
user must make certain that the TRISE<2:0> bits are set and that the pins are configured as
digital inputs.

Also, ensure that ADCON1 is configured for digital I/O. In this mode, the input buffers are
TTL. PORTE pins are multiplexed with analog inputs. When selected for analog input, these
pins will read as ‘0’s.

RESULT:

Thus the study of PIC processor has been done and ensured its composition with internal
features specifically.

EE3414 – MPMC LABORATORY Page | 96


DEPARTMENT OF EEE

PROGRAM:

MOV TMOD,#10h ; To select timer1 & mode1 operation


L1: MOV TL1,#LOWERORDER BYTE OF THE COUNT
MOV TH1,#HIGHER ORDER BYTE OF THE COUNT
SETB TR1 ; to start the timer (TCON.6)
BACK: JNB TF1,BACK ; checking the status of timerflag1(TCON.7) for
overflow
CPL Px.x ; get the square wave through any of the portpins
; eg. P1.2 (second bit of Port 1)
CLR TR1 ; stop timer
CLR TF1 ; clear timer flag for the next cycle
SJMP L1
b) Program to transfer a data serially from one kit to another.
Transmitter:
MOV TMOD,#20H ; Mode word to select timer1 & mode 2
MOV TL1,#FDH ; Initialize timer1 with the count
MOV TH1,#FFH
MOV SCON,#50H ; Control word for serial communication to
to select serial mode1
SETB TR1 ; Start timer1
MOV A,#06h
MOV SBUF,A ; Transfer the byte to be transmitted to serial
Buffer register.
LOOP: JNB TI, LOOP ; checking the status of Transmit interrupt
flag
CLR TI
HERE: SJMP HERE
Receiver:
MOV TMOD,#20H
MOV TL1,#FDH
MOV TH1,#FFH
MOV SCON,#50H
SETB TR1
LOOP: JNB RI,LOOP
MOV A,SBUF
MOV DPTR,#4500H
MOVX @DPTR,A
CLR RI
HERE: SJMP HERE

EE3414 – MPMC LABORATORY Page | 97


DEPARTMENT OF EEE

Exp.No:
PROGRAMS TO VERIFY TIMER AND INTERRUPTS OPERATIONS IN
Date : 8051 MICROCONTROLLER

AIM:

To write a program to generate a square wave of frequency, transfer a data serially from one
kit to another and to verify the result.

APPARATUS REQUIRED:

8051 microcontroller kit, key board.

a) Program to generate a square wave of frequency.

Steps to determine the count:

Let the frequency of square wave to be generated be Fs KHz.

And the time period of the square wave be Ts Sec.

Oscillator Frequency = 11.0592MHz.

One machine cycle = 12 clock periods

Time taken to complete one machine cycle=12*(1/11.0592MHz)= 1.085microsec.

Y(dec) = (Ts/2)/(1.085microsec)

Count(dec) = 65536(dec) – Y(dec)

= Count(hexa)

Result:

Thus to generate a square wave of frequency, transfer a data serially from one kit to another and
also the result is verified.

EE3414 – MPMC LABORATORY Page | 98


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 99


DEPARTMENT OF EEE

Exp.No:
STUDY OF ARM PROCESSOR
Date :

AIM:
To study of ARM processor system and describe the features of architecture.
ARCHITECTURE OF ARM PROCESSOR:
1.1. Features of ARM DEVELOPMENT KIT Processor:
 16-bit/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package.8 kb to 40 kb of on-
chip static RAM and 32 kb to 512 kb of on-chip flash memory. 128-bit wide
interface/accelerator enables high-speed 60 MHz operation. In-System/In-Application
Programming (ISP/IAP) via on-chip boot loader software.
 Single flash sector/full chip erase in 400 ms and programming of 256 bytes in 1ms.USB 2.0
Full-speed compliant device controller with 2 Kb of endpoint RAM. The LPC2146/48
provides 8 Kb of on-chip RAM accessible to USB by DMA.
 One or two (LPC2141/42 vs. LPC2144/46/48) 10-bit ADCs provide a total of 6/14 analog
inputs, with conversion times as low as 2.44 μs per channel. Single 10-bit DAC provides
variable analog output (LPC2142/44/46/48 only).Two 32-bit timers/external event counters
(with four capture and four compare channels each), PWM unit (six outputs) and watchdog.
 Low power Real-Time Clock (RTC) with independent power and 32 kHz clock input.
Multiple serial interfaces including two UARTs (16C550), two Fast I2Cbus (400 kbit/s), SPI
and SSP with buffering and variable data length capabilities.
 Vectored Interrupt Controller (VIC) with configurable priorities and vector addresses. Up to
45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package. Up to 21 external
interrupt pins available.
 60MHz maximum CPU clock available from programmable on-chip PLL with settling time
of 100μs.On-chip integrated oscillator operates with an external crystal from 1 MHz to 25
MHz. Power saving modes include Idle and Power down.
 Individual enable/disable of peripheral functions as well as peripheral clock scaling for
additional power optimization. Processor wake-up from Power-down mode via external
interrupt or BOD. Single power supply chip with POR and BOD circuits: CPU operating
voltage range of 3.0 V to 3.6 V (3.3 V ± 10 %) with 5 V

EE3414 – MPMC LABORATORY Page | 100


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 101


DEPARTMENT OF EEE

1.2. Power Supply:


 The external power can be AC or DC, with a voltage between (9V/12V, 1A output) at
230V AC input. The ARM board produces +5V using an LM7805 voltage regulator,
which provides supply to the peripherals.
 LM1117 Fixed +3.3V positive regulator used for processor & processor related
peripherals.
1.3. Flash Programming Utility
 NXP (Philips)
NXP Semiconductors produce a range of Microcontrollers that feature both on-chip Flash
memory and the ability to be reprogrammed using In-System Programming technology.
1.4. On-board Peripherals:
8-Nos. of Point LED’s (Digital Outputs)
8-Nos. of Digital Inputs (slide switch)
2 Lines X 16 Character LCD Display
I2C Enabled 4 Digit Seven-segment display
128x64 Graphical LCD Display
4 X 4 Matrix keypad
Stepper Motor Interface
2 Nos. Relay Interface
Two UART for serial port communication through PC
Serial EEPROM
On-chip Real Time Clock with battery backup
PS/2 Keyboard interface(Optional)
Temperature Sensor
Buzzer(Alarm Interface)
Traffic Light Module(Optional)

RESULT:

Thus the study of ARM processor has been done and ensured its composition with internal features
specifically.

EE3414 – MPMC LABORATORY Page | 102


DEPARTMENT OF EEE

EE3414 – MPMC LABORATORY Page | 103

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