MPMC-LAB-MANUAL_compressed
MPMC-LAB-MANUAL_compressed
Engineering
Name : ……………………………………
Reg. No. : …………………………………….
Branch : ……………………………………
Year & Semester : ……………………………………
1
DMICE/EEE EE8681 Microprocessor and Microcontroller Laboratory
SYLLABUS
OBJECTIVES:
LIST OF EXPERIMENTS:
2
DMICE/EEE EE8681 Microprocessor and Microcontroller Laboratory
3
DMICE/EEE EE8681 Microprocessor and Microcontroller Laboratory
4
DMICE/EEE EE8681 Microprocessor and Microcontroller Laboratory
INDEX
5
DMICE/EEE EE8681 Microprocessor and Microcontroller Laboratory
6
DMICE/EEE EE8681 Microprocessor and Microcontroller Laboratory
8085 Microprocessor
Programs
7
DMICE/EEE EE8681 Microprocessor and Microcontroller Laboratory
FLOW CHART:
START
Stop
8201
8200 8202
8201
8
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To add two 8 bit numbers stored at consecutive memory location using 8085
microprocessor without carry.
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
ADDRESS LABEL PNEUMONIC OPCODE COMMENTS
RESULT:
9
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOWCHART:
START
IF
THERE
No Yes
INCREMENT C REGISTER
STOP
10
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To add two 8-bit numbers stored at consecutive memory location using 8085
microprocessor with carry.
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
ADDRESS LABEL PNEMONICS OPCODE COMMENTS
11
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8201 8203
8200 8202
8201 8203
12
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
RESULT:
13
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
Start
Stop
8200
8202
8201
14
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To subtract two 8 bit data’s stored at memory location without carry using 8085
microprocessor
APPARATUS REQUIRED:
PROGRAM:
ADDRESS LABEL PNEUMONIC OPCODE COMMENTS
RESULT:
15
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOWCHART:
START
NO
If
there
Yes
Increment register C
Stop
16
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To subtract two 8-bit numbers stored at consecutive memory location using 8085.
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
17
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8201 8203
8200 8202
8201 8203
18
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
810C 81
810D INRC 0C Increment C register
810E LOOP STA 8202 32 Store the result from accumulator
810F 02
8110 82
8111 MOV A,C 79 Move Borrow from C to A
8112 STA 8203 32 Store carry value from accumulator
8113 03
8114 82
8115 HLT 76 Stop the program
RESULT:
19
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
START
If There Is
Carry
No Yes
Increment C Register
Stop
20
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To add two 16 bit numbers stored at consecutive memory location using 8085
microprocessor with carry.
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
21
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8201 8301
8202 8302
8203
22
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
RESULT:
23
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOWCHART:
START
If
there No
Yes
Increment register B
Stop
24
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To subtract two 16-bit numbers stored at consecutive memory location using 8085.
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
25
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8201 8301
8202 8302
8203
26
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
811A 83
811B HLT 76 Stop the program
RESULT:
27
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOWCHART:
START
If CF =1 NO
Yes
Decrement C reg. by 1
If ZF =0
NO YES
Display result
Display carry
Stop
28
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To multiply two 8-bit numbers stored at consecutive memory location using 8085
microprocessor.
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
29
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8200 8202
8201 8203
30
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
RESULT:
31
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
Start
Compare A and M
NO
If
YES
A A-B
Display C (quotient) of A
(Remainder)
Stop
32
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
APPARATUS REQUIRED:
8085 microprocessor kit
Opcode sheet
ALGORITHM:
1. Start the program by loading HL register pair with address of memory location.
2. Move the data to a register (B-register).
3. Get the second data and load into accumulator.
4. Compare the two numbers (A &B reg.) to check for carry, if carry present go to step 8.
5. Subtract the two numbers (A &B reg.).
6. Increment the value of C register for quotient.
7. If ZF=0, then repeat the step 4.
8. Store the value of remainder and Quotient in memory location.
9. Terminate the program.
PROGRAM:
ADDRESS LABEL PNEUMONIC OPCODE COMMENTS
33
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8200 8202
8201 8203
34
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
RESULT:
35
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
Start
YES
If zero flag is not set (ZF =
NO
Stop
36
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
37
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8200 ( count)
8201
8202
8300
8203
8204
8205
38
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
IN
81P0U7T & OUT
LPooUpT TABU LA
INTXIOHN: 23 Increment HL Pair
810B 81
810C MOV A,M 7E Set the new values at Large
8113 83
8114 HLT 76 Stop the program.
RESULT:
39
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
Start
YES If
NO
YES
If
zero
Stop
40
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To write and execute the program of largest in an array of data using 8085 microprocessor
APPRAISE REQUIRED:
ALGORITHM:
PROGRAM:
41
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8200 (count)
8201
8300
8202
8203
8204
42
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
RESULT:
43
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
START
MOVE M TO C REG.
DECREMENT C REG.
MOVE M TO B
MOVE C TO D REG.
MOVE A TO M
ENTER DATA MEMORY
DECREMENT M
COMPARE A and M
NO MOVE B TO M
IF CF=1
YES INCREMENT M
DECREMENT D by 1
IF ZF=O YES
NO
DECREMENT C REG.
YES
IF ZF=O
NO
DISPLAY RESULT IN MEMORY
STOP
44
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
45
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8201 8201
8202 8202
8203 8203
8204 8204
46
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8113 INX H 23
RESULT:
47
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
START
MOVE M TO C REG.
DECREMENT C REG.
MOVE M TO B
MOVE C TO D REG.
MOVE A TO M
ENTER DATA MEMORY
DECREMENT M
COMPARE A and M
NO MOVE B TO M
IF CF=0
YES INCREMENT M
DECREMENT D by 1
IF ZF=O YES
NO
DECREMENT C REG.
YES
IF ZF=O
NO
DISPLAY RESULT IN MEMORY
STOP
48
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
APPARATUS REQUIRED:
ALGORITHM:
1. Initialize the HL pair as memory pointer
2. Move the count to C-register
3. Decrement the count
4. Copy the count in D-register
5. Load the address of the element in HL pair
6. Move the first data in A- register from memory, which is pointed by HL pair.
7. Increment the HL pointer
8. Compare the content of the memory with Accumulator
9. If they are out of order exchange the contents of A register and memory
10. Decrement D-register content by 1
11. Repeat step 9 and10 till the value in D register becomes Zero
12. Decrement C-register content by 1
13. Repeat steps 4-12 till the value in C register becomes Zero
PROGRAM:
ADDRESS LABEL PNEMONICS OPCODE COMMENTS
49
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8201 8201
8202 8202
8203 8203
8204 8204
50
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8113 INX H 23
RESULT:
51
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
Star
Call sub routine to get ASCII lower nibble into Hexa decimal lower nibble
Store it in memory
Move B to A register and mark lower nibble into Hexa decimal Upper nibble
Store it in memory
Stop
52
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To write and execute the program for convert ASCII to HEXA DECIMAL number using
8085 microprocessor.
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
53
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Memory Memory
Input data Output data
address address
8201
8200
8202
54
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
RESULT:
55
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART
Start
YES
If
NO
Stop
56
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To convert given character (HEXA) in to its equivalent ASCII using 8085 microprocessor
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
57
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8200 8201
58
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
RESULT:
59
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
START
STOP
60
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To convert two BCD numbers in memory to its equivalent HEXA number using 8085
microprocessor.
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
61
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8150 8152
8151
62
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
RESULT:
63
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
START
STOP
64
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To convert given HEXA decimal number into its equivalent BCD number using 8085
microprocessor.
APPARATUS REQUIRED:
8085 microprocessor kit
Opcode sheet
ALGORITHM:
1. Initialize memory pointer to 8100H
2. Get the hexadecimal number in C register
3. Perform repeated addition for C number of times
4. Adjust for BCD in each step
5. Store the BCD data in memory
PROGRAM:
65
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8150 8151
8152
66
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
RESULT:
67
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
68
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8051 Microcontroller
Programs
69
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
Start
NO
If
YES
Move 01 to R0 Register
Stop
69
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
70
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8101 8500
8103
8101 8500
8103
71
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8109 85
810A 00
810B MOVX @DPTR , A FO Store the sum in memory
810C INC DPTR A3 Increment DPTR
810D MOV A,RO E8 Move RO to A
810E MOVX @DPTR , A FO Store the Carry in memory
810F LOOP1 SJMP LOOP1 80 Stop the program
8110 FE
RESULT:
72
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
Start
Stop
8101 8500
8103
8101 8500
8103
73
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
8106 00
8107 MOV @DPTR , A FO Carry is stored
8108 LOOP STMP LOOP 80 Short jump
RESULT:
74
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
Start
Multiply B and A
Increment DPTR
Stop
8104 8501
8101 8500
8104 8501
75
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To perform 8-bit multiplication by using 8051 microcontroller
APPARATUS REQUIRED:
PROGRAM:
76
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
Start
Divide A by B
Increment DPTR
Stop
8104 8501
8101 8500
8104 8501
77
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To performs the 8-bit division using 8051 microcontroller
APPARATUS REQUIRED:
78
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
Start
NO
If
YES
Increment R1 Register
No
If
Yes
Store the Carry in Memory
Stop
79
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
80
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8200 8500
8201
8202 8501
8203
8204
8205
81
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8118 00
8119 MOV A,R1 E9 Move R1 to A
811A MOVX @DPTR , A F0 Store the Carry in memory
811B INC DPTR A3 Increment DPTR
811C MOV A,B E5 Move B to A
811D F0
811E MOVX @DPTR , A F0 Store the Sum in memory
811F LOOP1 SJMP LOOP1 80 Stop the program
8120 FE
RESULT:
82
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
83
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
INTERFACING
PROGRAMS
84
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
Start
NO
If count
YES
85
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To run stepper a stopper motor at despises speed in two directions using 8051
microcontroller.
APPARATUS REQUIRED:
THEORY:
A motor in which the rotor is able to assume only discrete stationery angular position is a
stepper motor. The rotary motion occurs in a stepwise manner from an equilibrium position to the
next. Stepper motor are widely used in (simple position control systems in the open closed loop
mode)a verity of application such as complete peripherals (printers, disk drive etc)and in the areas
of process control machine tools, medicine numerically controller machine robotics.
ALGORITHM:
PROGRAM:
86
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8200 08 02
8201 01 04
8202 04 01
8203 02 08
87
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
RESULT:
88
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
Start
Initialize 8279
Decrement count
NO
If
YES
For Example d c b a h g f e
0 1 1 0 1 0 0 0 -- 68H
89
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
90
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
INPUT:
INPUT INPUT DATA
ADDRESS
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
815A
815B
815C
815D
815E
815F
OUTPUT
8109 MVI A, CC 3E
810A CC
810B OUT C2 D3
810C C2
810D MVI A, 90 3E Write display
810E 90
810F OUT C2 D3
8110 C2
8111 LOOP MOV A,M 7E
8112 OUT C0 D3
8113 C0
8114 CALL DELAY CD Call delay Subroutine
8115 1F
91
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
8116 81
8117 INX H 23 Increment the memory pointer
8118 DCR D 15 Decrement counter
8119 JNZ LOOP C2 Jump if no zero to loop
811A 11
811B 81
811C JMP START C3 For Rolling the Display
811D 00
811E 81
811F DELAY MVI B, A0 06 Delay Subroutine
8120 A0
8121 LOOP1 MVI C,FF 0E
8122 FF
8123 LOOP2 DCR C 0D
8124 JNZ LOOP2 C2
8125 23
8126 81
8127 DCR B 05
8128 JNZ LOOP1 C2
8129 21
812A 81
812B RET C9
RESULT:
92
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
Start
If C≠0
If B
≠0
Stop
93
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
APPARATUS REQUIRED:
ALGORITHM:
Provide green signal for road 1, green signal for pedestrian on road 4, red signal for other
roads and other pedestrian 6secs
Put Yellow signal for road 1, and maintain other signals in the previous state for 3 sacs.
Provide green signal for road 2, green signal for pedestrian on road 1, red signal for other
roads and other pedestrians for 6 sacs.
Put yellow signal for road 2, and maintain other signals in the previous state for 3secs
Provide green signal for road 3, green signal for pedestrian on road 2, red signal for other
roads and other pedestrians for 6secs.
94
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
ROAD 1:
ROAD 2:
ROAD 3:
ROAD 4:
95
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Put yellow signal for road 3, and maintain other signals in the previous state for 3 sacs
Provide green signal for road 4, green signal for pedestrian on road 3, red signal for other
roads and other pedestrians for 6 sacs.
Put yellow signal for road 4, and maintain other signals in the previous state for 3 sacs.
Stop the process.
PROGRAM:
96
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
For 6 seconds
PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 Hoax decimal
value
0 1 1 0 0 1 0 1 65 ( PA)
1 0 0 1 0 0 1 0 92(PB)
0 0 1 0 1 0 0 0 28(PC)
0 0 0 0 0 1 1 0 06 (time delay)
INPUT DATA
97
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
98
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
99
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
RESULT:
10
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
START
NO
If
YES
Jump Start
STOP
101
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
APPARATUS REQUIRED:
ALGONTHM:
PROGRAM:
102
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
DAC 0800 is an 8-bit DAC and the output voltage varies in between -5v and +5v. The
output voltage varies in steps of 10/256 =0.04 (approx) the digital data inputs and the
corresponding output voltage are presented in the following table.
V TABULATION:
t(ms)
OUTPUT:
103
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
RESULT:
104
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOWCHART:
Start
Stop
For Example d c b a h e g f
0 1 0 0 1 0 0 1 -- 49H
105
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To write an assembly level language program to interface A to D converter using 8085
microprocessor.
APPARATUS REQUIRED:
THEORY:
The A/D Conversion is a quantizing process whereby an analog signal is represented by
equivalent binary states. This is opposite to b/a conversion process. Analog – to- digital converters
can be classified in two general group based on the conversion technique. One technique involves
comparing a given analog signal with the internally generated equivalent signal. This group
includes successive approximation, counter and flash hypes converters. The second technique
involves changing an analog into or frequency and comparing these new parameters against known
values this group includes integrator converters and voltage to frequency converters the tradeoff
between the two techniques is based on accuracy Vs speed. The successive approximation and the
flash hope are faster but generally lees accurate than the in territory and the voltage to frequency
hype converters.
ALGORITHM:
106
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Hex
Memory 7 segment Value
Data d c b a h e g f
Address display (i/p
data)
8200 0 0 0 0 0 1 0 1 0 0A
8201 1 1 0 0 1 1 1 1 1 9F
8202 2 0 1 0 0 1 0 0 1 49
8203 3 0D
8204 4 9C
8205 5 2C
8206 6 28
8207 7 8F
107
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
PROGRAM
108
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Hex
Memory 7 segment
Data d c b a h e g f Value
Address display
(i/p data)
8208 8 08
8209 9 8C
820A A 88
820B B 38
820C C 6A
820D D 19
820E E 68
820F F E8
109
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
RESULT:
110
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
111
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
To write a program to transmit the data 55 using serial port Interface 8251
APPARATUS REQUIRED:
ALGORITHM
PROGRAM:
112
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
113
8108 MVI A , 00 3E Clear the Accumulator
8109 00
810A OUT CHANNEL 0 D3 Output the control word to 8251 SPI
810B C0
810C MVI A , 00 3E Clear the Accumulator
810D 00
810E OUT USARTCONT D3 Output the control word to 8251 SPI
810F CA
8110 OUT USARTCONT D3 Output the control word to 8251 SPI
8111 CA
8112 OUT USARTCONT D3 Output the control word to 8251 SPI
8113 CA
8114 MVI A , 40 3E Move data 04 to accumulator
8115 40
8116 OUT USARTCONT D3 Output the control word to 8251 SPI
8117 CA
8118 MVI A , 4E 3E Move data 4 E to Accumulator
8119 4E
811A OUT USARTCONT D3 Output the control word to 8251 SPI
811B CA
811C MVI A , 37 3E Move data 37 to Accumulator
811D 37
811E OUT USARTCONT D3 Output the control word to 8251 SPI
811F CA
8120 TXDNRDY IN USARTCONT DB Input the USARTCONT to SPI
8121 CA
8122 ANI 04 E6 Logical AND with Acc and 04
8123 04
8124 JZ TXDNRDY CA Jump on zero to TXDNRDY label
8125 20
8126 81
8127 MVI A , 55 3E Move data 55 to Accumulator
8128 55
8129 OUT USARTDATA D3 Output the control word to 8251 SPI
812A C8
812B RXNRDY IN USARTCONT DB Input the USARTCONT to SPI
112
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
812C CA
812D ANI 02 E6 Logical AND with Acc and 02
812E 02
812F JZ RXNRDY CA Jump on zero to RXNRDY label
8130 2B
8131 81
8132 IN USARTCONT DB Input the USARTCONT to SPI
8133 C8
8134 STA 8500 32 Store the data in 8500
8135 00
8136 85
8137 HLT 76 Stop the Program.
8128 8500
113
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
RESULT:
114
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
FLOW CHART:
START
Clear accumulator
Increment A
YES
If A
NO
Jump Start N
t(ms)
OUTPUT:
115
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
Apparatus Required:
8051 microcontroller
Opcode sheet
DAC Interface Board
ALGORITHM:
PROGRAM:
116
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
MICROCONTROLLER
117
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
18. INTERFACING A TO D CONVERTER USING 8051
Date:
AIM:
Apparatus Required:
8051 microcontroller
Opcode sheet
ADC Interface Board
PROGRAM:
RESULT:
119
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
ALGORITHM:
120
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Verification:
LOOKUP TABLE
121
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
BA4F 1050
B6A3 1100
B2F8 1150
AF4D 1200
ABA2 1250
A7F7 1300
A44C 1350
A0A1 1400
9CF6 1450
994B 1500
95A0 1550
91F5 1600
8E4A 1650
8A9F 1700
86F4 1750
8349 1800
7F9E 1850
7BF3 1900
7848 1950
749D 2000
70F2 2050
6D47 2100
699C 2150
65F1 2200
6246 2250
5E9B 2300
122
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
5AF0 2350
5745 2400
539A 2450
4FEF 2500
RESULT:
123
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Ex. No.:
AIM:
Requirement:
Procedure:
Interface the MP/MC kit with AC Motor speed controller board using 26 pin
FRC cable provided.
Switch ON the Trainer
Type the Program given below in the memory location with the starting
address 8100H.
124
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
Execute the following program and observe that the output voltage at
DAC1.Change the value in A and observe the corresponding output voltage
at DAC1. Give Digital input for the speed required at 8107H in hex.
125
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
PROGRAM:
ORG8100H
MOV
8102 90 E0 1B DPTR,#E01BH
;DAC1 address in
8108 90 E0 18 MOV DPTR,#E018H DPTR
126
DillCEIEEE EE6612 Microprocessor and Microcontroller Laboratory
MODEL GRAPH:
MOTOR SPEED
(RPM)
7000
-
-
-
0 1 2 3 4 5
128
DMICE/EEE EE6612 Microprocessor and Microcontroller Laboratory
DATA TABLE:
00 0.00 20000
01 0.04 -
02 0.08 -
. . .
. . .
7F 2.50 -
. . .
. . .
FE 4.96 -
FF 5.00 0
RESULT:
126