DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING
--- Content provided by FirstRanker.com ---
EC6513 - MICROPROCESSOR AND MICROCONTROLLERLABORATORY
V SEMESTER - R 2013
LABORATORY MANUAL
Name : _________________________________________________
Register No. : _________________________________________________
--- Content provided by FirstRanker.com ---
Section : _________________________________________________
EC6513 - MICROPROCESSOR AND MICROCONTROLLER LABORATORY
COURSE OBJECTIVES
C01 - To learn the working of ARM processor
C02 - To introduce ALP concepts and features
--- Content provided by FirstRanker.com ---
C03 - To write ALP for arithmetic and logical operations in 8086 and 8051
C04 - To differentiate Serial and Parallel Interface
C05 - To interface different I/Os with Microprocessors
C06 - To be familiar with MASM
COURSE OUTCOMES
--- Content provided by FirstRanker.com ---
- Write programs in ARM for a specific Application
- Write ALP Programs for fixed and Floating Point and Arithmetic
- Interface different I/Os with processor and Generate waveforms using Microprocessors
- Execute Programs in 8051
- Assess the performance of optical devices: light sources, fibers and detectors from both physical and system point of view
--- Content provided by FirstRanker.com ---
INTRODUCTION
This course illustrates the concepts covered in course CS6412 and provides students with hands-on experience in Assembly language programs.
PREREQUISITE:
- Digital Electronics
EC6513 – MICROPROCESSOR AND MICROCONTROLLER LABORATORY
--- Content provided by FirstRanker.com ---
Lecture No./Session No. | Name of the Experiment | Course objectives | Proposed date |
---|---|---|---|
1,2,3 | Introduction to lab | CO1 |
CYCLE I-8086 PROGRAMS USING KITS AND MASM
4,5,6 | Basic arithmetic and Logical operations | CO2 |
7,8,9 | Decimal arithmetic and Code conversion | CO3 | ||
10,11,12 | Move a data block without overlap | CO3 | ||
13,14,15 | Matrix operations | Searching and Sorting a string in a given array | CO2 |
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS
16,17,18 | D/A interface and Waveform Generation | CO4 | |
19,20,21 | A/D interface | CO5 | |
22,23,24 | Key board and Display | CO5 | |
25,26,27 | Stepper motor control | CO2 | |
Traffic light control | CO5 | ||
28,29,30 | Digital clock | CO6 | |
Serial interface and Parallel interface | CO4 |
CYCLE III - 8051 PROGRAMS USING KITS AND MASM
31,32,33 | Basic arithmetic and Logical operations | CO1 | ||
34,35,36 | Square and Cube program, Find 2's complement of a number | Unpacked BCD to ASCII | CO5 | |
37,38,39 | Password checking and Print RAM size with system date | Counters and Time Delay | CO6 |
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS
40,41,42 | Sorting of an array using 8051 | CO2 | ||
43,44,45 | Separate odd and even numbers using 8086 | Sum of N consecutive numbers using 8086 | CO3 |
VISION
--- Content provided by FirstRanker.com ---
College of Engineering is committed to provide highly disciplined, conscientious and enterprising professionals conforming to global standards through value based quality education and training.
MISSION
- To provide competent technical manpower capable of meeting requirements of the industry
- To contribute to the promotion of Academic Excellence in pursuit of Technical Education at different levels
- To train the students to sell his brawn and brain to the highest bidder but to never put a price tag on heart and soul
--- Content provided by FirstRanker.com ---
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
VISION
To impart professional education integrated with human values to the younger generation, so as to shape them as proficient and dedicated engineers, capable of providing comprehensive solutions to the challenges in deploying technology for the service of humanity
MISSION
- To educate the students with the state-of-art technologies to meet the growing challenges of the electronics industry
- To carry out research through continuous interaction with research institutes and industry, on advances in communication systems
- To provide the students with strong ground rules to facilitate them for systematic learning, innovation and ethical practices
--- Content provided by FirstRanker.com ---
PROGRAMME EDUCATIONAL OBJECTIVES (PEOS)
- Fundamentals
To impart students with fundamental knowledge in Mathematics, Science and fundamentals of engineering that will would them to be successful professionals
- Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify complex software problems in industry and to develop practical solution for them
- Breadth
To provide relevant training and experience to bridge the gap between theory and practice this enables to find solutions for real time problem in industry and organization and to design products requiring interdisciplinary skills
- Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will build up their communication skills, individual leadership and supportive qualities and to develop them to adapt and work in ever changing technologies
--- Content provided by FirstRanker.com ---
- Lifelong Learning
To develop the ability of students to establish themselves as professionals in Computer Science and Engineering and to create awareness about the need for lifelong learning and pursuing advanced degrees
--- Content provided by FirstRanker.com ---
PROGRAMME OUTCOMES (POS)
- To apply basic knowledge of Mathematics, Science and Engineering fundamentals in Computer Science and Engineering field
- To design and conduct experiments as well as to analyze and interpret and apply the same in the career
- To design and develop innovative and creative software applications
- To understand a complex real world problems and develop an efficient practical solutions
- To create, select and apply appropriate technique, resources, modern engineering and IT tools
- To understand their roles as professionals and give the best to the society
- To develop a system that will meet expected need with realistic constraints such as economical, environmental, social, political, ethical, safe and sustainable
- To communicate effectively and make others understand exactly what they are trying to convey in both verbal and written forms
- To work in a team as team member or a leader and make unique contributions and work with coordination
- To engage lifelong learning and exhibit their technical skills
- To develop and manage projects in multidisciplinary environments
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
EC6513 - MICROPROCESSOR AND MICROCONTROLLER LABORATORY
LABORATORY SYLLABUS
COURSE OBJECTIVES
- To learn the working of ARM processor
- To introduce ALP concepts and features
- To write ALP for arithmetic and logical operations in 8086 and 8051
- To differentiate Serial and Parallel Interface
- To interface different I/Os with Microprocessors
- To be familiar with MASM
--- Content provided by FirstRanker.com ---
LIST OF EXPERIMENTS:
--- Content provided by FirstRanker.com ---
8086 Programs using kits and MASM
- Basic arithmetic and Logical operations
- Move a data block without overlap
- Code conversion, decimal arithmetic and Matrix operations.
- Floating point operations, string manipulations, sorting and searching
- Password checking, Print RAM size and system date
- Counters and Time Delay
--- Content provided by FirstRanker.com ---
Peripherals and Interfacing Experiments
- Traffic light control
- Stepper motor control
- Digital clock
- Key board and Display
- Printer status
- Serial interface and Parallel interface
- A/D and D/A interface and Waveform Generation 8051
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
Experiments using kits and MASM
- Basic arithmetic and Logical operations
- Square and Cube program, Find 2"s complement of a number
- Unpacked BCD to ASCII
COURSE OUTCOMES
--- Content provided by FirstRanker.com ---
- Write programs in ARM for a specific Application
- Write ALP Programs for fixed and Floating Point and Arithmetic
- Interface different I/Os with processor and Generate waveforms using Microprocessors
- Execute Programs in 8051
- Assess the performance of optical devices: light sources, fibers and detectors from both physical and system point of view
--- Content provided by FirstRanker.com ---
EC6513 - MICROPROCESSOR AND MICROCONTROLLER LABORATORY
CONTENTS
Sl. No. | Name of the Experiment | Page No. |
---|---|---|
CYCLE 1-8086 PROGRAMS USING KITS AND MASM | ||
1 | Basic arithmetic and Logical operations | 10 |
2 | Decimal arithmetic and Code conversion | 15 |
3 | Move a data block without overlap | 21 |
4 | Matrix operations | 24 |
5 | Searching and Sorting a string in a given array | 27 |
6 | Password checking and Print RAM size with system date | 33 |
7 | Counters and Time Delay | 36 |
CYCLE 2 - PERIPHERALS AND INTERFACING EXPERIMENTS | ||
8 | Stepper motor control | 39 |
9 | Traffic light control | 42 |
10 | Digital clock | 47 |
11 | Serial interface and Parallel interface | 50 |
12 | A/D interface | 54 |
13 | Key board and Display | 57 |
14 | D/A interface and Waveform Generation | 60 |
CYCLE 3-8051 PROGRAMS USING KITS AND MASM | ||
15 | Basic arithmetic and Logical operations | 64 |
16 | Square and Cube program, Find 2's complement of a number | 69 |
17 | Unpacked BCD to ASCII | 71 |
ADDITIONAL EXPERIMENTS BEYOND THE SYLLABUS | ||
18 | Sorting of an array using 8051 | 74 |
19 | Separate odd and even numbers using 8086 | 77 |
20 | Sum of N consecutive numbers using 8086 | 80 |
Expt.No.1 BASIC ARITHMETIC AND LOGICAL OPERATIONS
Aim:
To write an Assembly Language Program to perform Arithmetic operation and to execute using 8086 microprocessor
--- Content provided by FirstRanker.com ---
Apparatus required:
- 8086 Kit
- Power cable
- Keyboard
Procedure:
--- Content provided by FirstRanker.com ---
To enter program in Trainer Kit
- Press ‘RESET' key
- Press 'A(Address)' key
- Press "Enter" key
- Enter the starting address (16 bit)
- Press “Enter” key
- Type the Assembly Language Program
- Press ‘RESET' key
--- Content provided by FirstRanker.com ---
To executive the program
- Press "GO"
- Type the starting address to execute the program
- Press 'RESET' key
--- Content provided by FirstRanker.com ---
To verify the result
- Type "SB(Substitute Byte)”
- Enter the output address location to check the result
--- Content provided by FirstRanker.com ---
Arithmetic Operation:
- Addition:
Algorithm:
- Clear BL register to store carry
- Get the addend in AX register pair
- Get the Augend in CX register pair
- Add Augend and addend
- Check for carry, If it is one go to step 6 else go to step 7
- Increments carry (BL register by 1)
- Store the sum in memory from AX register pair
- Store the carry in memory from BL register
- Stop
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
Program:
Address | Label | Mnemonics |
---|---|---|
1000 | MOV BL, 00H | |
1003 | MOV AX, 1010H | |
1007 | MOV CX, 2020H | |
100B | CLC | |
100C | ADD AX, CX | |
100E | JNC Label1 | |
1010 | INC BL | |
1012 | Label 1 | MOV [1200], AX |
1016 | MOV [1202], BL | |
101A | HLT |
Precaution:
Make sure that all the machine codes should be as per the specified in the program.
--- Content provided by FirstRanker.com ---
Tabulation:
Input | Output | ||
---|---|---|---|
Address | Data | Address | Data |
- Subtraction:
Algorithm:
- Clear BL register for storing borrow
- Get the minuend in AX register pair
- Get the subtrahend in CX register pair
- Subtract minuend and subtrahend
- Check borrow, if borrow is one go to step 6 else go to step 8
- Increment borrow (BL register by 1)
- Negate AX register
- Store the difference from AX in memory
- Story the borrow from BL in memory
- Stop
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
Program:
Address | Label | Mnemonics |
---|---|---|
1000 | MOV BL, 00H | |
1003 | MOV AX, 2024H | |
1007 | MOV CX, 1010H | |
100B | SUB AX, CX | |
100D | JNC Label1 | |
100F | INC BL | |
1011 | NEG AX | |
1013 | Label 1 | MOV [1200], AX |
1017 | MOV [1202], BL | |
101B | HLT |
Tabulation:
--- Content provided by FirstRanker.com ---
Input | Output | ||
---|---|---|---|
Address | Data | Address | Data |
- Multiplication
Algorithm:
- Clear DX register
- Load the AX register pair with multiplicand
- Load the CX register pair with multiplier
- Multiply multiplicand and multiplier
- Store the higher byte of product(from DX register pair) in memory specified
- Store the lower byte of product(from AX register pair) in memory specified
- Stop
--- Content provided by FirstRanker.com ---
Program:
--- Content provided by FirstRanker.com ---
Address | Label | Mnemonics |
---|---|---|
1000 | MOV DX, 0000H | |
1004 | MOV AX, 00FFH | |
1008 | MOV CX, 0002H | |
100C | MUL CX | |
100E | MOV [1200], AX | |
1012 | MOV [1202], DX | |
1016 | HLT |
Tabulation:
Input | Output | ||
---|---|---|---|
Address | Data | Address | Data |
- Division:
Algorithm
- Clear DX register
- Load the AX register pair with dividend
- Load the CX register pair with divisor
- Dividend divided by divisor
- Store the quotient (from AX register pair) in memory specified
- Store the remainder (from DX register pair) in memory specified
- Stop
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
Program:
Address | Label | Mnemonics |
---|---|---|
1000 | MOV DX, 0000H | |
1004 | MOV AX, 0008H | |
1008 | MOV CX, 0004H | |
100C | DIV CX | |
100E | MOV [1200], AX | |
1012 | MOV [1202], DX | |
1016 | HLT |
Tabulation:
Input | Output | ||
---|---|---|---|
Address | Data | Address | Data |
Result:
Thus Assembly language program are written to perform arithmetic operation using 8086 microprocessor. They are executed using 8086 processor and the outputs are verified.
Outcome:
--- Content provided by FirstRanker.com ---
At the end of this experiment the students able to write ALP programs for Arithmetic and Logical operations.
Viva – voce
- Write the size of the data bus of 8086.
- Write the size of the address bus of 8086.
- What is meant by physical addressing in 8086?
- What is meant by an Opcode?
- What is meant by an Operand?
- What is meant by a Mnemonics?
- What are the other possibilities of writing ADD, SUB and MUL instructions in other addressing modes?
- What is the difference between microprocessor and microcontroller?
- What is meant by LATCH?
- What is the difference between primary & secondary storage device?
- What is the difference between static and dynamic RAM?
- What is an interrupt?
- Differentiate between RAM and ROM?
- Define - Compiler
- Define - Flag
- Define - Stack
- How clock signal is generated in 8086 microprocessor?
- State the functions of queue status line QS0 and QS1 in 8086 microprocessor.
- What is the purpose of BIU& EU?
- List out the two examples of assembler directives.
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
Applications:
- barrel shifters
- Multiple-precision arithmetic
- Calculation pipeline
- binary multipliers
- Calculation in a single clock
--- Content provided by FirstRanker.com ---
Expt.No.2 DECIMAL ARITHMETIC AND CODE CONVERSION
Aim:
--- Content provided by FirstRanker.com ---
To write an Assembly Language Program to perform Code conversion and Decimal Arithmetic operations and to execute using 8086 microprocessor
Apparatus required:
- 8086 Kit
- Power cable
- Keyboard
--- Content provided by FirstRanker.com ---
Procedure:
To enter program in Trainer Kit
- Press 'RESET' key
- Press 'A(Address)' key
- Press “Enter” key
- Enter the starting address (16 bit)
- Press “Enter” key
- Type the Assembly Language Program
- Press ‘RESET' key
--- Content provided by FirstRanker.com ---
To executive the program
--- Content provided by FirstRanker.com ---
- Press "GO"
- Type the starting address to execute the program
- Press ‘RESET' key
To verify the result
- Type "SB(Substitute Byte)”
- Enter the output address location to check the result
--- Content provided by FirstRanker.com ---
Decimal Arithmetic:
- Using DAA
Algorithm:
- Get the first input and store in AL.
- Get the second input and store in BL.
- Clear the CL reg.
- Add the contents of AL and BL.
- Adjust decimal accumulator after addition.
- Store the result.
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
Program:
Address | Label | Mnemonics |
---|---|---|
1000 | MOV AL, [1100] | |
1004 | MOV BL, [1101] | |
1008 | MOV CL, 00 | |
100B | ADD AL,BL | |
100D | DAA | |
100E | JNC L1 | |
1010 | INC CL | |
1012 | L1 | MOV [1150], AL |
1016 | MOV [1151], CL | |
101A | HLT |
Tabulation:
Input | Output | ||
---|---|---|---|
Address | Data | Address | Data |
- Using AAM
Algorithm:
- Get the first input and store in AL.
- Get the second input and store in BL.
- Multiply the contents of AL and BL.
- Adjust decimal accumulator after multiplication.
- Store the result.
--- Content provided by FirstRanker.com ---
Program:
--- Content provided by FirstRanker.com ---
Address | Label | Mnemonics |
---|---|---|
1000 | MOV AL, [1100] | |
1004 | MOV BL, [1101] | |
1008 | MUL BL | |
100A | AAM | |
100C | MOV [1150], AH | |
1010 | MOV [1151], AL | |
1014 | HLT |
Input | Output | ||
---|---|---|---|
Address | Data | Address | Data |
- Using DAS
Algorithm:
- Get the first input and store in AL.
- Get the second input and store in BL.
- Subtract the contents of BL from AL.
- Adjust decimal accumulator after subtraction.
- Store the result.
--- Content provided by FirstRanker.com ---
Program:
Address | Label | Mnemonics |
---|---|---|
1000 | MOV AL, [1100] | |
1004 | MOV BL, [1101] | |
1008 | SUB AL, BL | |
100A | DAS | |
100B | MOV [1150], AL | |
100F | HLT |
Tabulation:
Input | Output | ||
---|---|---|---|
Address | Data | Address | Data |
Code Conversion:
--- Content provided by FirstRanker.com ---
- Binary to BCD
Algorithm:
- Get the input and store in AL.
- Clear the carry flag.
- Rotate right the bits of input.
- Find logical XOR between input and shifted input.
- Store the result.
--- Content provided by FirstRanker.com ---
Program:
Address | Label | Mnemonics |
---|