8051 programs with opcode

Download 8051 Programs With Opcode

Post on 08-Oct-2015

78 views

Category:

Documents

3 download

Embed Size (px)

DESCRIPTION

8051 noites

TRANSCRIPT

  • SRINIVASAN ENGINEERING COLLEGE

    DEPT OF ELECTRONICS AND COMMUNICATION ENGINEERING

    ANNA UNIVERSITY CHENNAI

    REGULATION 2008

    III YEAR/ V SEMESTER

    EC 2308 MICROPROCESSOR AND MICROCONTROLLER LABORATORY

    LAB MANUAL

    ISSUE: 01 REVISION:00

    APPROVED BY PREPARED BY

    Prof. B. REVATHI K.VIJAYA KANTH, Assistant Professor.

    HOD/ECE R.SIVAGAMY, Assistant Professor.

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 2

    Preface

    This laboratory manual is prepared by the Department of Electronics and communication

    engineering for microprocessor and microcontroller lab (EC 2308). This lab manual can be used as

    instructional book for students, staff and instructors to assist in performing and understanding the

    experiments. This manual will be available in electronic form from Colleges official website, for

    the betterment of students.

    Acknowledgement

    We would like to express our profound gratitude and deep regards to the support offered

    by the Chairman Shri. A.Srinivasan. We also take this opportunity to express a deep sense of

    gratitude to our Principal Dr.B.Karthikeyan,M.E, Ph.D, for his valuable information and

    guidance, which helped us in completing this task through various stages. We extend our hearty

    thanks to our head of the department Prof.B.Revathi M.E, (Ph.D), for her constant

    encouragement and constructive comments.

    Finally the valuable comments from fellow faculty and assistance provided by the

    department are highly acknowledged.

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 3

    INDEX

    S.No TOPIC PAGE

    NO

    1 Syllabus 5

    2 Lab Course Handout 6

    3 Experiments

    1. Programs for addition and subtraction of two numbers using 8086 9

    2. Programs for multiplication and division of two numbers using 8086 13

    3. Programs to sort the numbers in ascending and descending order using 8086 17

    4. Programs to find largest and smallest numbers using 8086 21

    5. Programs to copy the string form source to destination 25

    6. Programs to find and replace the string in memory 28

    7. Programs for interfacing analog to digital converter

    31

    8. Programs for interfacing digital to analog converter

    34

    9. Programs to interface the stepper motor 40

    10. Program to interface the programmable keyboard and display controller 43

    11. Program for interfacing programmable timer 47

    12. Program for interfacing USART 51

    13. Program for interfacing PPI 55

    14. Program for 8 bit addition of two numbers using 8051

    59

    15. Program for 8 bit subtraction of two numbers using 8051

    62

    16. Program for 8 bit multiplication of two numbers using 8051

    64

    17. Program for 8 bit division of two numbers using 8051

    66

    18. Programs for bit manipulation using 8051

    68

    19. Programs for digital clock and stop watch (using 8086)

    70

    20. Programs to verify timer, interrupts & uart operations in 8031 72

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 4

    microcontroller

    21. Communication between 8051 microcontroller

    Kit & pc

    75

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 5

    SYLLABUS

    EC2308 MICROPROCESSOR AND MICROCONTROLLER LAB

    1. Programs for 16 bit Arithmetic operations (Using 8086). 2. Programs for Sorting and Searching (Using 8086). 3. Programs for String manipulation operations (Using 8086). 4. Programs for Digital clock and Stop watch (Using 8086). 5. Interfacing ADC and DAC. 6. Parallel Communication between two MP Kits using Mode 1 and Mode 2 of

    8255.

    7. Interfacing and Programming 8279, 8259, and 8253. 8. Serial Communication between two MP Kits using 8251. 9. Interfacing and Programming of Stepper Motor and DC Motor Speed

    control.

    10. Programming using Arithmetic, Logical and Bit Manipulation instructions of 8051 microcontroller.

    11. Programming and verifying Timer, Interrupts and UART operations in 8051 microcontroller.

    12. Communication between 8051 Microcontroller kit and P C.

    LIST OF EQUIPMENTS

    (For a batch of 30 students)

    Sl. No. Description of Equipments Quantity

    1. 8086 Trainer 15 2. 8051 Trainer 15 3. 8255 Interfacing Card 3 4. 8279 Interfacing Card 3 5. 8259 Interfacing card 3 6. 8251 Interfacing Card 3 7. ADC Interfacing card 3 8. DAC Interfacing Card 3 9. Stepper motor Interfacing card 3

    10. DC motor Interfacing card 3

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 6

    LAB COURSE HANDOUT

    Subject code : EC 2308

    Subject Title : Microprocessor and Microcontroller lab

    Staff name : K.Vijaya kanth & R.Sivagamy

    Scope and Objective of the Subject:

    To write the program in microprocessor and in microcontroller for various operations like arithmetic and interfacing.

    Course Plan / Schedule:

    S.No Topics to be covered Learning objectives Page

    No*

    No. of

    hours

    1 Programs for 16 bit Arithmetic operations

    using 8086

    To write the assembly language

    program for addition, subtraction ,

    multiplication and division using

    8086

    9 3 hrs

    2 Programs for Sorting and Searching Using

    8086

    To write the assembly language

    program to arrange the numbers in

    ascending or in descending order

    17 3hrs

    3 Programs for String manipulation operations To write the assembly language

    program to copy a string 25 3hrs

    4 Interfacing ADC and DAC To write the assembly language

    program to convert the analog value

    into digital and vice versa

    31 3hrs

    5 Interfacing and Programming of Stepper

    Motor and DC Motor Speed control

    To write the interface program for

    controlling the stepper motor 40 3hrs

    6 Interfacing and Programming 8279, 8259, and

    8253

    To write the interface program for

    keyboard interface, display

    controller

    43 3hrs

    7 Serial Communication between two MP Kits

    using 8251

    To write the interface program for

    serial communication between two

    microprocessor

    51 3hrs

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 7

    8 Parallel Communication between two MP

    Kits using Mode 1 and Mode 2 of 8255

    To write the interfacing program for

    the parallel communication between

    two microprocessor

    51 3hrs

    9 Programming using Arithmetic, Logical and

    Bit Manipulation instructions of 8051

    microcontroller

    To write the program for addition,

    subtraction , multiplication and

    division using 8051 microcontroller

    66 3hrs

    10 Programming and verifying Timer, Interrupts

    and UART operations in 8051 microcontroller

    To write the program for interrupts,

    timer using 8051 68 3hrs

    11 Programs for Digital clock and Stop watch To write the assembly language

    program for displaying the timer 70 3hrs

    12 Communication between 8051

    Microcontroller kit and P C

    To write the program for

    communication between

    microcontroller and c