microprocessors-and-microcontrollers-lab-file
microprocessors-and-microcontrollers-lab-file
SCIENCES JABALPUR
LABMANUAL
ON
MICROPROCESSORS AND APPLICATION LAB
V SEMESTER
1
Course Syllabus
Unit II
Assembly Language Programming of 8086
8086 Instruction Set, Addressing modes, Assembly Language Programming with Intel 8086
microprocessor.
Unit III
Peripheral devices and their interfacing
Introduction to the various interfacings chips like 8155, 8255, Interfacings key boards, LEDs ,
ADC, DAC and memory Interfacing.
Unit IV
Interrupts of 8086
General purposes programmable peripheral devices ( 8253), 8254 programmable interval timer,
8259A programmable interrupt controller & 8257 DMA controller, USART, serial I/O & data
Communication.
Unit V
8051 Microcontroller
Introduction to microcontrollers (8051) and embedded systems: 8051 architecture, pin description
, I/O configuration , interrupts, addressing modes, an overview of 8051 instruction set, embedded
system, use of microcontrollers in embedded systems.
TEXT BOOKS:
1. Advanced Microprocessors and Peripherals byAKRay,TataMcGraw-HillEducation,2006
2. The8051Microcontrollers:Architecture,Programming&ApplicationsbyDr.K.UmaRao,
Andhe Pallavi, Pearson, 2009
2
INTRODUCTION OF MICROPROCESSOR
INTRODUCTION:
Microprocessor is regarded as one of the most important devices in our everyday
machines called computers. Microprocessor is an electronic circuit that functions as the
CPU of a computer, providing computational control. Microprocessor is also use in other
advanced electronic systems, such as computer printers, automobiles and jet airlines
The first Microprocessor was the Intel 4004, produced in 1971. Originally
developed for a calculator and revolutionary for its time, it contained2300 transistors on a
4-bit microprocessor that could perform only 60000 operations per second. Thefirst8-bit
microprocessor was the Intel 8008, developed in 1972 to run computer terminals.
INTEL MICROPROCESSOR:
8086(1979):
80286(1982):
With16MB of address able memory and 1GB of a virtual memory, this 16-bit
80386(1985):
The price/performance curve continued its steep climb with the 386 and later the
486- 32 bit processors that brought real computing to the masses. The 386, featured
275,000 transistors, the 486 had more than a million
Pentium (1993):
Adding systems-level characteristics to enormous raw compute power, the Pentium supports
demanding I/O, graphics and communications intensive applications with more than 3 million
transistors.
Pentium II (1997):
The 7.5 million transistors Pentium II processor incorporates Intel MMX-TM
technology, which is designed specially to process video, audio and graphics data
efficiently
the address bus in order to fit a standard 40-pin dual in line package. 16 bit I/O address
meant 64KBof separate I/O space (216=65,536). The maximum linear address space was
limited to 64KB.Simply because internal registers were only 16 bits wide, programming
over 64KB, boundaries involved adjusting segment register.
Some of the control pins which carry essential signals for all external operations
mode. The former was intended for small single processor systems while latter was for
medium and large systems, using more than one processor.
4
LIST OF EXPERIMENTS
S.No. NAME OF EXPERIMENT PAGE DATE GRADING SIGN
NO.
1. To write an assembly language program to 6
perform the addition of two 8-bit numbers
using 8086.
2. 7
To Perform Subtraction Operation On 8-Bit
Data
3. 8
To perform an assembly language on16-Bit
number for Multiplication.
4. 9
To Perform division operation on 8-Bit data
6. 11
To Perform an assembly Language On 16-
Bit Number
(B)Subtraction Of Two Numbers
7. 12
Write A program To Arrange Given
Numbers In Ascending Order.
5
EXPERIMENT-1
AIM:- To write an assembly language program to perform the addition of two 8-bit numbers using
8086
DATASEGMENT
NO1DB04H
NO2DB06H
DATA ENDS
CODESEGMENT
START:
ORG500H
MOVAX, DATA
MOV DS, AX
ADD AL, BL
INT 21H
CODEENDS
ENDSTART
ASSEMBLYLANGUAGEPROGRAM:-
DATASEGMAENT
NO1DB08H
NO2DB06H
DATA ENDS
CODESEGMENT
START:
ORG500H
MOVAX,DATA
MOV DS, AX
SUB AL, BL
INT21H
CODE ENDS
END START
Numbers.
ASSEMBLYLANGUAGEPROGRAM:-
DATASEGMAENT
NO1DW0FH
NO2 DB 06H
DATA ENDS
CODESEGMENT
START:
ORG 500H
MOVAX,DATA
MOV DS, AX
MUL BX
INT21H
CODE ENDS
END START
ASSEMBLYLANGUAGEPROGRAM:-
DATASEGMAENT
NO1DW0FH
NO2 DB 06H
DATA ENDS
CODESEGMENT
START:
ORG500H
MOVAX,DATA
MOV DS, AX
DIV BL
INT21H
CODE ENDS
END START
DATASEGMAENT
NO1DW1003H
NO2DW1002H
DATA ENDS
CODESEGMENT
START:
ORG500H
MOVAX,DATA
MOV DS, AX
ADD AX, BX
INT 21H
CODEENDS
ENDSTART
NO1DW1004H
NO2DW1002H
DATA ENDS
CODESEGMENT
START:
ORG500H
MOVAX, DATA
MOV DS, AX
21H
CODEENDS
ENDSTART
ASSEMBLYLANGUAGEPROGRAM: ASSUME
DATASEGMENT
AD DW 5000H
COUNTDB05H
DATA ENDS
CODESEGMENT
START:
ORG600H
MOVAX,DATA
MOV DS, AX
MOVCL,COUNT
CMPAL,[BX+1]
JL LOOP3
XCHGAL,[BX+1]
MOV [BX], AL
MOVDL,01H
LOOP3: INCBX
DECCL
JNZ LOOP2
CMPDL,01H
JE LOOP1
INT21H
CODE ENDS
END START
ASSEMBLYLANGUAGEPROGRAM: ASSUME
DATASEGMENT
AD DW 5000H
COUNTDB05H
DATA ENDS
CODESEGMENT
START:
ORG600H
MOVAX,DATA
MOV DS, AX
MOVCL,COUNT
CMPAL,[BX+1]
JG LOOP3
XCHGAL,[BX+1]
MOV[BX],AL
LOOP3: INC BX
DECCL
JNZ LOOP2
JE LOOP1
INT21H
CODEENDS
ENDSTART
ASSEMBLYLANGUAGEPROGRAM:
ASSUMECS:CODE,DS:DATA
DATA SEGMENT
NO1 DB 06H
AD1DW5000H
DATA ENDS
CODESEGMENT
START:
ORG600H
MOV AX, DATA
MOVDS,AX
CODEENDS
ENDSTART
AIM: To interface Programmable Interval timer to 8086 and verify the operation of 8253 in six different
modes
APPARATUSREQUIRED:-
8086microprocessorkit.
8253interfacing card.
Rs-232.
Power supply.
26-pin bus.
Connecting wires.
CRO
Theory :
MODE 3-Square Generation In this the output will remain high until one half of the count and goes low for
the order half provided the count is an even number. This mode is used to generate the baud rate of 8251.
Each of the three counters of 8253 can be operated in one of the following six modes of operation.
OPERATING MODES OF 8253-PIT
Each of the three counters of 8253 can be operated in one of the following six modes of operation.
Mode 3 (Square wave generator): This mode is similar to mode 2. However, the duration of the high and
low clock pulses of the output will be different from mode 2.
Suppose 𝑛 is the number loaded into the counter, the output will be
ASSEMBLYLANGUAGEPROGRAM:
MOV AL, 36H
OUT 33, AL
OUT 30, AL
MOV A, 00H
OUT 30, AL
Square wave Output
Result: We have verified the output of 8253 in square wave generation mode
EXPERIMENT-11
AIM:-Write a program to interface programmable peripheral interface (8255)with 8086 to interface Eight
Light emitting diode.
APPARATUSREQUIRED:-
8086microprocessor kit.
8255interfacingcard.
Rs-232.
Power supply.
26-pinbus.
Connecting wires.
THEORY:-
This interface allow s the user to study the operation of 8255 in 3modes.TheIntel8255isa
general purpose programmable I/O device designed for use with Intel microprocessor
& microcontroller. It has24i/o ports, which may be individually programmed in2groupsi.e.,
group A consisting of port A(8 pins)&port- C upper(4 pins ) & group- B consisting of port B
(8 pins) 7 port C lower (4 pins) & used in 3 modes of operation.
In this mode (MODE O), each group of i/o pins may be programmed in sets of 4 to be i/p or
o/p. that is, port A, port C (upper), port B & port C (lower) may be configured as i/p ports or
o/p ports.
This interface is designed in such a way that port- A can be used as both i/p &o/p. port B
can be used in o/p mode & port-c can be used as o/p in mode 0 & as control/status in modes
1& 2 .
OPERATION:
MODE0 (BASICI/OMODE)
This functional configuration provides simple input and output operations for each of three
CIRCUITDIAGRAM:
PROCEDURE:-
1. Connect power supply 5v&GND to both microprocessor trainer kit and programmable
peripheral interfacing kit (card).
2. Make the connections in talk window.
3. Connectdatabusbetweenmicroprocessortrainerkitandprogrammableperipheral
interface kit .
4. Dump the programming toprocessorkitusingRS-232cable.
5. Execute the program by typing code segment starting address.
6. Observe the display on interfacing card. .