Ece Mpi
Ece Mpi
CAMPUS
The Monitor commands in both Serial and Stand alone mode are
similar and the following discussion holds good for trainer operation in either mode.
Theses commands are summarized in the following .
In individual command descriptions , the following notation is used
[V]
[V]*
<V>
,/-
Note:- These are used to clarify the command formats and they are neither to be
entered by the user nor output by the system
1. A 2. C 3. D 4. F 5. G 6. I 7. L 8. M 9. N 10. O 11. P 12. R 13. S 14. T 15. W 16. X 17. Z -
Assembler Command
Compare Memory Command
Display Memory Command
Fill Memory Command
Go Command
Input Port Command
Labels Display Command
Move Memory Command
Single step Command
Output Port Command
Programmer Command
Read Hex File Command
Substitute Memory Command
Tape Write Command
Write Hex File Command
Register Command
Disassembler Command
1. Assembler
Command
Syntax
: A [address]<CR>
1
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Summary
Processors.
Syntax
Argument
Syntax
Summary
Argument
Syntax
Summary
Argument
5. Go Command
Command
: Go Command (G)
Syntax
Summary
Argument
6. Help Command
Command
: Help (H)
2
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Syntax
Summary
Syntax
Summary
Argument
: <port add> Reads a byte/word from specified port addr and displays
8. Label Command
Command
Syntax
: LL<CR> / LC <CR>
Summary
Syntax
Summary
block of
memory of the same size.
Argument
: <addr>
Syntax
Summary
address,
Tracing into CALL instructions.
Argument
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Syntax
Summary
Argument
written.
<data> Hex data value to be written to the specified port.
12. R - Read Hex File Command
This command is used to read content of EPROM when EPROM programmer
interface to 8086 Trainer Board
13. Programmer Command
Command
Syntax
: P<CR>
Summary
EPROM
Reading, Programming, Blank checking, Verifying commands.
14. Substitute Memory Command
Command
Syntax
Summary
Argument
examined/modified.
<data> New data (byte/word)
15.T - Tape Write Command
4
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
This command is used to write into EPROM when EPROM programmer interface to
8086 Trainer Board
16.Disassembler Command
Command
Syntax
Summary
Argument
Syntax
Summary
Argument
5
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
MONITOR ROUTINES(8086 P)
I
1
OUT_STRING
Outputs a string of ASCII characters stored in
memory. The
string
Calling address:
FE00:0013
OUT_CRLF
Output a carriage return and line feed (ASCII
code =0AH ,
Calling address:
0DH)
FE00:0031
OUT_BLANK
Output a blank character (ASCII code = 20H)
to the LCD
Calling address:
or console
FE00:0049
OUT_BYTE
Outputs a byte in AL register to the LCD or to
console
Calling address:
Name of the routine:
Function:
FE00:0052
OUT_WORD
Outputs a word value in store in AX register to
the LCD or
to the console
6
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Calling address:
Name of the routine:
Function:
format to the
FE00:006A
OUT_ADDR
Outputs an address value in Segment: Offset
LCD or to the console. The
is stored in
and display
operating
mode.
register
FE00:00C7
GET_WORD
Reads a word value entered form the keyboard
and stores it
Calling address:
in AX
FE00:00E0
GET_ADDR
Reads an address value form the keyboard in
Segment: Offset format. The
stored
in
ES
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Calling address:
14 Name of the routine:
Function:
register is a
register if found
F) and
9/A-F)
the routine
converted to 33H
FE00:0152
BCD_BIN
This routine converts a valid BCD value (up to
99) stored
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
BIN_BCD
This routine unpacks a 8- bit binary number to
three
3 consecutive
point
to
the
least
location 0:3000H,3001H
(assuming
Calling address:
FE00:018B
II
MONITOR ROUTINES INDEPENDENT ON OPERATING MODE
1 Name of the routine:
SER_SEND_STRING
Function:
Outputs a string of ASCII characters stored in
memory to
location of
CLR_LCD
Clears the LCD interfaced with the trainer in
either mode of
operation
9
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Calling address:
FE00:01ED
PRINT_STRING
Prints a string of ASCII characters in memory
when a
indexed by DS:SI
the
With overlapping
(ii) Without
11
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
overlapping
APPARATUS:-
Initialize Count
NO
If Count = 0
Yes
Stop
Opcode
BE 06 30
BB OC 30
Label
Mnemonic
MOV
MOV
12
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Operand
SI,3006
BX,300C
Comments
Initialize a pointer 1 to source
Initialize a pointer 2 to destination
2006
B9 04 00
MOV
CX,0004
2009
8B 04
MOV
AX,[SI]
200B
200D
2011
2015
2016
89 07
81 EE 02 00
81 EB 02 00
49
75 F1
MOV
SUB
SUB
DEC
JNZ
[BX],AX
SI,0002
BX,0002
CX
L1
2018
CC
INT
03
L1
Initialize count
Transfer a word from source to
destination with overlapping
Update source and destination
pointers
Continue above process till count
=0
Transfer control to monitor
programs
RESULT:-
INPUT:-
3000 1111
3002 2222
3002 2222
3004 3333
3004 - 3333
Start
3006-4444
3006- 1111
3008 - 2222
Initialize pointer 1 to Source
300A 3333
300C - 4444
Initialize Count
NO
Yes
`
PROGRAM:- ( without overlapping)
Address
2000
2003
Opcode
BE 00 30
BB 00 40
Label
Mnemonic
MOV
MOV
14
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Operand
SI,3000
BX,4000
Comments
Initialize a pointer 1 to source
Initialize a pointer 2 to
2006
2009
200B
B9 04 00
8B 04
89 07
MOV
MOV
MOV
CX,0004
AX,[SI]
[BX],AX
200D
2011
81 C6 02 00
81 C3 02 00
ADD
ADD
SI,0002
BX,0002
2015
2016
49
75 F1
DEC
JNZ
CX
L1
2018
CC
INT
03
L1
destination
Initialize count
Transfer a word from source
to destination
Update source and destination
pointers
Continue above process till
count = 0
Transfer control to monitor
programs
RESULT:INPUT:-
3000 1111
3002 2222
4002 2222
3004 3333
4004 - 3333
3006-4444
4006 - 4444
2) Personal Computer
FLOW CHART:START
Get the two numbers and compare them
Is result =0
Display HCF
Is carry = 1
STOP
PROGRAM:-
16
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
ORG
3000
N1 DW 0010
N2 DW 0005
G1 DW 0000
Address Hex code Label
2000
8B 06 00 30
2004
8B 1E 02 30
2008
3B C3
L1
200A
74 13
200C
200E
2011
Mnemonic
Operand
MOV
MOV
AX,@N1
BX,@N2
CMP
JE
AX,BX
L3
JC
MOV
DIV
L2
DX,0000
BX
72 0E
L4
F7 F3
2013
2017
2019
201B
81 FA 00 00
74 09
8B C3
8B DA
201D
201F
2020
2022
2026
EB F5
93
EB F1
89 1E 04 30
CC
L2
L3
CMP
JE
MOV
MOV
DX,0000
L3
AX,BX
BX,DX
JMP
XCHG
JMP
MOV
INT
L1
BX,AX
L4
@G1,BX
03
Comments
Get number 1
Get number 2
If number 1 = number 2 jump to
L3
If number1<number 2 jump to L2
Divide big number by small
number
If remainder = 0 jump to L3
Else remainder = divisor and
divisor = dividend
Jump to L1
Swap the numbers
Unconditional jump to label L4
Save the result
Transfer control to monitor
programs
RESULT:
INPUT:
OUTPUT:
.D3000,3003
.D3004,3005
3000:10 00 05 00
3004: 01 00
AIM:- To write a program to find Least Common Multiplier (LCM) using 8086 P
APPARATUS:1) 8086 P Kit
2) Personal Computer
17
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
FLOW CHART:START
N * dividend
divisor
YES
If reminder
N0
=0
LCM = N* dividend
N= N + 1
STOP
Program:-
18
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
ORG
3000
N1 DW 0010
N2 DW 0005
L1 DW 0000
Address
2000
2004
2008
200A
200D
200F
2013
Hex code
8B 06 00 30
8B 1E 02 30
8B C8
BA 00 00
F7 F3
81 FA 00 00
74 0A
2015
2019
201B
201D
8B 06 00 30
03 C1
8B C8
EB EB
Label
Mnemonic
Operand
MOV
MOV
AX,@N1
BX,@N2
MOV
MOV
DIV
CMP
JE
CX,AX
DX,0000
BX
DX,0000
L2
LN
MOV
ADD
MOV
JMP
Comments
Get number1
Get number2
Save Number 1
Divide number1 by number2
If remainder = 0 jump to L2
AX,@N1
AX,CX
Else multiply number 1 with
CX,AX
iteration count and save
L1
Repeat above division process
201F
2023
89 0E 04 30
CC
L2
MOV
INT
@LN,CX
03
unconditionally
Save the result
Transfer control to monitor
programs
RESULT:
INPUT:
OUTPUT:
.D3000,3003
.D3004,3005
3000:09 00 03 00
3004: 09 00
FIBONACCI SERIES
AIM:- To write a program to find FIBONACCI using 8086 P
APPARATUS:1) 8086 P Kit
19
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
2) Personal Computer
FLOW CHART:-
START
NO
Update count
YES
If count = 0 carry = 1
STOP
PROGRAM:ORG
7000
N1 DW 0010
20
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Address
6000
6003
Hex code
BD 00 50
8B 0E 00
6007
600A
600D
6010
70
B8 01 00
89 46 00
BB 01 00
81 C5 02
6014
6017
6019
00
89 5E 00
03 C3
81 C5 02
601D
6020
6022
6024
6026
6027
Label Mnemonic
Comments
Initialize a pointer
Get the count
MOV
BP,5000
CX,@N1
MOV
AX,0001
MOV
MOV
ADD
[BP],AX
BX,0001
BP,02
MOV
ADD
ADD
[BP],BX
AX,BX
BP,02
00
89 46 00
8B D0
8B C3
8B DA
49
75 EE
MOV
MOV
MOV
MOV
DEC
JNZ
[BP],AX
DX,AX
AX,BX
BX,DX
CX
L1
CC
INT
03
6029
MOV
Operand
L1
RESULT:
INPUT:
7000:10 00
OUTPUT: .D5000,5010
5000:0001 0001 0002 0003 0005 0008 000D
0015 0022
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
FLOW CHART:Start
Initialize pointer
Stop
PROGRAM:Address
2000
2003
2005
Opcode
BB 0040
8B 0F
81 C3 02
2009
200B
00
8B 07
F7 E1
Label
Mnemonic
MOV
MOV
ADD
Operand
BX,4000
CX,[BX]
MOV
MUL
AX,[BX]
CX
22
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
BX,0002
Comments
Initialize pointer
Get a operand 1 from memory
Update pointer
Get a operand 2 from memory
Multiply the operands
200D
81 C3 02
ADD
2011
2013
00
89 07
81 C3 02
MOV
ADD
[BX],AX
2017
2019
00
89 17
CC
MOV
INT
[BX],DX
BX,0002
Save the result in memory
BX,0002
INT 03
RESULT:INPUT:-
4000 1124
4002 1124
DX/4006 0125
Start
Initialize counter = 00
Stop
No
Yes
Opcode
B0 00
9A 52 00 00 FE
E8 19 00
9A 49 00 00 FE
FE C0
9A 52 00 00 FE
E8 0A 00
9A 49 00 00 FE
201E
2020
3C FF
75 ED
Label
L1
Mnemonic
MOV
CALLS
CALL
CALLS
INC
CALLS
CALL
CALLS
Operand
AL,00
OUT_BYTE
DELAY
OUT_BLANK
AL
OUT_BYTE
DELAY
OUT_BLANK
CMP
JNZ
AL,0FF
L1
24
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Comments
Initialize counter = 0
Display the count
Delay to see the count
To provide a blank character
Increment count
Display the count
Delay to see the count
To provide a blank character
`
Repeat the above process till
the count = FF
2022
CC
2023
2026
2028
202A
202C
202D
B9 FF 0F
8B C0
8B DB
8B CO
49
75 F7
202F
DELAY
L2
C3
INT
03
MOV
MOV
MOV
MOV
DEC
JNZ
CX,00FFF
AX,AX
BX,BX
AX,AX
CX
L2
RET
RESULT:INPUT:-
COUNT 00 - FF
start
FLOW CHART:- (Down counter)
Initialize counter = FF
Up data count
Is count = 00
25
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Stop
NO
YES
Opcode
B0 00
9A 52 00 00 FE
E8 19 00
9A 49 00 00 FE
FE C0
9A 52 00 00 FE
E8 0A 00
9A 49 00 00 FE
201E
2020
2022
2023
2026
Mnemonic
MOV
CALLS
CALL
CALLS
DEC
CALLS
CALL
CALLS
Operand
AL,FF
OUT_BYTE
DELAY
OUT_BLANK
AL
OUT_BYTE
DELAY
OUT_BLANK
3C FF
75 ED
CMP
JNZ
AL,00
L1
CC
INT
INT 03
B9 FF 0F
8B C0
Label
L1
DELAY
L2
MOV
MOV
26
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
CX,00FFF
AX,AX
Comments
Initialize counter = FF
Display the count
Delay to see the count
To provide a blank character
Decrement count
Display the count
Delay to see the count
To provide a blank character
`
Repeat the above process
till the count = 00
Transfer control to monitor
programs
Initialize count
6T delay where T = 1/F
2028
202A
202C
202D
202F
8B DB
8B CO
49
75 F7
MOV
MOV
DEC
JNZ
C3
BX,BX
AX,AX
CX
L2
F= 6.144 MHz
2T delay/ decrement count
Repeat above delay till cx=
0000
End of subroutine
RET
RESULT:INPUT:-
COUNT FF- 00
OUT PUT :- FF FD FC FB FA F9 00
2. Personal computer
start
FLOW CHART:- (up counter)
Initialize counter = 0000
Up data count
Is count = FFFF
NO
27
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Stop
YES
Opcode
B8 00 00
9A 6A 00 00 FE
E8 19 00
9A 49 00 00 FE
Label
Operand
AX,0000
OUT_WORD
DELAY
OUT_BLAN
Comments
Initialize counter = 0000
Display the count
Delay to see the count
To provide a blank character
INC
CALLS
CALL
CALLS
K
INC AX
OUT_WORD
DELAY
OUT_BLAN
Increment count
Display the count
Delay to see the count
To provide a blank character
2010
2011
2016
2019
40
9A 6A 00 00 FE
E8 0B 00
9A 49 00 00 FE
201E
2021
3D FF FF
75 ED
CMP
JNZ
K
AX,0FFFF
L1
2023
CC
INT
03
2024
2027
2029
202B
202D
202E
B9 FF 0F
8B C0
8B DB
8B CO
49
75 F7
2030
C3
L1
Mnemonic
MOV
CALLS
CALL
CALLS
DELAY
L2
MOV
MOV
MOV
MOV
DEC
JNZ
RET
28
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
CX,00FFF
AX,AX
BX,BX
AX,AX
CX
L2
`
Repeat the above process
till the count = FFFF
Transfer control to monitor
programs
Initialize count
6T delay where T = 1/F
F= 6.144 MHz
2T delay/ decrement count
Repeat above delay till CX=
0000
End of subroutine
RESULT:INPUT:-
COUNT 0000-FFFF
OUT PUT :- 0001 0002 0003 0004 0005 0006 0007 000A 000B ..FFFF
start
Up data count
YES
Is count = 0000
Stop
29
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
NO
Opcode
B8 FF FF
9A 6A 00 00 FE
E8 19 00
9A 49 00 00 FE
48
9A 6A 00 00 FE
E8 0B 00
2019
Label
L1
9A 49 00 00 FE
Mnemonic
MOV
CALLS
CALL
CALLS
Operand
AX,FFFF
OUT_WORD
DELAY
OUT_BLAN
Comments
Initialize counter = FFFF
Display the count
Delay to see the count
To provide a blank character
DEC
CALLS
CALL
K
AX
OUT_WORD
CALL
Decrement count
Display the count
Delay to see the count
CALLS
DELAY
OUT_BLAN
201E
2021
3D 00 00
75 ED
CMP
JNZ
K
AX,0000
L1
2023
CC
INT
03
2024
2027
2029
202B
202D
202E
2030
B9 FF 0F
8B C0
8B DB
8B CO
49
75 F7
DELAY
L2
C3
MOV
MOV
MOV
MOV
DEC
JNZ
RET
RESULT:INPUT:-
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
CX,00FFF
AX,AX
BX,BX
AX,AX
CX
L2
RET
OUT PUT :- FFFF FFFE FFFD FFFC FFFB FFFA FFF9 0000
8- BIT UP AND DOWN DECIMAL COUNTER
AIM:-Write a assembly language program in 8086 to 8- Bit Up And Down Decimal
Counter
APPARATUS:-
start
Up data count
Is count = 99
Stop
31
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Opcode
B0 00
9A 52 00 00 FE
E8 1A 00
9A 49 00 00 FE
Label
Mnemonic
MOV
CALLS
CALL
CALLS
200F
2011
04 01
27
L1
2012
2017
201A
9A 52 00 00 FE
E8 0A 00
9A 49 00 00 FE
201F
2021
3C 99
75 EC
CMP
JNE
AL,99
L1
2023
CC
INT
03
till count = 99
Transfer control to monitor
2024
B9 FF 0F
MOV
CX,00FFF
programs
Initialize count
2027
2029
202B
202D
202E
8B C0
8B DB
8B C0
49
75 F7
MOV
MOV
MOV
DEC
JNZ
AX,AX
BX,BX
AX,AX
CX
L2
2030
C3
ADD
DAA
CALLS
CALL
CALLS
DELA
Y
L2
Operand
AL,00
OUT_BYTE
DELAY
OUT_BLANK
AL,01
OUT_BYTE
DELAY
OUT_BLANK
RET
RESULT:INPUT:-
COUNT 00- 99
OUT PUT :- 01 02 03 04 05 06 07 08 09 10 11 12 13 99
32
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Comments
Initialize count = 00
Display count
Delay to see count
With blank
Increment the count and
decimal adjust the count
Display count
Delay to see count
With blank
Repeat the above process
start
Initialize counter = 99
Up data count
Is count = 00
Stop
Address
2000
2002
2007
200A
Opcode
B0 00
9A 52 00 00 FE
E8 1A 00
9A 49 00 00 FE
Label
200F
2011
04 01
27
L1
2012
2017
201A
9A 52 00 00 FE
E8 0A 00
9A 49 00 00 FE
201F
2021
3C 99
75 EC
CMP
JNE
AL,00
L1
2023
CC
INT
03
2024
2027
2029
202B
202D
202E
B9 FF 0F
8B C0
8B DB
8B C0
49
75 F7
2030
C3
Mnemonic
MOV
CALLS
CALL
CALLS
SUB
DAS
CALLS
CALL
CALLS
DELAY
L2
MOV
MOV
MOV
MOV
DEC
JNZ
Operand
AL,99
OUT_BYTE
DELAY
OUT_BLANK
AL,01
OUT_BYTE
DELAY
OUT_BLANK
CX,00FFF
AX,AX
BX,BX
AX,AX
CX
L2
RET
Comments
Initialize count = 00
Display count
Delay to see count
With blank
De crement the count and
decimal adjust the count
Display count
Delay to see count
With blank
Repeat the above process till
count = 99
Transfer control to monitor
programs
Initialize count
6T delay where T = 1/F
F= 6.144 MHz
2T delay/ decrement count
Repeat above delay till CX=
0000
End of subroutine
RESULT:INPUT:-
COUNT 99
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
2. Personal computer
PROGRAM:Address
Opcode
Label
Mnemonic
Operand
Comments
RESULT:INPUT:OUTPUT:-
CIRCUIT DESCRIPTION :-
SW1, SW2, SW3 and SW4.The 8255A port A and Port B can be configured in
software as output by using the control word and keeping the switches SW1 and
SW3 in output position and switches SW2 and SW4 will have no effect. Configure
8255A port A as input in software while keeping SW1 in I/P position. After executing
35
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
the program it reads the status of SW2 position. Similarly for port B , configure 8255
A port B as input in software while keeping SW3 in I/P position. After executing the
program it reads the status of SW4 position. 8 RED LEDs are provided to read the
status of PortA and 8 GREEN LEDs are provided to read the status of port B and
YELLOW LEDs are provided to read the signal status mentioned on the interface.
Switches S1 , S2 and S3 are provided to simulate STB* or ACK* signals
in Mode1 and in Mode 2. Provision is made for connecting buffered external
interrupt (RST 7.5 etc.) to J5 and keeping the jumper JP2 at PC0 or PC3 depending on
the type of Mode. The interface has got 4 connectors named as J2 , J3,J4 and P1 . J3
and J4 are reserved for MPS 85-2 trainer and P1 is reserved for ESA 85 -2 trainer. All
the 24 I/) lines are brought out to the J2 connector. But port C lines are used as
handshake signals so user cannot use those lines. ( Only port A and port B lines are
available to user)
8255 A Programes
1. AIM:- To Configure 8255 A Port A and Port B as a output and verify its function
using 8255 interfacing kit
APPARATUS:-
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Opcode
2000
2003
2005
2006
2008
200B
200C
200F
2011
2014
2015
2018
BA C6 FF
B0 80
EE
B0 55
BA C0 FF
EE
E8 0B 00
F6 D0
BA C2 FF
EE
E8 02 00
EB EE
Label
Mnemonic
MOV
MOV
OUT
MOV
MOV
OUT
CALL
NOT
MOV
OUT
CALL
JMP
Operand
DX,0FFC6
AL,80
DX,AL
AL,55
DX,0FFC0
DX,AL
DELAY
AL
DX,0FFC2
DX,AL
DELAY
2008
Comments
Initialize 8255 ports as output
Out put data at Port A
Delay to see Port A content
Invert the data and output this value
at Port B
Introduce Delay and repeat above
process
DELAY
201A
B9 FF FF
MOV
CX,0FFFF
201D
8B C0
L2
MOV
AX,AX
201F
8B DB
MOV
BX,BX
2021
8B C0
MOV
AX,AX
2023
49
DEC
CX
2024
75 F7
JNZ
L2
2026
RET
RESULT:- Port A- 55 , after delay Port B AA
Delay Program
PROGRAM:Address
Opcode
2000
BA C6 FF
Label
Mnemonic
Operand
MOV
DX,0FFC6
37
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Comments
2003
2005
2006
2009
B0 82
EE
BA C2 FF
EC
200A
200C
200F
2010
F6 D0
BA C0 FF
EE
EB F4
L1
MOV
OUT
MOV
IN
AL,82
DX,AL
DX,0FFC2
AL,DX
NOT
MOV
OUT
JMP
AL
DX,0FFC0
DX,AL
L1
Port B as input
Invert the data
Invert data as output at Port A
Repeat the above process
3. AIM:- To Configure 8255A Port A as a input, Port B as a output and verify its
function by
reading port A and complement send it to port B using 8255 Study card
APPARATUS:-
PROGRAM:-
38
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Address
Opcode
2000
2003
2005
BA C6 FF
B0 90
EE
2006
2009
200A
200C
200F
2010
BA C0 FF
EC
F6 D0
BA C2 FF
EE
EB F4
Label
L1
Mnemonic
Operand
MOV
MOV
OUT
DX,0FFC6
AL,90
DX,AL
MOV
IN
NOT
MOV
OUT
JMP
DX,0FFC0
AL,DX
AL
DX,0FFC2
DX,AL
L1
Comments
Initialize 8255 Port B as output,
Port A as input
Read value from Port A
Invert the data
Invert data as Output at Port B
Repeat the above Process
PROGRAM:-
39
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Address
Opcode
Label
2000
2002
2005
B0 B0
BA C6 FF
EE
2006
2009
200A
200D
BA C0 FF
EC
BA C2 FF
EE
200E
EB F6
L1
Mnemonic
Operand
Comments
MOV
MOV
OUT
AL,B0
DX,0FFC6
DX,AL
MOV
IN
MOV
OUT
DX,0FFC0
AL,DX
DX,0FFC2
DX,AL
JMP
L1
RESULT:- :- Reads data from Port A and displays same in port B when S2 is pressed
Ex: - Port A 55, Port B -55
PROGRAM:Address
Opcode
Label
Mnemonic
40
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Operand
Comments
2000
2002
2005
B0 86
BA C6 FF
EE
2006
2009
200A
200D
200E
BA C2 FF
EC
BA C0 FF
EE
EB F6
L1
MOV
MOV
OUT
AL,86
DX,0FFC6
DX,AL
MOV
IN
MOV
OUT
JMP
DX,0FFC2
AL,DX
DX,0FFC0
DX,AL
L1
RESULT:- :- Reads data from Port B and displays same in port A when S2 is pressed
Ex: - Port A 55, Port B -55
in Mode 0 and
verify its function by reading port A and send it to port B & Read at Port A and sent it
Port A LEDDisplays using 8255 Study card
APPARATUS:-
PROGRAM:Address
Opcode
2000
2002
2005
2006
2009
200A
200D
200E
B0 C0
BA C6 FF
EE
BA C0 FF
EC
BA C2 FF
EE
B0 55
Label
L1
Mnemonic
MOV
MOV
OUT
MOV
IN
MOV
OUT
MOV
41
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Operand
Comments
AL,C0
DX,0FFC6
DX,AL
DX,0FFC0
AL,DX
DX,0FFC2
DX,AL
AL,55
2010
2013
2014
BA C0 FF
EE
EB F3
MOV
OUT
JMP
DX,0FFC0
DX,AL
L1
sending it to Port B
Repeat the above process
RESULT:- :Following procedure should be followed for using above program in Mode 2
1. Adjust Dip Switch 1 in on position and Dip Switch 2 in position corresponding to
the data which u want to send as input from port A
2. Adjust Port B as output port by keeping SW3 OFF position
3. The port A value will be displated on the port B by pressing S2
4. Press S3 and hold it. The corresponding Port A LEDs will show 55H. This display
can be changed by changing the operand of MOV AL,55 instruction at memory
location 200E in above program
5. Dont press S1 or S2 switch after putting Dip Switch 1 in OFF position
6. While pressing and holding s3 you can see that the port A working as output port
PROGRAM:Address
Opcode
2000
2002
2005
2006
2008
200B
200C
200F
2011
20114
2015
2018
201A
B0 80
BA C6 FF
EE
B0 0F
BA C6 FF
EE
E8 0B 00
B0 0E
BA C6 FF
EE
E8 02 00
E2 EC
50
Label Mnemonic
L1
DELAY
MOV
MOV
OUT
MOV
MOV
OUT
CALL
MOV
MOV
OUT
CALL
LOOP
PUSH
42
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Operand
Comments
AL,80
DX,0FFC6
DX,AL
AL,0F
DX,0FFC6
DX,AL
DELAY
AL,0E
DX,0FFC6
DX,AL
DELAY
L1
AX
201B
201C
201F
2022
2023
2025
2027
2028
2029
51
B9 30 00
B8 FF 0F
48
72 FD
E2 EC
59
58
C3
L3
L2
PUSH
MOV
MOV
DEC
JNZ
LOOP
POP
POP
RET
CX
CX,0030
AX,0FFF
AX
L2
L3
CX
AX
Delay Program
Note:- 1.To set/ Reset bits in port C , a control word is written in the control register
and not in port C
2. BSR Control word affects only on bit in port C
3. The BSR control word does not affect the I/O mode
THEORY:- The 8279 Study Card provides 6 nos of 8 Digit Seven Segment and
4*4 Matrix Hex Keypad . The keypad includes shift and control keys for key
scanning option. The study card has got two 26 pin (j3 & J4) connectors and a 50Pin (PI) connector for interfacing with different trainers.
Jumpers are provided ont eh study card for encode and decode modes of
operation of 8279
For encode method
Place the jumpers as follows
43
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
JP1 = 1 2
JP2 = 2 3
JP3 = 2 3
JP4 = 1 2
JP5 = 2 3
For encode method
Place the jumpers as follows
JP1 = open
JP2 = 1 2
JP3 = 1 2
JP4 = 2 3
JP5 = 1 2
PROGRAM:-
Opcode
Label
Mnemonic
2000
2003
2005
2006
200B
2010
2013
2016
2017
2019
44
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Operand
Comments
201B
201D
2020
2025
2027
2029
202B
202E
202F
2034
2037
203C
203E
2043
RESULT:-
THEORY:PROGRAM:-
45
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Opcode
Label
Mnemonic
2000
2003
2005
2006
200B
2010
2013
2016
2017
2019
201B
201D
2020
2025
2027
2029
202B
202E
202F
2034
2037
203C
203E
2043
RESULT:-
46
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Operand
Comments
AIM:APPARATUS:-
ORG 2000
S1 ASC DIGITAL VALUE=
N1 DB 00
47
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Address
Opcode
200E
2011
2013
B8 00 00
8E C0
9A 31 00 00
2018
201B
201D
201E
FE
BA E6 FF
B0 82
EE
9A ED 01
2023
2027
2029
00 FE
8D 16 00 20
8B C2
9A 13 00 00
202E
2030
2033
2034
2035
2036
2037
2038
2039
FE
B0 02
BA E0 FF
EE
90
90
90
90
90
B8 01 00
Label
Mnemonic
MOV
MOV
CALLS
MOV
MOV
OUT
START CALLS
Operand
Comments
AX,0000
EX,AX
OUT_CRLF
DX,0FFE6
AL,82
DX,AL
CLR_LCD
Initialize 8255
Port A as O/P & Port B as I/P
LEA
MOV
CALLS
STC
MOV
MOV
OUT
NOP
NOP
NOP
NOP
NOP
MOV
DX,@S1
AX,DX
OUT_STRING
Display message
AL,02
DX,0FFE0
DX,AL
Reset integrator
AX,01
203C
203D
2040
2042
2044
2045
2048
204A
204D
EE
B9 00 10
E2 FE
B0 04
EE
BA E0 FF
B3 00
BA E2 FF
EC
KK
TVAR
OUT
MOV
LOOP
MOV
OUT
MOV
MOV
MOV
IN
DX,AL
CX,1000
KK
AL,04
DX,AL
DX,0FFE0
BL,00
DX,0FFE2
AL,DX
204E
2050
2052
24 01
74 04
FE C3
AND
JE
INC BL
AL,01
DISP
Else increment counter and
continue routine to output
digital value
2054
2056
EB F4
8A C3
DISP
JUM
MOV
TVAR
AL,BL
48
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
2058
9A 52 00 00
CALLS
OUT _BYTE
205D
205F
2062
2063
2066
2069
206B
206C
206E
FE
B0 02
BA E0 FF
EE
BB 03 00
B9 FF 1F
E2 FE
4B
75 F8
EB AE
MOV
MOV
OUT
MOV
MOV
LOOP
DEC
JNZ
JMP
AL,02
DX,0FFE0
DX,AL
BX,03
CX,01FFF
SS
BX
DY
START
DY
SS
Reset integrator
Repeat continously
AIM:APPARATUS:-
THEORY:- The circuit only 17 lines from the connector are used totally. The Port
A and Port B of 8255 programmable peripheral interface are used as output ports.
The digital inputs to the DACs are provided through the port A and port B of 8255 .
The analog outputs of the DACs are connected to the inverting inputs of opamps A
741 which act as current to voltage converters. The outputs from the opamps are
connected to points marked Xout and Yout at which the wave forms are observed on
a CRO. (Port A is used to control Xout and Port B is used to control Y out ) The
reference voltage for the DACs is derived from an on-board voltage regulator A
723 . It generates a voltage of about 8V. The offset balancing of the opamps is done
by making use of the two 10K pots provided. The output waveforms are observed at
Xout and Yout on an oscilloscope.
49
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
PROGRAM:-
Org 2000
S1 ASC DUAL DAC INTERFACE
S2 ASC S-SQUARE WAVE
S3 ASC T TRIANGULAR WAVE
N1 DB 00
Address
Opcode
2031
2034
2036
2038
203B
203D
203E
B8 00 00
8B C8
8E C0
BA E6 FF
B0 80
EE
9A ED 01 00 FE
2043
8D 16 00 20
2047
2049
8B C2
9A 13 00 00 FE
Label
Mnemonic
Operand
MOV
MOV
MOV
MOV
MOV
OUT
CALLS
AX,0000
CS,AX
ES,AX
DX,0FFE6
AL,80
DX,AL
CLR _LCD
LEA
DX,@S1
MOV
CALLS
AX,DX
OUT _STRING
START
Comments
204E
9A A9 00 00 FE
GETKEY
CALLS
GET_CHAR
routine if T jump to
triangle wave routine .
Wait for valid key
2053
2055
2057
2059
205B
205D
2062
2065
2067
3C 53
74 2F
3C 54
74 02
EB F1
9A 31 00 00 FE
B9 FF 00
B0 00
FE C0
TRIANGLE
RPT1
UP
CMP
JE
CMP
JE
JMP
CALLS
MOV
MOV
INC
AL,53
SQUARE
AL,54
TRIANGLE
GETKEY
OUT_CRLF
CX,0FF
AL,00
AL
Set count
Set from 0
Increment data for + ve
going slope & output at
50
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
port A &B
2069
206C
206D
2070
2071
2073
2076
BA E0 FF
EE
BA E2 FF
EE
E2 F4
B9 FF 00
8B C1
2078
FE C8
207A
207D
207E
2081
2082
2084
2086
208B
208D
2090
2091
2094
2095
2098
209A
209C
209F
20A0
20A3
20A4
20A7
20A9
BA E0 FF
EE
BA E2 FF
EE
E2 F4
EB DC
9A 31 00 00 FE
B0 FF
BA E2 FF
EE
BA E2 FF
EE
B9 FF 00
E2 FE
B0 00
BA E0 FF
EE
BA E2 FF
EE
B9 FF 00
E2 FE
EB E0
MOV
OUT
MOV
OUT
LOOP
MOV
MOV
DX,0FFE0
DX,AL
DX,0FFE2
DX,AL
UP
CX,0FF
AX,CX
DEC
AL
MOV
OUT
MOV
OUT
LOOP
JMP
CALLS
MOV
MOV
OUT
MOV
OUT
MOV
LOOP
MOV
MOF
OUT
MOV
OUT
MOV
LOOP
JMP
DX,0FFE0
DX,AL
DX,0FFE2
DX,AL
DOWN
RPT1
OUT_CRLF
AL,0FF
DX,0FFE0
DX,AL
DX,0FFE2
DX,AL
CX,0FF
DLY1
AL,00
DX,0FFE0
DX,AL
DX,0FFE2
DX,AL
CX,0FF
DLY2
RPT2
DOWN
SQUARE
RPT2
DLY1
DLY2
RESULT:-
51
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Repeat continuously
Output FF at ports
Delay
Output 0 at ports
Delay
Repeat continuously
THEORY:- The interface provides a set of six LEDs at each of the four corners of a
four road junction.
The organization of these LEDs is identical at each of the four corners. Hence
for simplicity, the organization is described below with reference to the LEDs at
SOUTH WEST corner only.
52
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
RED
A
R
L
DL
pedestrians
DL
SOUTH
RED
DL
Of these , the first five LEDs will be ON or OFF depending on the state
of the
Corresponding port line ( LED is ON if the port line is Logic HIGH and LED
is OFF if
the port line is Logic LOW). The last one marked as DL is a set of two dual
colour
LEDs and they both will be either RED or GREEN depending on the state of
the
corresponding port line (RED if the port line is Logic HIGH and GREEM if
the port line
is Logic LOW)
53
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
There are four such sets of LEDs and these are controlled by 24 port
lines. Each
port lineis inverted and buffered using 7406 ( open collector inverter buffers)
and is used
to control an LED. Dual colour LEDs are controlled by a port line and its
complement.
The 24 LEDs and their corresponding port lines are summarized below
LED
SOUTH
EAST
NORTH
Port Line
RED
PA3
AMBER
PA2
LEFT
PA0
STRAIGHT
PC3
RIGHT
PA1
PEDESTRIAN
PC6
RED
PA7
AMBER
PA6
LEFT
PA4
STRAIGHT
PC2
RIGHT
PA5
PEDESTRIAN
PC7
RED
PB3
AMBER
PB2
LEFT
PB0
STRAIGHT
PC1
RIGHT
PB1
PEDESTRIAN
PC4
54
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
WEST
RED
PB7
AMBER
PB6
LEFT
PB4
STRAIGHT
PC0
RIGHT
PB5
PEDESTRIAN
PC5
User can assign any meaningful interpretation to these LEDs and then develop
software accordingly . usually , the interpretation would be as follows
Vehicles coming from one direction are controlled by the LEDs at the opposite
corner
For example, vehicles coming from NORTH are controlled by the set of LEDs at the
SOUTH WEST corner , as shown below:
Vehicles coming from NORTH can
Go left ( i.e to EAST ) if SOUTH LEFT LED is ON
Go right ( i.e to WEST) of SOUTH RIGHT LED is ON
Go straight ( i.e to SOUTH) if SOUTH STRAIGHT LED is ON
Further , the above movements are flowed only if SOUTH RED LED is OFF. If
SOUTH RED LED is ON , no movement is allowed for vehicles from north.
Pedestrian crossing on SOUTH is allowed when SOUTH PEDESTRIAN is green
and disallowed when it is red. . It is obvious that, logically some combinations can
not be allowed. For example , SOUTH RED = OFF, SOUTH STRAIGHT = ON
and SOUTH PEDESTRIAN = GREEN is not allowed ( vehicles are allowed to go
from NORTH to SOUTH and pedestrians are allowed to cross on SOUTH) . SOUTH
AMBER can be ON to indicate at SOUTH RED is about to change its status from
OFF to ON.
55
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
RED
AMBER
LEFT
STRAIGHT
RIGHT
PEDESTRIAN
SOUTH
ON
OFF
OFF
OFF
OFF
OFF
ON
ON
OFF
OFF
OFF
OFF
OFF
OFF
OFF
ON
OFF
GREEN
EAST
OFF
RED
NORTH
ON
RED
WEST
OFF
RED
From the correspondence already between the port lines and LEDs , we can now
determine the logic values for each port line. For example, PA) should be Logic
56
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
LOW as SOUTH LEFT RED is OFF. Deterring the values of the other port lines in
similar fashion , we can arrive at the following port values:
PA = 18H
PB = 08H
PC = B5H
User can work out the port values for other situations in a similar way
PROGRAM:
Address
2000
2002
2005
2006
2009
200B
200E
200F
2010
2013
2015
2016
2017
201A
201C
201D
201E
2021
2025
2027
202A
202D
202E
2031
Opcode
B0 80
BA E6 FF
EE
BE 38 20
8A 04
BA E0 FF
EE
46
83 C2 02
8A 04
EE
46
83 C2 02
8A 04
EE
46
E8 09 00
81 FE 56
20
75 E2
E9 DC FF
B9 FF 03
51
B9 FF 03
90
Label
START
AGAIN
NEXTST
DELAY
DLY5
DLY 10
Mnemonic
MOV
MOV
OUT
MOV
MOV
MOV
OUT
INC
ADDW
MOV
OUT
INC
ADDW
MOV
OUT
INC
CALL
Operand
AL,80
DX,0FFE6
DX,AL
SI , 2038
AL,[SI]
DX,0FFE0
DX,AL
SI
DX,02
AL,[SI]
DX,AL
SI
DX,02
AL,[SI]
DX,AL
SI
DELAY
CMP
SI,2056
JNZ
JMP
MOV
PUSH
MOV
NOP
NEXTST
AGAIN
CX,00FF
CX
CX,03FF
57
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Comments
Initialization of 8255 Mode 0
All ports as output
Talbe of port 13
Values
Port A value
Port B value
Port C value
Calling delay routine
Delay routine
2032
2034
2035
2037
E2 FD
59
E2 F6
C3
2038
10 81 7A
203B
44 44 F0
203E
08 11 E5
2041
44 44 F0
2044
81 10 DA
2047
44 44 F0
204A
11 08 B5
204D
44 44 F0
2050
88 88 00
2053
44 44 F0
2056
00
PORT
VALUES
LOOP
POP
LOOP
RET
DB
DLY10
CX
DLY5
10,81,7A
DB 44 44
0F0
DB 08 11
0E5
DB 44 44
0F0
DB 81 10
0DA
DB 44 44
0F0
DB 11 08
0B5
DB 44 44
0F0
DB 88 88
00
DB 44 44
0F0
DB 00
RESULT:-
LOGIC CONTROLLER
58
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
State 1
All ambers ON
State 2
All ambers ON
State 3
All ambers ON
State 4
All ambers ON
State 5
All ambers ON
dummy
AIM:APPARATUS:-
THEORY:- Logic Controller interface consists of 8 TTL inputs and 8 TTL outputs .
The inputs and the outputs are buffered. There are 8 input pins provided on the card.
Each of these can be set to logic 1/logic 0 by setting the DIP switch provided on the
card to ON/OFF positions.
The user can also determine the status of any required signal, by
connecting it to one of the 8 input berg strip pins (IB)-IB7) provided on the card. The
status of output lines of interface are controlled through port A of 8255. There are
two sets of 8 LEDs indicating the status of the input and out put ports. ( If the LED is
ON , the signal is logic 1 and if the LED is OFF, the signal is logic 0)
PROGRAM:-
Opcode
BA E6 FF
2003
B0 02
MOV
AL,82
2005
2006
EE
9A 31 00 00 FE
9A ED 01 00
OUT
CALLS
DX,AL
OUT _CRLF
New line
CALLS
CLR_LCD
Clear LCD
MOV
BX,01
MOV
IN
DX,0FFE2
AL,DX
200B
Label Mnemonic
MOV
FE
2010
BB 01 00
2013
2016
BA E2 FF
EC
DISP
59
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Operand
DX,0FFE6
Comments
Configuring 8255
Initialize port A as output ,
port B as input port
2017
8A D8
MOV
BL,AL
2019
201B
201D
3A DF
74 F6
B8 00 21
CMP
JE
MOV
BL,BH
DISP
AX,2100
2020
9A 13 00 00 FE
CALLS
OUT_STRING
2025
2027
2029
202B
202E
202F
2034
8A C3
8A FB
F6 D0
BA E0 FF
EE
9A 52 00 00 FE
B8 10 21
MOV
MOV
NOT
MOV
OUT
CALLS
MOV
AL,BL
BH,BL
AL
DX,0FFE0
DX,AL
OUT_BYTE
AX,2110
2037
9A 52 00 00 FE
CALLS
OUT_STRING
203C
203E
2043
8A C3
9A 52 00 00 FE
EB CE
MOV
CALLS
JMP
AL,BL
OUT_BYTE
DISP
RESULT:-
60
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
ELEVATOR INTERFACE
AIM:APPARATUS:-
THEORY:-
the request buttons at the four floors. Pressing of a key causes a corresponding FlipFlop to be set. The outputs of the four Flip-Flops can be read through
Port
PROGRAM:-
BA E6 FF
B0 82
EE
33 C0
8A C4
0C F0
BA E0 FF
EE
BA E2 FF
EC
24 0F
3C 0F
74 F9
BE 00 00
D0 C8
73 03
46
EB F9
8A 84 00
2028
202A
202C
202E
21
3A C4
77 0C
72 21
8A 84 04
2032
2035
2036
2038
203B
203D
203F
2041
21
BA E0 FF
EE
EB D0
E8 2B 00
FE C4
86 C4
0C F0
BA E0 FF
FOUND
MOV
MOV
OUT
XOR
MOV
OR
MOV
OUT
MOV
IN
AND
CMP
JZ
MOV
ROR
JNC
INC
JMP
MOV
DX,0FFE6
AL,82
DX,AL
AX,AX
AL,AH
AL,0F0
DX,0FFE0
DX,AL
DX,0FFE2
AL,DX
AL,0F
AL,0F
LOOP2
SI,00
AL,01
FOUND
SI
FINDF
AL,[SI]2100
CLEAR
CMP
JA
JB
MOV
AL,AH
GOUP
GODN
AL,[SI],2104
MOV
OUT
JMP
CALL
INC
XCHG
OR
MOV
DX,0FFE0
DX,AL
LOOP1
DELAY
AH
AL,AH
AL,0F0
DX,0FFE0
LOOP1
LOOP2
FINDF
GOUP
62
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Comments
Configure 8255
Port A as o/p, port B as i/p
Initial stage is ground floor
AH is the floor position
Get request
2044
2045
2047
2049
204B
204D
204F
2052
EE
24 0F
86 E0
3A C4
75 EB
EB DF
E8 14 00
FE CC
2054
2056
2058
205B
205C
205E
2060
2062
2064
2066
86 E0
0C F0
BA E0 FF
EE
24 0F
86 C4
3A C4
75 EB
EB C8
B9 00 08
2069
206B
206D
E2 FE
E2 FE
C3
GODN
OUT
AND
XCHG
CMP
JNZ
JMP
CALL
DEC
DX,AL
AL,0F
AH,AL
AL,AH
GOUP
CLEAR
DELAY
AH
XCHG
OR
MOV
OUT
AND
XCHF
CMP
JNZ
JMP
MOV
AH,AL
AL,0F0
DX,0FFE0
DX,AL
AL,0F
AL,AH
AL,AH
GODN
CLEAR
CX,0800
LOOP
LOOP
RET
HR1
HR2
DELAY
HR1
HR2
RESULT:-
63
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
64
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
STEPPER MOTOR
AIM:APPARATUS:-
THEORY:- The stepper motor interface uses four transistor pairs(SL100 & 2N3055)
in a Darlington pair configuration . Each Darlington pair is used to excite the
particular winding of the motor connected to 4 pin connector on the interface . The
inputs to these transistors are from the 8255 PPI I/O lines of the microprocessor
trainer kit or from digital I/O card plugged in the PC . Port A lower nibbles PA0,
PA1, PA2, PA3 are the four lines brought out to the 26 pin FRC male connector (JI)
on the interface module. The free wheeling diodes across each winding protect
transistors from switching transients .
SPECIFICATION OF THE STEPPER MOTOR USED:
The stepper motor specification is available at the end of the manual. The
motor is reversible on with a torque of 3.5 kg cm. The power requirement is + 5
V/6.6V DC @ 1.2 A current per winding at full torque. The step angle is 1.8* i.e for
every single excitation, the motor shaft rotates by 1.8* . For the motor to rotate one
65
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
full revolution ( 360*) number of steps required is 200, The stepper motor used has
four stator windings which are brought out through colored wires terminated at a 4
pin polarized female connector. The remaining two wires ( usually white & black
wires) are shorted and terminated at 2 pin polarized female connector.
PROGRAM:
Org 2000
S1 ASC ENTER DIRECTION
S2 ASC A- ANTI CLOCKWISE, C- CLOCK WISE
N1 DB 00H
Address
202B
202E
2030
2033
2035
2036
203B
203F
2044
2049
204B
204D
204F
2051
2053
2058
205D
205F
Opcode
B8 00 00
8E C0
BA E6 FF
B0 80
EE
9A ED 01 00 FE
8D 06 00 20
9A 13 00 00 FE
9A A9 00 00 FE
3C 41
74 1D
3C 43
74 02
EB F1
9A 31 00 00 FE
9A 00 00 00 FE
B0 11
BA E0 FF
Label
C10
Mnemonic
MOV
MOV
MOV
MOV
OUT
CALLS
LEA
CALLS
CALLS
CMP
JE
CMP
JE
JMP
CALLS
CALLS
MOV
MOV
66
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
Operand
AX,0000
ES,AX
DX,0FFE6
AL,80
DX,AL
CLR_LCD
AX,@S1
OUT _STRING
GET_CHAR
AL,41
ANTI
AL,41
C10
UP
OUT_CRLF
OUT _CHAR
AL,11
DX,0FFE0
Comments
Initialize segment
registers
Initialize all ports as
ouput
2062
2063
2066
2068
206A
206F
2074
2076
2079
207A
207D
207F
2081
2084
2086
EE
E8 1B 00
D0 D8
EB F8
9A 31 00 00 FE
9A 00 00 00 FE
B0 11
BA E0 FF
EE
E8 04 00
D0 D0
EB F8
B9 00 08
E2 FE
C3
REPEAT
ANTI
REPEAT1
DELAY
SS
OUT
CALL
RCR
JMP
CALLS
CALLS
MOV
MOV
OUT
CALL
RCL
JMP
MOV
LOOP
RET
RESULT:-
67
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL
DX,AL
DELAY
AL,1
REPEAT
OUT _CRLF
OUT _CHAR
AL,11
DX,0FFE0
DX,AL
DEALY
AL,1
REPEAT1
CX,0800
SS
68
ECE VI SEMESTER
MICROPROCESSORS LAB MANUAL