8051 programs with opcode

Upload: maddy-trichy

Post on 08-Oct-2015

311 views

Category:

Documents


21 download

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 computer

    75 3hrs

    *-As in Lab Manual

    Evaluation scheme Internal Assessment

    Timings for chamber consultation: Students should contact the Course Instructor in her/his

    chamber during lunch break.

    EC

    No.

    Evaluation

    Components

    Duration Weightage

    1 Observation Continuous 20%

    2 Record Continuous 30%

    3 Attendance Continuous 30%

    4 Model lab 3hr 20%

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 8

    STUDENTS GUIDELINES

    There are 3 hours allocated to a laboratory session in Microprocessor and microcontroller lab.

    It is a necessary part of the course at which attendance is compulsory.

    Here are some guidelines to help you perform the Programs and to submit the reports:

    1. Read all instructions carefully and proceed according to that.

    2. Ask the faculty if you are unsure of any concept.

    3. Write the program, and give connections.

    4. Get the output from the kit.

    5. Write up full and suitable conclusions for each experiment.

    6. After completing the experiment complete the observation and get signature from the

    staff.

    7. Before coming to next lab make sure that you complete the record and get sign from the

    faculty.

    STAFF SIGNATURE HOD

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 9

    8086 PROGRAMMING

    ADDITION & SUBTRACTION

    AIM:

    To write an Assembly Language Program (ALP) for performing the addition and subtraction

    operation of two byte numbers.

    APPARATUS REQUIRED:

    8086 trainer kit

    ALGORITHM:

    (i) 16-bit addition

    Initialize the MSBs of sum to 0

    Get the first number.

    Add the second number to the first number.

    If there is any carry, increment MSBs of sum by 1.

    Store LSBs of sum.

    Store MSBs of sum.

    (ii) 16-bit subtraction

    Initialize the MSBs of difference to 0

    Get the first number

    Subtract the second number from the first number.

    If there is any borrow, increment MSBs of difference by 1.

    Store LSBs of difference

    Store MSBs of difference.

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 10

    FLOW CHART

    ADDITION SUBTRACTION

    START

    SET UP COUNTER (CY)

    GET SECOND OPERAND TO A

    A = A + B

    STORE THE SUM

    IS THERE ANY

    CARRY

    GET FIRST OPERAND

    COUNTER =

    COUNTER + 1

    STORE THE CARRY

    STOP

    YES

    NO

    START

    GET FIRST OPERAND

    TO A

    SUBTRACT

    SECOND OPERAND

    FROM MEMORY

    STORE THE

    DIFFERENCE

    STOP

    SET UP COUNTER (CARRY)

    IS THERE ANY

    CY

    COUNTER =

    COUNTER + 1

    STORE THE CARRY

    NO

    YES

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 11

    ADDITION

    SUBTRACTION

    PROGRAM COMMENTS

    MOV CX, 0000H Initialize counter CX

    MOV AX,[1200] Get the first data in AX reg

    MOV BX, [1202] Get the second data in BX reg

    ADD AX,BX Add the contents of both the regs AX & BX

    JNC L1 Check for carry

    INC CX If carry exists, increment the CX

    L1 : MOV [1206],CX Store the carry

    MOV [1204], AX Store the sum

    HLT Stop the program

    PROGRAM COMMENTS

    MOV CX, 0000H Initialize counter CX

    MOV AX,[1200] Get the first data in AX reg

    MOV BX, [1202] Get the second data in BX reg

    SUB AX,BX Subtract the contents of BX from AX

    JNC L1 Check for borrow

    INC CX If borrow exists, increment the CX

    L1 : MOV [1206],CX Store the borrow

    MOV [1204], AX Store the difference

    HLT Stop the program

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 12

    RESULT:

    Thus the program for 16-bit addition and subtraction was verified

    VIVA QUESTIONS:

    1. What is Microprocessor ?

    It is a program controlled semiconductor device (IC}, which fetches, decode and executes

    instructions.

    2. What is assembly language?

    The language in which the mnemonics (short -hand form of instructions) are used to write a

    program is called assembly language. The manufacturers of microprocessor give the mnemonics

    3. Define bit, byte and word.

    A digit of the binary number or code is called bit. Also, the bit is the fundamental storage unit of

    computer memory. The 8-bit (8-digit) binary number or code is called byte and 16-bit

    binary number or code is called word. (Some microprocessor manufactures refer the basic data

    size operated by the processor as word)

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 13

    8086 PROGRAMMING

    MULTIPLICATION & DIVISION

    AIM:

    To write an Assembly Language Program (ALP) for performing the multiplication and division

    operation of 16-bit numbers.

    APPARATUS REQUIRED:

    8086 TRAINER KIT

    ALGORITHM:

    (i) MULTIPLICATION OF 16-BIT NUMBERS:

    Get the multiplier.

    Get the multiplicand

    Initialize the product to 0.

    Product = product + multiplicand

    Decrement the multiplier by 1

    If multiplicand is not equal to 0,repeat from step (d) otherwise store the product.

    (ii) DIVISION OF 16-BIT NUMBERS.

    Get the dividend

    Get the divisor

    Initialize the quotient to 0.

    Dividend = dividend divisor

    If the divisor is greater, store the quotient. Go to step g.

    If dividend is greater, quotient = quotient + 1. Repeat from step (d)

    Store the dividend value as remainder.

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 14

    FLOW CHART

    MULTIPLICATION DIVISION

    NO

    YES

    Start

    Get Multiplier & Multiplicand

    REGISTER=0

    0

    REGISTER = REGISTER

    + MULTIPLICAND

    Multiplier=MUL

    TIPLIER 1

    MULTIPLIER

    IS

    =0?

    NO

    YES

    STOP

    STORE THE RESULT

    Start

    Load Divisor &

    Dividend

    QUOTIENT = 0

    DIVIDEND =

    DIVIDEND-DIVISOR

    QUOTIENT = QUOTIENT+1

    STORE QUOTIENT

    STORE REMAINDER

    = DIVIDEND NOW

    IS

    DIVIDEND

    < DIVISOR

    DIVISOR

    STOP

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 15

    MULTIPLICATION

    PROGRAM COMMENTS

    MOV AX,[1200] Get the first data

    MOV BX, [1202] Get the second data

    MUL BX Multiply both

    MOV [1206],AX Store the lower order product

    MOV AX,DX Copy the higher order product to AX

    MOV [1208],AX Store the higher order product

    HLT Stop the program

    DIVISION

    PROGRAM COMMENTS

    MOV AX,[1200] Get the first data

    MOV DX, [1202] Get the second data

    MOV BX, [1204] Divide the dividend by divisor

    DIV BX Store the lower order product

    MOV [1206],AX Copy the higher order product to AX

    MOV AX,DX Store the higher order product

    MOV [1208],AX Stop the program

    HLT Get the first data

    RESULT:

    Thus the program for 16-bit multiplication and division was verified

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 16

    VIVA QUESTIONS:

    1. What is the function of microprocessor in a system?

    The microprocessor is the master in the system, which controls all the activity of the system. It

    issues address and control signals and fetches the instruction and data from memory. Then it

    executes the instruction to take appropriate action.

    .

    2. Define mnemonics.

    The short-hand form of describing the instructions are called mnemonics. The mnemonics are

    given by the manufacturers of microprocessors and programmable devices.

    3. What is the need for timing diagram?

    The timing diagram provides information regarding the status of various signals, when a machine

    cycle is executed. The knowledge of timing diagram is essential for system designer to select

    matched peripheral devices like memories, latches, ports, etc., to form a

    microprocessor system

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 17

    8086 PROGRAMMING

    ASCENDING & DESCENDING

    AIM:

    To write an Assembly Language Program (ALP) to sort a given array in

    ascending and descending order.

    APPARATUS REQUIRED:

    8086 TRAINER KIT

    ALGORITHM:

    (i) SORTING IN ASCENDING ORDER:

    Load the array count in two registers C1 and C2.

    Get the first two numbers.

    Compare the numbers and exchange if necessary so that the two numbers are in ascending

    order.

    Decrement C2.

    Get the third number from the array and repeat the process until C2 is 0.

    Decrement C1 and repeat the process until C1 is 0.

    (ii) SORTING IN DESCENDING ORDER:

    Load the array count in two registers C1 and C2.

    Get the first two numbers.

    Compare the numbers and exchange if necessary so that the two numbers are in descending

    order.

    Decrement C2.

    Get the third number from the array and repeat the process until C2 is 0.

    Decrement C1 and repeat the process until C1 is 0.

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 18

    ASCENDING

    PROGRAM COMMENTS

    MOV SI,1200H Initialize memory location for array size

    MOV CL,[SI] Number of comparisons in CL

    L4 : MOV SI,1200H Initialize memory location for array size

    MOV DL,[SI] Get the count in DL

    INC SI Go to next memory location

    MOV AL,[SI] Get the first data in AL

    L3 : INC SI Go to next memory location

    MOV BL,[SI] Get the second data in BL

    CMP AL,BL Compare two datas

    JNB L1 If AL < BL go to L1

    DEC SI Else, Decrement the memory location

    MOV [SI],AL Store the smallest data

    MOV AL,BL Get the next data AL

    JMP L2 Jump to L2

    L1 : DEC SI Decrement the memory location

    MOV [SI],BL Store the greatest data in memory location

    L2 : INC SI Go to next memory location

    DEC DL Decrement the count

    JNZ L3 Jump to L3, if the count is not reached zero

    MOV [SI],AL Store data in memory location

    DEC CL Decrement the count

    JNZ L4 Jump to L4, if the count is not reached zero

    HLT Stop

    DESCENDING

    PROGRAM COMMENTS

    MOV SI,1200H Initialize memory location for array size

    MOV CL,[SI] Number of comparisons in CL

    L4 : MOV SI,1200H Initialize memory location for array size

    MOV DL,[SI] Get the count in DL

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 19

    INC SI Go to next memory location

    MOV AL,[SI] Get the first data in AL

    L3 : INC SI Go to next memory location

    MOV BL,[SI] Get the second data in BL

    CMP AL,BL Compare two datas

    JB L1 If AL > BL go to L1

    DEC SI Else, Decrement the memory location

    MOV [SI],AL Store the largest data

    MOV AL,BL Get the next data AL

    JMP L2 Jump to L2

    L1 : DEC SI Decrement the memory location

    MOV [SI],BL Store the smallest data in memory location

    L2 : INC SI Go to next memory location

    DEC DL Decrement the count

    JNZ L3 Jump to L3, if the count is not reached zero

    MOV [SI],AL Store data in memory location

    DEC CL Decrement the count

    JNZ L4 Jump to L4, if the count is not reached zero

    HLT Stop

    RESULT:

    Thus the program for sorting the data inascending and descending order was verified

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 20

    VIVA QUESTIONS:

    1. What are the modes in which 8086 can operate?

    The 8086 can operate in two modes and they are minimum ( or uniprocessor) mode and maximum

    ( or multiprocessor) mode.

    2. How clock signal is generated in 8086? What is the maximum internal

    clock frequency of 8086?

    The 8086 does not have on-chip clock generation circuit. Hence the clock generator chip, 8284 is

    connected to the CLK pin of8086. The clock signal supplied by 8284 is divided by three for

    internal use. The maximum internal clock frequency of8086 is 5MHz.

    3. What are the functional units available in 8086 architecture?

    The bus interface unit and execution unit are the two functional units available in 8086

    architecture.

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 21

    8086 PROGRAMMING

    LARGEST& SMALLEST

    AIM:

    To write an Assembly Language Program (ALP) to find the largest and

    smallest number in a given array.

    APPARATUS REQUIRED:

    8086 TRAINER KIT

    ALGORITHM:

    (i) FINDING LARGEST NUMBER:

    Load the array count in a register C1.

    Get the first two numbers.

    Compare the numbers and exchange if the number is small.

    Get the third number from the array and repeat the process until C1 is 0.

    (ii) FINDING SMALLEST NUMBER:

    Load the array count in a register C1.

    Get the first two numbers.

    Compare the numbers and exchange if the number is large.

    Get the third number from the array and repeat the process until C1 is 0.

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 22

    FLOW CHART

    LARGEST SMALLEST

    MAX = POINTER

    IS MAX

    POINTER ?

    INITIALIZE COUNT

    POINTER MAX = 0

    PONITER =

    POINTER + 1

    COUNT = COUNT-1

    STORE MAXIMUM

    IS COUNT = 0

    ?

    YES

    NO

    NO

    STOP

    START START

    INITIALIZE COUNT

    POINTER MIN = 0

    PONITER =

    POINTER + 1

    IS MIN

    POINTER ?

    MIN = POINTER

    COUNT = COUNT-1

    IS COUNT = 0

    ?

    STORE MINIIMUM

    STOP

    YES

    NO

    NO

    YES

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 23

    LARGEST

    PROGRAM COMMENTS

    MOV SI,1200H Initialize array size

    MOV CL,[SI] Initialize the count

    INC SI Go to next memory location

    MOV AL,[SI] Move the first data in AL

    DEC CL Reduce the count

    L2 : INC SI Move the SI pointer to next data

    CMP AL,[SI] Compare two datas

    JNB L1 If AL > [SI] then go to L1 ( no swap)

    MOV AL,[SI] Else move the large number to AL

    L1 : DEC CL Decrement the count

    JNZ L2 If count is not zero go to L2

    MOV DI,1300H Initialize DI with 1300H

    MOV [DI],AL Else store the biggest number in 1300 location

    HLT Stop

    SMALLEST

    PROGRAM COMMENTS

    MOV SI,1200H Initialize array size

    MOV CL,[SI] Initialize the count

    INC SI Go to next memory location

    MOV AL,[SI] Move the first data in AL

    DEC CL Reduce the count

    L2 : INC SI Move the SI pointer to next data

    CMP AL,[SI] Compare two datas

    JB L1 If AL < [SI] then go to L1 ( no swap)

    MOV AL,[SI] Else move the large number to AL

    L1 : DEC CL Decrement the count

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 24

    JNZ L2 If count is not zero go to L2

    MOV DI,1300H Initialize DI with 1300H

    MOV [DI],AL Else store the biggest number in 1300 location

    HLT Stop

    RESULT:

    Thus the program for finding the largest and smallest data from a given array was verified

    VIVA QUESTIONS:

    1. Write the flags of 8086. The 8086 has nine flags and they are

    1. Carry Flag (CF) 6. Overflow Flag (OF)

    2. Parity Flag (PF) 7. Trace Flag (TF)

    3. Auxiliary carry Flag (AF) 8. Interrupt Flag (IF)

    4. Zero Flag (ZF) 9. Direction Flag (DF)

    5. Sign Flag (SF)

    2. What are control bits? The flags TF, IF and DF of8086 are used to control the processor operation and so they are called

    control bits

    3. State the function of Direction flag in 8086. Direction flag is used with string instructions. If DF= 0, the string is processed from its beginning

    with the first element having the lowest address. Otherwise, the string is processed from the high

    address towards the low address

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 25

    8086 PROGRAMMING

    COPYING A STRING

    AIM:

    To move a string of length FF from source to destination.

    APPARATUS REQUIRED:

    8086 TRAINER KIT

    ALGORITHM:

    Initialize the data segment .(DS)

    Initialize the extra data segment .(ES)

    Initialize the start of string in the DS. (SI)

    Initialize the start of string in the ES. (DI)

    Move the length of the string(FF) in CX register.

    Move the byte from DS TO ES, till CX=0.

    PROGRAM COMMENTS

    MOV DI,1300H Initialize destination address

    MOV SI, 1400H Initialize starting address

    MOV CX, 0006H Initialize array size

    CLD Clear direction flag

    MOV AL, 08H Store the string to be searched

    REPNE SCASB Scan until the string is found

    DEC DI Decrement the destination address

    MOV BL,[DI] Store the contents into BL reg

    MOV [SI],BL Store content of BL in source address

    HLT Stop

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 26

    FLOW CHART

    RESULT:

    Thus the program for copying a string of data from source to destination was verified

    START

    CX=length of string, DF=0.

    Move a byte from source string (DS)

    to destination string (ES)

    Decrement CX

    Check for

    ZF=1

    STOP

    Initialize DS,ES,SI,DI

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 27

    VIVA QUESTIONS:

    1. What is the function of READY signal?

    This is the acknowledgment from the slow devices (or) memory that they have completed the

    data transfer. The signal made available by the devices is synchronized by the 8284A clock

    generator to provide ready input to the 8086. The signal is active high.

    2. What is the operation of RD signal ?

    Read signal RD when low, indicates the peripherals that the processor is performing a memory

    (or) I/O read operation.

    3. What is the function of DEN signal in minimum mode?

    This signal indicates the availability of valid data over the address /data lines. It is used to enable

    the Transceivers to separate the data from the multiplexed address / data signal.It is active from

    the middle of T2 until the middle of T4 DEN is tristated during hold acknowledge

    cycle.

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 28

    8086 PROGRAMMING

    FIND AND REPLACE

    AIM:

    To find a character in the string and replace it with another character.

    APPARATUS REQUIRED:

    8086 TRAINER KIT

    ALGORITHM:

    Initialize the extra segment .(E S)

    Initialize the start of string in the ES. (DI)

    Move the number of elements in the string in CX register.

    Move the byte to be searched in the AL register.

    Store the ASCII code of the character that has to replace the scanned byte in BL

    register.

    Scan for the byte in ES. If the byte is not found, ZF1 and repeat scanning.

    If the byte is found, ZF=1.Move the content of BL register to ES:DI.

    PROGRAM COMMENTS

    MOV DI,1300H Initialize destination address

    MOV SI,1400H Initialize starting address

    MOV CX, 0006H Initialize array size

    CLD Clear direction flag

    MOV AL, 08H Store the string to be searched

    MOV BH,30H Store the string to be replaced

    REPNE SCASB Scan until the string is found

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 29

    DEC DI Decrement the destination address

    MOV BL,[DI] Store the contents into BL reg

    MOV [SI],BL Store content of BL in source address

    MOV [DI],BH Replace the string

    HLT Stop

    FLOWCHART

    START

    CX=length of the string in ES,

    DF=0.

    DF=0.

    Scan for a particular character

    specified in AL Register.

    Check for ZF=1

    STOP

    Initialize DS, ES, SI, DI

    Move the content of BL

    to ES:DI

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 30

    RESULT:

    Thus the program for finding a data and replacing tha data from a given string of data was

    verified

    VIVA QUESTIONS:

    1. What is the fabrication technology used for 8086?

    The 8086 is fabricated using the HMOS (High density n-type metal oxide silicon field effect

    transistors) technology and contains approximately 29,000 transistors. The 8086 packed in a 40

    pin DIP and requires a single 5V supply.

    2. What is multimicro-processor architecture ?

    The maximum clock frequency at which a system operate may be considered as one of the

    measure of the processor capability of the system.An appropriate system involving several

    microprocessors connected using a certain topology ma provide high processing capacity. The

    study of such a system known as multi micro processor architecture.

    3. What are the functional parts of simple multi micro processor system ?

    The simplest type of multimicroprocessor system is one containing a CPU and a numeric data

    processor (NDP) and/or an Input / Output processor (IOP)

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 31

    8086 INTERFACING

    INTERFACING ANALOG TO DIGITAL CONVERTER

    AIM:

    To write an assembly language program to convert an analog signal into a digital signal using an

    ADC interfacing.

    APPARATUS REQUIRED:

    8086 TRAINER KIT

    ADC Interface board

    THEORY:

    An ADC usually has two additional control lines: the SOC input to tell the ADC when to start the

    conversion and the EOC output to announce when the conversion is complete. The following program

    initiates the conversion process, checks the EOC pin of ADC 0809 as to whether the conversion is over

    and then inputs the data to the processor. It also instructs the processor to store the converted digital data

    at RAM location.

    ALGORITHM:

    Select the channel and latch the address.

    Send the start conversion pulse.

    Read EOC signal.

    If EOC = 1 continue else go to step (iii)

    Read the digital output.

    Store it in a memory location

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 32

    FLOW CHART

    PROGRAM COMMENTS

    MOV AL,00 Load accumulator with value for ALE high

    OUT 0C8H,AL Send through output port

    MOV AL,08 Load accumulator with value for ALE low

    OUT 0C8H,AL Send through output port

    MOV AL,01 Store the value to make SOC high in the accumulator

    START

    SELECT THE CHANNEL AND LATCH ADDRESS

    SEND THE START CONVERSION PULSE

    READ THE DIGITALOUTPUT

    STORE THE DIGITAL VALUE IN THE MEMORY

    LOCATION SPECIFIED

    IS EOC = 1?

    STOP

    NO

    YES

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 33

    OUT 0D0H,AL Send through output port

    MOV AL,00

    Introduce delay MOV AL,00

    MOV AL,00

    MOV AL,00 Store the value to make SOC low the accumulator

    OUT 0D0H,AL Send through output port

    L1 : IN AL, 0D8H

    Read the EOC signal from port & check for end of conversion AND AL,01

    CMP AL,01

    JNZ L1 If the conversion is not yet completed, read EOC signal from

    port again

    IN AL,0C0H Read data from port

    MOV BX,1100 Initialize the memory location to store data

    MOV [BX],AL Store the data

    HLT Stop

    RESULT:

    Thus the program for converting an input analog signal into digital was verified

    VIVA QUESTIONS:

    1. What are the flag manipulation instructions of 8086.

    LAHF : Load AH from low byte of flag register.

    SAHF : Store AH to low byte of flag register

    PUSHF : Push content of flag to the stack.

    POPF : Pop content of stack and load it in the

    flag register.

    2. What are the three groups of signals in 8086 ?

    The 8086 signals are categorized in three groups. They are :

    i. The signals having common function in minimum and maximum mode.

    ii. The signals having special functions for minimum mode,

    iii. The signals having special functions for maximum mode.

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 34

    3. What are the uses of AD0 AD15 lines ?

    These are the time multiplexed memory 15 address and data lines.

    Address remains on the line during T I state ,while data is available on the data bus during T2,

    T3, TW and T4. Here Ti' T2, T3, T4 and Tw are the clock states of a machine , cycle. Tw is a

    wait state. These lines are active high and float to a tristate during interrupt acknowledge and

    local bus hold acknowledge cycles.

    8086 INTERFACING

    INTERFACING DIGITAL TO ANALOG CONVERTER

    AIM :

    1. To write an assembly language program for digital to analog conversion

    2. To convert digital inputs into analog outputs & To generate different waveforms

    APPARATUS REQUIRED:

    8086 TRAINER KIT

    DAC Interface board

    THEORY:

    Since DAC 0800 is an 8 bit DAC and the output voltage variation is between 5v and +5v. The

    output voltage varies in steps of 10/256 = 0.04 (approximately). The digital data input and the

    corresponding output voltages are presented in the table. The basic idea behind the generation of

    waveforms is the continuous generation of analog output of DAC. With 00 (Hex) as input to DAC2 the

    analog output is 5v. Similarly with FF H as input, the output is +5v. Outputting digital data 00 and FF at

    regular intervals, to DAC2, results in a square wave of amplitude 5v.Output digital data from 00 to FF in

    constant steps of 01 to DAC2. Repeat this sequence again and again. As a result a saw-tooth wave will be

    generated at DAC2 output. Output digital data from 00 to FF in constant steps of 01 to DAC2. Output

    digital data from FF to 00 in constant steps of 01 to DAC2. Repeat this sequence again and again. As a

    result a triangular wave will be generated at DAC2 output.

    ALGORITHM:

    Measurement of analog voltage:

    Send the digital value of DAC.

    Read the corresponding analog value of its output.

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 35

    WAVEFORM GENERATION:

    SQUARE WAVEFORM:

    Send low value (00) to the DAC.

    Introduce suitable delay.

    Send high value to DAC.

    Introduce delay.

    Repeat the above procedure.

    SAW-TOOTH WAVEFORM:

    Load low value (00) to accumulator.

    Send this value to DAC.

    Increment the accumulator.

    Repeat step (ii) and (iii) until accumulator value reaches FF.

    Repeat the above procedure from step 1.

    TRIANGULAR WAVEFORM:

    Load the low value (00) in accumulator.

    Send this accumulator content to DAC.

    Increment the accumulator.

    Repeat step 2 and 3 until the accumulator reaches FF, decrement the

    accumulator and send the accumulator contents to DAC.

    Decrementing and sending the accumulator contents to DAC.

    The above procedure is repeated from step (i)

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 36

    FLOW CHART

    MEASUREMENT OF ANALOG VOLTAGE SQUARE WAVE FORM

    START

    SEND THE DIGITALVALUE TO

    ACCUMULATOR

    TRANSFER THE ACCUMULATOR

    CONTENTS TO DAC

    READ THE CORRESPONDING

    ANALOG VALUE

    STOP

    INTIALISE THE ACCUMULATOR SEND

    ACC CONTENT TO DAC

    LOAD THE ACC WITH MAX VALUE

    SEND ACC CONTENT TO DAC

    START

    DELAY

    DELAY

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 37

    SAWTOOTH WAVEFORM TRIANGULAR

    START

    INITIALIZE

    ACCUMULATOR

    SEND ACCUMULATOR

    CONTENT TO DAC

    INCREMENT ACCUMULATOR

    CONTENT

    IS ACC

    FF

    YES NO

    START

    INITIALIZE

    ACCUMULATOR

    SEND ACCUMULATOR

    CONTENT TO DAC

    INCREMENT ACCUMULATOR

    CONTENT

    DECREMENT ACCUMULATOR

    CONTENT

    SEND ACCUMULATOR

    CONTENT TO DAC

    IS ACC FF

    NO

    YES

    IS ACC 00

    YES NO

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 38

    MEASUREMENT OF ANALOG VOLTAGE:

    PROGRAM COMMENTS

    MOV AL,7FH Load digital value 00 in accumulator

    OUT C0,AL Send through output port

    HLT Stop

    DIGITAL DATA ANALOG VOLTAGE

    PROGRAM: SQUARE WAVE

    PROGRAM COMMENTS

    L2 : MOV AL,00H Load 00 in accumulator

    OUT C0,AL Send through output port

    CALL L1 Give a delay

    MOV AL,FFH Load FF in accumulator

    OUT C0,AL Send through output port

    CALL L1 Give a delay

    JMP L2 Go to starting location

    L1 : MOV CX,05FFH Load count value in CX register

    L3 : LOOP L3 Decrement until it reaches zero

    RET Return to main program

    PROGRAM TABLE: SAW TOOTH WAVE

    PROGRAM COMMENTS

    L2 : MOV AL,00H Load 00 in accumulator

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 39

    L1 : OUT C0,AL Send through output port

    INC AL Increment contents of accumulator

    JNZ L1 Send through output port until it reaches FF

    JMP L2 Go to starting location

    PROGRAM TABLE: TRIANGULAR WAVE

    PROGRAM COMMENTS

    L3 : MOV AL,00H Load 00 in accumulator

    L1 : OUT C0,AL Send through output port

    INC AL Increment contents of accumulator

    JNZ L1 Send through output port until it reaches FF

    MOV AL,0FFH Load FF in accumulator

    L2 : OUT C0,AL Send through output port

    DEC AL Decrement contents of accumulator

    JNZ L2 Send through output port until it reaches 00

    JMP L3 Go to starting location

    WAVEFORMS AMPLITUDE TIMEPERIOD

    Square Waveform

    Saw-tooth waveform

    Triangular waveform

    RESULT:

    Thus the program for converting a digital signal into analog was verified

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 40

    STEPPER MOTOR INTERFACING

    AIM:

    To write an assembly language program in 8086 to rotate the motor at different speeds.

    APPARATUS REQUIRED:

    8086 TRAINER KIT

    STEPPER MOTOR INTERFACE BOARD

    STEPPER MOTOR

    THEORY:

    A motor in which the rotor is able to assume only discrete stationary angular position is a

    stepper motor. The rotary motion occurs in a stepwise manner from one equilibrium position to the

    next.Two-phase scheme: Any two adjacent stator windings are energized. There are two magnetic fields

    active in quadrature and none of the rotor pole faces can be in direct alignment with the stator poles. A

    partial but symmetric alignment of the rotor poles is of course possible.

    ALGORITHM:

    For running stepper motor clockwise and anticlockwise directions

    (i) Get the first data from the lookup table. (ii) Initialize the counter and move data into accumulator. (iii) Drive the stepper motor circuitry and introduce delay (iv) Decrement the counter is not zero repeat from step(iii) (v) Repeat the above procedure both for backward and forward directions.

    SWITCHING SEQUENCE OF STEPPER MOTOR:

    MEMORY

    LOCATION

    A1 A2 B1 B2 HEX

    CODE

    4500 1 0 0 0 09 H

    4501 0 1 0 1 05 H

    4502 0 1 1 0 06 H

    4503 1 0 1 0 0A H

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 41

    FLOW CHART

    START

    INTIALIZE COUNTER FOR LOOK UP TABLE

    GET THE FIRST DATA FROM THE ACCUMULATOR

    MOVE DATA INTO THE ACCUMULATOR

    DRIVE THE MOTOR CIRCUITARY

    DECREMENT COUNTER

    GET THE DATA FROM LOOK UP TABLE

    IS B = 0 ?

    DELAY

    YES

    NO

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 42

    PROGRAM COMMENTS

    START : MOV DI, 1200H Initialize memory location to store the array of number

    MOV CX, 0004H Initialize array size

    LOOP 1 : MOV AL,[DI] Copy the first data in AL

    OUT 0C0,AL Send it through port address

    MOV DX, 1010H

    Introduce delay L1 : DEC DX

    JNZ L1

    INC DI Go to next memory location

    LOOP LOOP1 Loop until all the datas have been sent

    JMP START Go to start location for continuous rotation

    1200 : 09,05,06,0A Array of datas

    RESULT:

    Thus the program for rotating a stepper motor at different speed was verified

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 43

    INTERFACING PRGRAMMABLE KEYBOARD AND DISPLAY CONTROLLER- 8279

    AIM :

    To display the rolling message HELP US in the display.

    APPARATUS REQUIRED:

    8086 Microprocessor kit, Power supply, Interfacing board.

    ALGORITHM :

    Display of rolling message HELP US

    1. Initialize the counter 2. Set 8279 for 8 digit character display, right entry 3. Set 8279 for clearing the display 4. Write the command to display 5. Load the character into accumulator and display it 6. Introduce the delay

    7. Repeat from step 1.

    1. Display Mode Setup: Control word-10 H

    0 0 0 1 0 0 0 0

    0 0 0 D D K K K

    DD

    00- 8Bit character display left entry

    01- 16Bit character display left entry

    10- 8Bit character display right entry

    11- 16Bit character display right entry

    KKK- Key Board Mode

    000-2Key lockout.

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 44

    2.Clear Display: Control word-DC H

    1 1 0 1 1 1 0 0

    1 1 0 CD CD CD CF CA

    11 A0-3; B0-3 =FF

    11 A0-3; B0

    3. Write Display: Control word-90H

    1 0 0 1 0 0 0 0

    1 0 0 AI A A A A

    1-Enables Clear display

    0-Contents of RAM will be displayed 1-FIFO Status is cleared

    1-Clear all bits

    (Combined effect of CD)

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 45

    FLOWCHART

    PROGRAM COMMENTS

    START : MOV SI,1200H Initialize array

    MOV CX,000FH Initialize array size

    MOV AL,10 Store the control word for display mode

    OUT C2,AL Send through output port

    MOV AL,CC Store the control word to clear display

    OUT C2,AL Send through output port

    MOV AL,90 Store the control word to write display

    SET UP POINTER

    INITIALIZE THE COUNTER

    SET 8279 FOR 8-DIGIT CHARACTER DISPLAY

    SET 8279 FOR CLEARING THE

    DISPLAY

    WRITE THE COMMAND TO DISPLAY

    LOAD THE CHARACTER INTO ACCUMULATOR

    AND DISPLAY

    DELAY

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 46

    OUT C2,AL Send through output port

    L1 : MOV AL,[SI] Get the first data

    OUT C0,AL Send through output port

    CALL DELAY Give delay

    INC SI Go & get next data

    LOOP L1 Loop until all the datas have been taken

    JMP START Go to starting location

    DELAY : MOV DX,0A0FFH Store 16bit count value

    LOOP1 : DEC DX Decrement count value

    JNZ LOOP1 Loop until count values becomes zero

    RET Return to main program

    RESULT:

    Thus the program to display the rolling message HELP US in the display was verified.

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 47

    INTERFACING PROGRAMMABLE TIMER-8253

    AIM:

    To study different modes of operation of programmable timer 8253

    APPARATUS REQUIRED:

    8086 trainer kit

    8253 interfacing kit

    CRO

    THEORY:

    The main features of the timer are,

    i. Three independent 16-bit counters

    ii. Input clock from DC to 2 MHz

    iii. Programmable counter modes

    iv. Count binary or BCD

    The control signals with which the 8253 interfaces with the CPU are CS, RD, WR, A1,

    A2.The basic operations performed by 8253 are determined by these control signals. It

    has six different modes of operation, viz, mode 0 to mode 5.

    MODE 2 RATE GENERATOR

    It is a simple divide - by N counter. The output will be low for one input clock period. The

    period from one output pulse to the next equals the number of input counts in the register. If the register is

    reloaded between output pulses, the present period will not be affected, but the subsequent period will

    reflect the new value.

    MODE 3 SQUARE WAVE GENERATOR

    It is similar to mode 2, except that the output will remain high until one half for even number

    count, If the count is odd, the output will be high for (count+1)/2 counts and low for (count-1)/2 counts

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 48

    ALGORITHM:

    Mode 2-

    1. Initialize channel 0 in mode 2

    2. Initialize the LSB of the count.

    3. Initialize the MSB of the count.

    4. Trigger the count

    5. Read the corresponding output in CRO.

    Mode 3-

    1. Initialize channel 0 in mode 3

    2. Initialize the LSB of the count.

    3. Initialize the MSB of the count.

    4. Trigger the count

    5. Read the corresponding output in CRO.

    PORT ADDRESS :

    1. CONTROL REGISTER

    2. COUNTER OF CHANNEL 0 -

    3. COUNTER OF CHANNEL 1 -

    4. COUNTER OF CHANNEL 2 -

    5. O/P PORT OF CHANNEL 0 -

    6. O/P PORT OF CHANNEL 1 -

    7. O/P PORT OF CHANNEL 2 -

    CONTROL WORD FORMAT:

    D7 D6 D5 D4 D3 D2 D1 D0

    SC1 SC0 RL1 RL0 M2 M1 M0 BCD

    0 0 1 1 0 1 0 0

    0 0 1 1 0 1 1 0

    Mode 2 = 34 H

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 49

    SC1 SC0 CHANNEL SELECT RL1 RL0 READ/LOAD

    0 0 CHANNEL 0 0 0 LATCH

    0 1 CHANNEL 1 0 1 LSB

    1 0 CHANNEL 2 1 0 MSB

    1 1 ----- 1 1 LSB FIRST, MSB NEXT

    BCD --0 BINARY COUNTER 1 --BCD COUNTER

    M2 M1 M0 MODE

    0 0 0 MODE 0

    0 0 1 MODE 1

    0 1 0 MODE 2

    0 1 1 MODE 3

    1 0 0 MODE 4

    1 0 1 MODE 5

    MODE 2 RATE GENERATOR:

    PROGRAM COMMENTS

    MOV AL, 34H Store the control word in accumulator

    OUT 0BH Send through output port

    MOV AL, 0AH Copy lower order count value in accumulator

    OUT 08H Send through output port

    MOV AL, 00H Copy higher order count value in accumulator

    OUT 08H Send through output port

    HLT Stop

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 50

    MODE 3 SQUARE WAVE GENERATOR:

    PROGRAM COMMENTS

    MOV AL, 36H Store the control word in accumulator

    OUT 0BH Send through output port

    MOV AL, 0AH Copy lower order count value in accumulator

    OUT 08H Send through output port

    MOV AL, 00H Copy higher order count value in accumulator

    OUT 08H Send through output port

    HLT Stop

    FLOW CHART

    RESULT

    Thus the program for programmable timer 8253 and its different modes of operation was executed

    successfully

    START

    INITIALIZE ACCUMULATOR

    WITH MODE SET WORD

    INITIALIZE LSB OF COUNT

    STOP

    TRIGGER THE COUNT

    INITIALIZE MSB OF COUNT

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 51

    INTERFACING USART 8251 AIM:

    To study interfacing technique of 8251 (USART) with microprocessor 8086 and write an 8086

    ALP to transmit and receive data between two serial ports with RS232 cable.

    APPARATUS REQUIRED:

    8086 kit (2 Nos), RS232 cable.

    THEORY:

    The 8251 is used as a peripheral device for serial communication and is programmed by the

    CPU to operate using virtually any serial data transmission technique. The USART accepts data

    characters from the CPU in parallel format and then converts them into a continuous serial data stream for

    transmission. Simultaneously, it can receive serial data streams and convert them into parallel data

    characters for the CPU. The CPU can read the status of the USART at any time. These include data

    transmission errors and control signals. The control signals define the complete functional definition of

    the 8251. Control words should be written into the control register of 8251.These control words are split

    into two formats: 1) Mode instruction word & 2) Command instruction word. Status word format is used

    to examine the error during functional operation.

    1...transmit enable

    1...data terminal ready

    1... receive enable

    1... send break character

    1.... reset error flags (pe,oe,fe)

    1..... request to send (rts)

    1...... internal reset

    1....... enter hunt mode (enable search for sync characters)

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 52

    1 ransmitter ready

    1. receiver ready

    1.. transmitter empty

    1... parity error (pe)

    1.... overrun error (oe)

    1..... framing error (fe), async only

    1...... sync detect, sync only

    1....... data set ready (dsr)

    ALGORITHM:

    1. Initialize 8253 and 8251 to check the transmission and reception of a character

    2. Initialize8253 to give an output of 150Khz at channel 0 which will give a 9600 baud rate of 8251.

    3. The command word and mode word is written to the 8251 to set up for subsequent operations

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 53

    4. The status word is read from the 8251 on completion of a serial I/O operation, or when the host CPU

    is checking the status of the device before starting the next I/O operation

    PROGRAM: TRANSMITTER END

    PROGRAM COMMENTS

    MOV AL,36 Initialize 8253 in mode 3 square wave generator

    OUT CE,AL Send through port address

    MOV AL,10 Initialize AL with lower value of count (clock frequency 150KHz)

    OUT C8,AL Send through port address

    MOV AL,00 Initialize AL with higher value of count

    OUT C8,AL Send through port address

    MOV AL,4E Set mode for 8251(8bit data, No parity, baud rate factor 16x & 1 stop bit)

    OUT C2,AL Send through port address

    MOV AL,37 Set command instruction(enables transmit enable & receive enable bits)

    OUT C2,AL Send through port address

    L1:IN AL,C2 Read status word

    AND AL,04 Check whether transmitter ready

    JZ L1 If not wait until transmitter becomes ready

    MOV AL,41 Set the data as 41

    OUT C0,AL Send through port address

    INT 2 Restart the system

    RECEIVER END

    PROGRAM COMMENTS

    MOV AL,36 Initialize 8253 in mode 3 square wave generator

    OUT CE,AL Send through port address

    MOV AL,10 Initialize AL with lower value of count (clock frequency 150KHz)

    OUT C8,AL Send through port address

    MOV AL,00 Initialize AL with higher value of count

    OUT C8,AL Send through port address

    MOV AL,4E Set mode for 8251(8bit data, No parity, baud rate factor 16x & 1 stop bit)

    OUT C2,AL Send through port address

    MOV AL,37 Set command instruction(enables transmit enable & receive enable bits)

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 54

    OUT C2,AL Send through port address

    L1:IN AL,C2 Read status word

    AND AL,02 Check whether receiver ready

    JZ L1 If not wait until receiver becomes ready

    IN AL,C0 If it is ready, get the data

    MOV BX,1500 Initialize BX register with memory location to store the data

    MOV [BX],AL Store the data in the memory location

    INT 2 Restart the system

    RESULT:

    Thus the program for transmitting and receiving a data serially was executed successfully.

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 55

    INTERFACING PPI 8255

    AIM:

    To write ALP by interfacing 8255 with 8086 in mode 0, mode 1 and mode 2

    APPARATUS REQUIRED:

    8086 kit, 8255 interface kit.

    ALGORITHM:

    Mode 0

    1. Initialize accumulator to hold control word

    2. store control word in control word register

    3. Read data port A.

    4. Store data from port A in memory

    5. Place contents in port B

    Mode 1 & Mode 2

    1. Initialize accumulator to hold control word (for port A)

    2. Store control word in control word register

    3. Initialize accumulator to hold control word (for port B)

    4. Place contents in control word register.

    5. Disable all maskable interrupts, enable RST 5.5

    6. send interrupt mask for RST 6.5 & 7.5

    7. Enable interrupt flag

    8. Read data from port A, place contents in port B

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 56

    FLOWCHART

    Mode 0 Mode 1 & 2

    MODE 0

    PROGRAM COMMENTS

    MOV AL,90H Set the control word

    OUT C6,AL Send it to control port

    IN AL,C0 Get the contents of port A in AL

    OUT C2,AL Send the contents of port B to port address

    HLT Stop

    Store control word in

    control register

    Input to be read from port A

    Store into accumulator

    STOP

    START

    Output written on port B

    Store control word in control register

    Disable all interrupts except RST 6.5

    START

    Input to be read from port A

    Store output to port B

    STOP

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 57

    MODE 1

    PROGRAM COMMENTS

    MOV AL,0B0H Set the control word for mode 1

    OUT C6,AL Send it to control port

    MOV AL,09H Control for BSR mode

    OUT C6,AL Send it to control port

    MOV AL,13H Interrupt generation

    OUT 30,AL

    MOV AL,0AH Through 8259

    OUT 32,AL

    MOV AL,0FH Using IR2 interrupt(lower order count)

    OUT 32,AL

    MOV AL,00H Higher order count

    OUT 32,AL

    STI Set trap flag

    HLT Stop

    ISR: Subroutine

    IN AL,C0 Read from Port A

    OUT C2,AL Send it to Port B

    HLT Stop

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 58

    MODE 2

    PROGRAM COMMENTS

    MOV AL,0C0H Set the control word for mode 2

    OUT C6,AL Send it to control port

    MOV AL,09H Control for BSR mode

    OUT C6,AL Send it to control port

    MOV AL,13H Interrupt generation

    OUT 30,AL

    MOV AL,0AH Through 8259

    OUT 32,AL

    MOV AL,0FH Using IR2 interrupt(lower order count)

    OUT 32,AL

    MOV AL,00H Higher order count

    OUT 32,AL

    STI Set trap flag

    HLT Stop

    ISR: Subroutine

    IN AL,C0 Read from Port A

    OUT C2,AL Send it to Port B

    HLT Stop

    Result:

    Thus the program for interfacing a PPI was executed successfully

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 59

    8051 PROGRAMMING

    8 BIT ADDITION

    AIM:

    To write a program to add two 8-bit numbers using 8051 microcontroller.

    APPARATUS REQUIRED

    8051 trainer kit

    ALGORITHM:

    Clear Program Status Word.

    Select Register bank by giving proper values to RS1 & RS0 of PSW.

    Load accumulator A with any desired 8-bit data.

    Load the register R 0 with the second 8- bit data.

    Add these two 8-bit numbers.

    Store the result.

    Stop the program.

    ADDRESS LABEL MNEMONIC OPERAND HEX

    CODE

    COMMENTS

    4100 CLR C C3 Clear CY Flag

    4101 MOV A, data1 74,data1 Get the data1 in

    Accumulator

    4103 ADDC A, # data 2 24,data2 Add the data1 with data2

    4105 MOV DPTR, #

    4500H

    90,45,00 Initialize the memory

    location

    4108 MOVX @ DPTR, A F0 Store the result in memory

    location

    4109 L1 SJMP L1 80,FE Stop the program

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 60

    FLOW CHART

    RESULT:

    Thus the program for 8-bit addition using 8051 was executed.

    START

    Clear PSW

    Select Register

    Bank

    Load A and R 0

    with 8- bit datas

    Add A & R 0

    Store the sum

    STOP

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 61

    VIVA QUESTIONS:

    1.What is mean by microcontroller?

    A device which contains the microprocessor with integrated peripherals like memory, serial ports,

    parallel ports, timer/counter, interrupt controller, data acquisition interfaces like

    ADC,DAC is called microcontroller.

    2.Explain DJNZ instructions of intel 8051 microcontroller?

    a. DJNZ Rn, rel

    Decrement the content of the register Rn and jump if not zero.

    b. DJNZ direct , rel

    Decrement the content of direct 8-bit address and jump if not zero.

    3.Explain the contents of the accumulator after the execution ot the following program segments:

    MOV A,#3CH

    MOV R4,#66H

    ANL A,R4

    A 3C

    R4 66

    A 24

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 62

    8 BIT SUBTRACTION

    AIM:

    To perform subtraction of two 8 bit data using 8051 microcontroller and store the result in memory.

    APPARATUS REQUIRED

    8051 trainer kit

    ALGORITHM:

    a. Clear the carry flag. b. Initialize the register for borrow. c. Get the first operand into the accumulator. d. Subtract the second operand from the accumulator. e. If a borrow results increment the carry register. f. Store the result in memory.

    ADDRESS LABEL MNEMONIC OPERAND HEX

    CODE

    COMMENTS

    4100 CLR C C3 Clear CY flag

    4101 MOV A, # data1 74, data1 Store data1 in

    accumulator

    4103 SUBB A, # data2 94,data2 Subtract data2 from

    data1

    4105 MOV DPTR, # 4500 90,45,00 Initialize memory

    location

    4108 MOVX @ DPTR, A F0 Store the difference in

    memory location

    4109 L1 SJMP L1 80,FE Stop

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 63

    FLOWCHART

    RESULT

    Thus the program for 8-bit subtraction using 8051 was executed

    START

    CLEAR CARRY

    FLAG

    GET IST

    OPERAND IN

    ACCR

    SUBTRACT THE

    2ND OPERAND

    FROM ACCR

    STORE

    RESULT IN

    MEMORY

    STOP

    IS CF=1

    INCREMENT

    THE BORROW

    REGISTER

    Y

    N

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 64

    8051 PROGRAMMING

    8 BIT MULTIPLICATION

    AIM:

    To perform multiplication of two 8 bit data using 8051 microcontroller and store the result in

    memory.

    APPARATUS REQUIRED

    8051 trainer kit

    ALGORITHM:

    a. Get the multiplier in the accumulator. b. Get the multiplicand in the B register. c. Multiply A with B. d. Store the product in memory.

    ADDRESS LABEL MNEMONIC OPERAND HEX

    CODE

    COMMENTS

    4100 MOV A ,#data1 74, data1 Store data1 in

    accumulator

    4102 MOV B, #data2 75,data2 Store data2 in B reg

    4104 MUL A,B F5,F0 Multiply both

    4106 MOV DPTR, # 4500H 90,45,00 Initialize memory

    location

    4109 MOVX @ DPTR, A F0 Store lower order result

    401A INC DPTR A3 Go to next memory

    location

    410B MOV A,B E5,F0

    Store higher order result 410D MOV @ DPTR, A F0

    410E STOP SJMP STOP 80,FE Stop

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 65

    FLOW CHART

    RESULT

    Thus the program for 8-bit multiplication using 8051 was executed

    START

    GET

    MULTIPLIER

    IN ACCR

    GET

    MULTIPLICAND

    IN B REG

    MULTIPLY A

    WITH B

    STORE

    RESULT IN

    MEMORY

    STOP

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 66

    8051 PROGRAMMING

    8 BIT DIVISION

    AIM:

    To perform division of two 8 bit data using 8051 microcontroller and store the result in memory.

    APPARATUS REQUIRED

    8051 trainer kit

    ALGORITHM:

    1. Get the Dividend in the accumulator. 2. Get the Divisor in the B register. 3. Divide A by B. 4. Store the Quotient and Remainder in memory.

    ADDRESS LABEL MNEMONIC OPERAND HEX

    CODE

    COMMENTS

    4100 MOV A, # data1 74,data1 Store data1 in accumulator

    4102 MOV B, # data2 75,data2 Store data2 in B reg

    4104 DIV A,B 84 Divide

    4015 MOV DPTR, # 4500H 90,45,00 Initialize memory location

    4018 MOVX @ DPTR, A F0 Store remainder

    4109 INC DPTR A3 Go to next memory

    location

    410A MOV A,B E5,F0

    Store quotient 410C MOV @ DPTR, A F0

    410D STOP SJMP STOP 80,FE Stop

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 67

    FLOW CHART

    RESULT

    Thus the program for 8-bit division using 8051 was executed

    START

    GET DIVIDEND

    IN ACCR

    GET DIVISOR IN

    B REG

    DIVIDE A BY B

    STORE

    QUOTIENT &

    REMAINDER

    IN MEMORY

    STOP

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 68

    LOGICAL AND BIT MANIPULATION

    AIM:

    To write an ALP to perform logical and bit manipulation operations using 8051 microcontroller.

    APPARATUS REQUIRED:

    8051 microcontroller kit

    ALGORITHM:

    1. Initialize content of accumulator as FFH

    2. Set carry flag (cy = 1).

    3. AND bit 7 of accumulator with cy and store PSW format.

    4. OR bit 6 of PSW and store the PSW format.

    5. Set bit 5 of SCON.

    6. Clear bit 1 of SCON.

    7. Move SCON.1 to carry register.

    8. Stop the execution of program.

    FLOWCHART

    START

    Set CY flag, AND CY with MSB of

    ACC

    Store the PSW format, OR CY with bit 2 IE reg

    Clear bit 6 of PSW, Store PSW

    Set bit 5 of SCON , clear bit 1 and store

    SCON

    Move bit 1 of SCON to CY and store PSW

    STOP

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 69

    ADDRESS

    HEX

    CODE

    LABEL

    MNEMONICS

    OPERAND

    COMMENT

    4100 90,45,00 MOV DPTR,#4500 Initialize memory location

    4103 74,FF MOV A,#FF Get the data in accumulator

    4105 D3 SETB C Set CY bit

    4016 82,EF ANL C, ACC.7 Perform AND with 7th

    bit of

    accumulator

    4018 E5,D0 MOV A,DOH

    Store the result 410A F0 MOVX @DPTR,A

    410B A3 INC DPTR Go to next location

    410C 72,AA ORL C, IE.2 OR CY bit with 2nd

    bit if IE

    reg

    410E C2,D6 CLR PSW.6 Clear 6th

    bit of PSW

    4110 E5,D0 MOV A,DOH

    Store the result 4112 F0 MOVX @DPTR,A

    4113 A3 INC DPTR Go to next location

    4114 D2,90 SETB SCON.5 Set 5th

    of SCON reg

    4116 C2,99 CLR SCON.1 Clear 1st bit of SCON reg

    4118 E5,98 MOV A,98H

    Store the result 411A F0 MOVX @DPTR,A

    411B A3 INC DPTR Go to next location

    411C A2,99 MOV C,SCON.1 Copy 1st bit of SCON reg to

    CY flag

    411E E5,D0 MOV A,DOH

    Store the result 4120 F0 MOVX @DPTR,A

    4122 80,FE L2 SJMP L2 Stop

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 70

    PROGRAMS FOR DIGITAL CLOCK AND STOP WATCH (USING 8086)

    AIM:

    To write an ALP to display the messages for every sec using 8086.

    APPARATUS REQUIRED:

    8086 Trainer kit

    Program that places a message on the screen every 10 seconds, using int 1ah;

    CODE SEGMENT

    TIMEDELAY:

    MOV SP,1000H

    MOV DI,10XD

    TIME OUT:

    MOV AH,00H

    INT 1AH

    MOV BX,DX

    TIMER:

    MOV AH, 00H

    INT 1AH

    SUB DX, BX

    CMP DX, 182XD

    JC TIMER

    MOV AH, 09H

    CS MOV DX,MSG

    INT 21H

    DEC DI

    JNZ TIMEOUT

    MOV AX,4C00H

    INT 21H

    MSG:

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 71

    DB 'TEN MORE SECONDS HAVE PASSED $'

    CODE ENDS

    RESULT:

    Thus an ALP program for digital clock and stop watch was executed and verified

    successfully.

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 72

    PROGRAMS TO VERIFY TIMER, INTERRUPTS & UART OPERATIONS IN 8031

    MICROCONTROLLER

    AIM:

    To write the alp to verify the interrupts and UART operations using microcontroller

    APPARATUS REQUIRED:

    8051 microcontroller kit

    a) Program to generate a square wave of frequency --------.

    Steps to determine the count:

    Let the frequency of sqaurewave to be generated be Fs KHz.

    And the time period of the squarewave 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)

    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

  • MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL SRINIVASAN ENGINEERING COLLEGE, PERAMBALUR

    III YEAR

    ISSUE: 01 REVISION: 00 73

    overflow

    CPL Px.x ; get the square wave th