Upload
shavel-kumar
View
248
Download
1
Embed Size (px)
Citation preview
8/10/2019 microprocessor ece lab manual.doc
1/24
MANAV RACHNA COLLEGE OF ENGINEERING
FARIDABAD
DEPARTMENT OF ELECTRONICS AND
COMMUNICATION ENGINEERING
MEEC519- ADVAVANCED MICROPROCESSORS
AND MICROCONTROLLERS LAB
8/10/2019 microprocessor ece lab manual.doc
2/24
NAME OF THE STUDENT --->
COLLEGE ROLL NO --->
UNIVERSITY ROLL NO --->
BRANCH --->
SEMESTER --->
NO OF EXPERIMENTS --->
YEAR --->
STATUS OF LAB FILE --->
SIGNATURE OF THE FACULTY --->
DATE OF PRACTICAL EXAM --->
8/10/2019 microprocessor ece lab manual.doc
3/24
INDEX
S.n
o
Date Experient Si!nat"re
8/10/2019 microprocessor ece lab manual.doc
4/24
EXPERIMENTS BASED ON 8086
EXP NO : 0 STUDY OF 8086 KIT
DATE :
AIM
To study about the 8086 microprocessor kit.
HARDWARE SPECIFICATIONS
1 CPU PROCESSOR AND CLOCK FRE!UENCY
Intel 8086/8088 CPU at 5/4. !"# clock rate $%ptionally 8 !"#&
" MEMORY
!%'IT%( )P(%!* +000*0000 , -+++ or 6
)P(%! )1P2'3I%'* +000*0000 , +++ or 64
33T)! (2!* 0000*000 , -+++ or 6
33T)! (2! )1P2'3I%'* 0000*000 , ++++ or 64
I'T)((UPT )CT%(3* 0000*0000 , 0-++
# PERIPHERALS
P2(2) I/%* 48 I/% lines usin7 to numbers o 8955.
3)(I2* %ne number o (39-9C , 3erial Interace usin78952 U32(T.
TI!)(* - Channel 6,bit Pro7rammable Timer 895-. Channel0 used as baud rate 7enerator
or the 3erial Port.
$ DISPLAY
6:9 C; ;I3P2 $ith 6 ON-BOARD BATTERY BACKUP: &O'()*+,>
8/10/2019 microprocessor ece lab manual.doc
5/24
%nboard battery backup acility is optionally pro=ided or (2! ?U9 @ U4>.
. POWER CONSUMPTION
A 5 * .5 2mps
8 POWER SUPPLY SPECIFICATIONS
!odel* 3!P3,0
!ains* 9-0 olts 2C at 50 "#
Input* 9-0 2C at 50"
%utput* > A 5 oltsB - amps re7ulated
9> A 9 oltsB 950 m2 re7ulated
-> , 9 oltsB 950 m2 re7ulated
4> A-0 oltsB 950 m2 unre7ulated
/ PHYSICAL CHARACTERISTICS
! , 86/88 C; trainer PC
8/10/2019 microprocessor ece lab manual.doc
6/24
SOFWARE SPECIFICATIONS
COMMAND LINE EDITOR FEATURES
i> 3in7le line editor can process upto 40 characters.
)) V,) 234 5+7()*+ ,93:
1 ASSEMBLER COMMAND
FUNCTION
This command is used to enter the mnemonics o 8086 and it 7i=es the opcode or the
!nemonics.
SYNTAX
E2 FC(G
2 , ine 2ssembler Command.
PROCEDURE
8/10/2019 microprocessor ece lab manual.doc
7/24
. 2ter enterin7 the H2H commandB the kit is displayed as ollos
9. ThenB it asks the startin7 address
Then start pro7rammin7.
Fdra the kit dia7ram 7i=en in class
hereG
ALGORITHM:
8/10/2019 microprocessor ece lab manual.doc
8/24
?I> 16-BIT ADDITION
. Initiali#e the !3
8/10/2019 microprocessor ece lab manual.doc
9/24
DATE:
Introduction:2ssembly lan7ua7e pro7rams resemble a compiled lan7ua7e pro7ramsB like P23C2.
In compiled lan7ua7es the user irst creates a source ileB hich is a tet ile o entire
pro7ram. The compiler chan7es it into machine lan7ua7e instructions. ?2ctually a linker isused too but is i7nored or the time bein7> In the compiled lan7ua7e pro7ram the entire
pro7ram is transormed into machine lan7ua7e at once.
3ome o the most rudimentary unctions that a debu77er can perorm are the olloin7*
2ssemble short pro7rams
ie a pro7ramJs source codeB alon7 ith its machine code
ie the CPU re7isters and la7s
Trace or eecute a pro7ramB atchin7 =ariables or chan7es
)nter ne =alues into memory
3earch or binary or 23CII =alues in memory
!o=e a block o memory rom one location to another
+ill a block o memory
oad and rite disk iles
DEBUG 7*;;,+:
KeJll be usin7 only some o the ;)
8/10/2019 microprocessor ece lab manual.doc
10/24
use o data re7istersB so donJt 7et upset i you do not understand the meanin7 o some o the
olloin7 re7isters*
D,(, R3=)(39:
6,bit 21 ?accumulator>B B C1 ?counter>B ;1 ?data>
8,bit* 2"B 2B
8/10/2019 microprocessor ece lab manual.doc
11/24
third column displays the contents o 00hB and so on the number in th column displays
the contents o memory at oset address 00+h. ?The characters to the ri7ht are the 23CII
representation o each byte.> Calculate the absolute address correspondin7 to this last
memory location. (eer to appendi notes
8/10/2019 microprocessor ece lab manual.doc
12/24
+or this e can use the LdJ command like this.
; cs * 00
The irst e bytes ?ho many is not clear yet> represent the machine lan7ua7e code o the
abo=e pro7ram no eJll use another ;) as ell as the correspondin7 machine lan7ua7e
code.
U+-,3;@3 C*;;,+
This command translates memory into assembly lan7ua7e mnemonics. This process is called
dis,assembly )nter the olloin7 command and note don hat you obser=e.
U 00
'o you can see both your assembly lan7ua7e pro7ram as ell as the correspondin7
machine code on the screen. Can you no i7ure out ho many bytes are occupied by your
small pro7ramR 'ote don the number. %ur net step ill be to run this pro7ram by
eecutin7 one command at a time and then atchin7 the results in =arious re7isters. This
process is called sin7le,step operation in debu77in7 o assembly lan7ua7e pro7rams
T9,73 C*;;,+
This command eecutes one or more instructions rom the current C3*IP location ?see
2ppendi notes or an optional address i speciied. The contents o the re7isters are shon
ater each instruction is eecuted. Check the contents o the data re7isters 21 and
8/10/2019 microprocessor ece lab manual.doc
13/24
FLOW CHART
ALGORITHM?i> 16-@)( ,)()*+
et the irst number.
2dd the second number to the irst number.
3tore 3
8/10/2019 microprocessor ece lab manual.doc
14/24
FLOW CHART FOR SUBTRACTION
ALGORITHM
?ii> 6-@)( @(9,7()*+
et the irst number
3ubtract the second number rom the irst number.
3tore 3
8/10/2019 microprocessor ece lab manual.doc
15/24
PROGRAM FOR MUTIPLICATION
9)(3 4*9 '9*=9,; ,+ *('(.
)nter the to input data in the location 00 and 09 usin7 ?3< command>
)ecute the pro7ram ith the command ?% startin7 address>.
Check the correspondin7 result in the location 900 and 90
Chan7e the data in the location 00and 09 and =eriy the result
RESULT
8/10/2019 microprocessor ece lab manual.doc
16/24
EX NO :" SORTING OF NUMBERS
DATE :
AIM
Krite an 2ssembly an7ua7e Pro7ram to arran7e a 7i=en series o headecimal bytes in
ascendin7 order FLOWCHART
ASCENDING ORDER DESCENDING ORDER
3T2(T
I'ITI2IN) P%I'T)(
C%U'T S C%U'T O
+2 S 0
I3
P%I'T)(
P%I'T)(
A
T)!P S P%I'T)(
P%I'T)( S P%I'T)( A
P%I'T)( A S T)!P
P%I'T)( S P%I'T)( A
C%U'T S C%U'T A
I3
C%U'T
S 0
I3
+2
S 0
)3
'%
'%
'%
)3
3T2(T
I'ITI2IN) P%I'T)(
C%U'T S C%U'T O
+2 S 0
I3
P%I'T)(
P%I'T)(
A
T)!P S P%I'T)(
P%I'T)( S P%I'T)( A
P%I'T)( A S T)!P
P%I'T)( S P%I'T)( A
C%U'T S C%U'T A
I3
C%U'T
S 0
I3
+2
S 0
)3
'%
'%
)3
8/10/2019 microprocessor ece lab manual.doc
17/24
ASCENDING ORDER OF AN ARRAY
ALGORITHM:
&) S*9()+= )+ ,73+)+= *939:
a. oad the array count
b. Compare the numbers and echan7e i necessary so that the to numbers are in
ascendin7 order.
c. ;ecrement count.
d. et the third number rom the array and repeat the process until count is 0.
PROGRAM
WRITE YOUR PROGRAM HERE>
EXAMPLE
900, 90,99 909,44 90-,08
OUTPUT900,08 90, 909,99 90-,44
OBSERVATION
INPUT
MEMORY ADDRESS VALUE
3T%P
)3
3T%P
)3
8/10/2019 microprocessor ece lab manual.doc
18/24
OUTPUT
MEMORY ADDRESS VALUE
PROCEDURE
.)nter the mnemonics in the kit .9.)nter the input =alue in the location 900.
-.)ecute the Pro7ram
4.check the =alues are arran7ed in ascendin7 order in the location 900.
RESULT
EX NO: $ NUMBER CONVERSIONS USING 8086
DATE:
8/10/2019 microprocessor ece lab manual.doc
19/24
AIM:
?a>.To con=ert the . To con=ert the binary number to 23CII
APPARATUS RE!UIRED:
23! 3I!U2T%(
ALGORITHM:
. oad the address in in memory.
FLOW CHART:
MAKE FLOW CHART AND 9)(3 '9*=9,;
O@39,()*+ (,@3
AIM:
?a>.To con=ert the . To con=ert the binary number to 23CII
8/10/2019 microprocessor ece lab manual.doc
20/24
APPARATUS RE!UIRED:
23! 3I!U2T%(
ALGORITHM:
. .
FLOW CHART:
MAKE FLOW CHART AND 9)(3 '9*=9,;
O@39,()*+ (,@3
E'( % P9*=9,; 5*9 (9)+= ;,+)',()*+ 5*9 8086DATE:
8/10/2019 microprocessor ece lab manual.doc
21/24
1 M*)+= B*72 O5 D,(, F9*; O+3 M3;*94 L*7,()*+ T* A+*(
8/10/2019 microprocessor ece lab manual.doc
22/24
EXPERIMENTS BASED ON 8051EXP 6 DISPLAY A S!UARE WAVE
AIM:
> To display a suare a=e o 9 h#
9To display a suare a=e o ms
->enerate the he ile and =ie the output on C(%
ALGORITHM:
8/10/2019 microprocessor ece lab manual.doc
23/24
. 3et the tmod re7ister in mode
9. Calculate the =alues o T"0 and T0
-. oad the =alues o T"0 and T%
4. 3et pin o port 0.
5. Krite a delay loop
CALCULATION:
,3 *5 TH0 ,+ TL0>
PROGRAM FOR GENERATING "KH S!UARE WAVE
ORG 000H
MOV P1,#00000000B
MOV A,#00000000B
MAIN: MOV R6,#220D
MOV R7,#183D
LOOP1:DJNZ R6,LOOP1
LOOP2:DJNZ R7,LOOP2
CPL A
MOV P1,A
SJMP MAIN
END
Program to delay 1mS.
DELAY: MOV R6,#250D
MOV R7,#250D
LABEL1: DJNZ R6,LABEL1
LABEL2: DJNZ R7,LABEL2
RE
OUTPUT OF SIMULATOR
PASTE YOUR PROGRAM HERE>
8/10/2019 microprocessor ece lab manual.doc
24/24
HEX FILE:
PASTE YOUR HEX FILE HERE>