MP LAB MANUAL Saw Tooth Gen
MP LAB MANUAL Saw Tooth Gen
NAME :…………………………………………
REG.NO :…………………………………………
BATCH :…………………………………………
1
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
DO’S
DONT’S
2
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
HARDWARE REQUIREMENTS:
ATTENDANCE : 5 MARKS
TOTAL : 20 MARKS
UNIVERSITY EXAMINATION
The Exam will be conducted for 100 marks. Then the marks will be converted to 80 marks.
ALLOCATION OF MARKS
PROGRAM : 30 MARKS
EXECUTION : 30 MARKS
3
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
ANNAUNIVERSITY,CHENNAI
CS2259-MICROPROCESSOR AND MICROCONTROLLER LAB
LIST OF EXPERIMENTS
4
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
CONTENTS
No.
Ex. No Name of the Experiment
Page
1. Programs for 8-bit arithmetic operations using 8085 5
5
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
6
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
7
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 5E 4202 2A
4201 3A 4203 00
e) Result:
8
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
9
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 07 4202 86
4201 4A 4203 39
e) Result:
Thus the program for 8-bit Multiplication was implemented and verified
successfully.
10
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
11
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 C9 4202 14
4201 0A 4203 01
e)
Result:
Thus the program for 8-bit Division was implemented and verified successfully.
12
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
13
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 54 4204 E6
4201 C2 4205 4C
4202 92 4206 01
4203 8A 4207 -
e) Result:
Thus the program for 16-bit Addition was implemented and verified successfully.
14
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
15
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 Ab 4204 7F
4201 B2 4205 20
4202 2c - -
4203 92 - -
e) Result:
16
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
17
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
INPUT OUTPUT
4200 24 4204 48
4201 5A 4205 4B
4202 C2 4206 44
4203 47 4207 19
e) Result:
Thus the program for 16-bit Multiplication was implemented and verified
successfully.
18
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
19
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 07 4200 07
4201 AB 4201 34
4202 92 4202 4F
4203 84 4203 69
4204 4F 4204 84
4205 69 4205 92
4206 F2 4206 AB
4207 34 4207 F2
e) Result:
Thus the program for ascending order was implemented and verified successfully.
20
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
21
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 07 4200 07
4201 C4 4201 F4
4202 84 4202 E2
4203 9A 4203 C4
4204 7B 4204 B2
4205 E2 4205 9A
4206 F4 4206 84
4207 B2 4207 78
e) Result:
Thus the program for descending order was implemented and verified successfully.
22
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
23
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 07
4201 62
4202 7D
4203 FC 4300 FC
4204 24
4205 C2
4206 0F
4207 92
e) Result:
Thus the program to find the largest data in an array is constructed and verified
successfully.
24
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
25
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 07
4201 42
4202 3A
4203 1C 4300 1C
4204 24
4205 B4
4206 25
4207 4F
e) Result:
Thus the program to find the smallest data in an array is constructed and verified
successfully.
26
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
27
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
410E 80 ADD B
410F 00 DCR C
4110 C2 0E 41 JNZ REP
4113 47 MOV B,A Save the product in B reg
4114 7B MOV B,E Get the BCD data in A reg
4115 E6 0F ANI 0FH Mask the upper nibble
4117 80 ADD B Get the sum of contents digit and the
product in B reg
4118 32 01 42 STA 4250H Save the Binary value in memory
411B 76 HLT Terminate the program
d) Output:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 45 4250 2D
e) Result:
Thus the program for BCD to Binary Conversion using 8085 was executed and
verified successfully.
28
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
410D 1C INR E
410E C3 06 41 JMP HUND Compare whether the content of A is less
than 0AH or 10
29
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 B9 4250 85
4251 01
e) Result:
Thus the program for Binary to BCD Conversion using 8085 was executed and
verified successfully.
30
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
c) Program:
31
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
4111 07 RLC
4112 07 RLC
4113 CD 1A 41 CALL CODE Call subroutine to get ASCII code
4116 32 02 42 STA 4202H Upper nibble in A store in memory
4119 76 HLT
411A FF 0A CODE CPI 0AH If the content of A is less than 0AH then
add 30H to A else add 37H to A reg
411C 0A 21 41 JC SKIP
411F C6 07 ADI 07H
4121 C6 30 SKIP ADI 30H
4123 C9 RET Return to main program.
d) Output:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4200 E4 4201 34
4202 45
e) Result:
Thus the program for ASCII code to Binary value Conversion using 8085 was
executed and verified successfully.
32
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
c) Program:
33
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
4200 07 4300 01
4201 31 4301 0B
4202 42 4302 05
4203 35 4303 0F
4204 46 4304 0C
4205 43 4305 09
4206 39 4306 08
4207 38 - -
e) Result:
Thus the program for Binary to ASCII code Conversion using 8085 was executed
and verified successfully.
34
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
c) Program:
35
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
36
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
37
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
1100 24 1200 48
1101 5A 1201 4B
1102 C2 1202 A4
1103 47 1203 19
e) Result:
Thus the program for 16-bit multiplication using 8086 was executed and verified
successfully.
5. Define T-State.
T-State is defined as one subdivision of the operation performed in one clock period. These
subdivisions are internal states synchronized with the system clock, and each T-State is precisely
equal to one clock period.
38
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
Thus the program for 8-bit addition using 8051 was executed and verified
successfully.
39
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
Thus the program for 8-bit subtraction using 8051 was executed and verified
successfully.
40
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
c) Program:
d) Output:
41
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
42
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
Thus the program for 8-bit division using 8051 was executed and verified
successfully.
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.
43
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
Experiment Number: 8
Title of the experiment : KEYBOARD AND DISPLAY INTERFACING USING 8279
44
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
HELP US
e) Result:
Thus the program for 8279 keyboard interfacing was executed and verified successfully.
45
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
INPUT OUTPUT
Port A Port B
11101001 11101001
e) Result:
Thus the interfacing 8255 using Mode 0 was executed and verified successfully.
46
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
c) Program:
d) Output:
INPUT OUTPUT
Port A DISPLAY
e) 01010101 55
Result:
Thus the interfacing 8255 using Mode 1 was executed and verified successfully.
47
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
4105 A B
Port C 1010 1011
e) Result:
Thus the interfacing 8255 using Mode 2 was executed and verified successfully.
48
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
Experiment Number: 10
Title of the experiment : ADC INTERFACING
Date of the experiment :
49
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
Thus the ADC interfacing program was executed and verified successfully.
50
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
51
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
Amp
Time
Amplitude Time
10V 60ms
e) Result:
Thus the program for square wave generation was executed and verified
successfully.
2. Define accuracy.
A comparison of actual output voltage with expected output is called accuracy.
3. Define monotonicity.
A converter is said to have good monotonicity if it does not miss any step backward when
stepped through its entire range by a counter.
52
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
Amp
Time
Amplitude Time
10V 60ms
e) Result:
Thus the program for sawtooth wave generation was executed and verified successfully.
53
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
Amp
54
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
Time
Amplitude Time
10V 60ms
55
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
c) Program:
56
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
57
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
c) Program:
d) Output:
A Reg Speed Accumalator
FF High 5V
7F Medium 3V
55 Low 2V
e) Result:
Thus the program to control the speed of DC motor was executed and verified
successfully.
QUESTIONS AND ANSWERS:
1. 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.
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.
58
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
Experiment Number: 13
Title of the experiment : Program to find square and cube of a number
Date of the experiment :
c) Program:
Input Output
Square 4h 10h
Cube 4h 40h
e) Result:
Thus the program to find square and cube of a given number using 8086
sucessfully.
QUESTIONS AND ANSWERS:
1. 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.
59
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
Experiment Number: 14
Title of the experiment : Program to find LCM of a given number
Date of the experiment :
c) Program:
60
Dr NNCE IT / IV‐SEM MP&MC LAB‐LM
d) Output:
Input Output
0A, 04 02
e) Result:
Thus the program to find LCM of a given number using 8086 sucessfully.
61