Ee3413-Mpmc Record
Ee3413-Mpmc Record
Name :
Register No. :
BONAFIDE CERTIFICATE
LIST OF EXPERIMENTS
8085 EXPERIMENTS
8051 EXPERIMENTS
8bit data addition
5a
8bit data subtraction
5b
5c
8bit data multiplication
5d
8bit data division
6
ASCII to Hexadecimal conversion
8
Interfacing stepper motor with 8051
microcontroller
9
Displaying a moving/ rolling message in the
student trainer kit’s output device
10
Programming PIC architecture with software tools
EXP.NO 1 (a) 8-BIT DATA ADDITION
Date:
AIM:
To add two 8-bit numbers stored at consecutive memory locations and also to verify
the result.
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
INPUT
9500
9501
OUTPUT
9502
RESULT:
1
EXP. NO: 1 (b) 8- BIT SUBTRACTION
Date:
AIM:
To write an assembly language for subtracting two 8-bit numbers by using microprocessor kit.
APPARATUS REQUIRED:
ALGORITHM:
INPUT
9500
9501
OUTPUT
9502
RESULT:
2
EXP.NO: 1 (c) 8- BIT MULTIPLICATION
Date:
AIM:
To write an assembly language for multiplying two 8-bit numbers by using microprocessor kit.
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
INPUT
9500
9501
OUTPUT
9502
RESULT:
3
EXP.NO: 1 (d) 8- BIT DIVISION
Date:
AIM:
To write an assembly language for dividing two 8-bit numbers by using microprocessor kit.
APPARATUS REQUIRED:
ALGORITHM:
PROGRAM:
ADDRESS OP CODE MNEMONICS
9000 3A 01 95 LDA 9501
9003 47 MOV B, A
9004 3A 00 95 LDA 9500
9007 0E 00 MVI C, 00
9009 B8 CMP B
900A DA 12 90 JC 9012
900D 90 SUB B
900E 0C INR C
900F C3 09 90 JMP 9009
9012 32 03 95 STA 9503
9015 79 MOV A, C
9016 32 02 95 STA 9502
9019 76 HLT
INPUT
9500
9501
OUTPUT
9502 (Quotient)
9503 (Remainder)
RESULT:
4
EXP.NO: 2(a) LARGEST ELEMENT IN AN ARRAY
Date:
AIM:
To find the largest element in an array of data stored in memory and also to verify the
result.
APPARATUS REQUIRED:
ALGORITHM:
1. Start the program.
2. Place all the elements of an array in the consecutive memory locations.
3. Fetch the first element from the memory location and load it in the accumulator.
4. Initialize a counter (register) with the total number of elements in an array.
5. Decrement the counter by 1.
6. Increment the memory pointer to point to the next element.
7. Compare the accumulator content with the memory content (next element).
8. If the accumulator content is smaller, then move the memory content
(largest element) to the accumulator. Else continue.
9. Decrement the counter by 1 and repeat steps 5 to 8 until the counter reaches zero
10. Store the result (accumulator content) in the specified memory location.
11. Stop the program.
5
PROGRAM:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
9500 9600
9501
9502
9503
9504
RESULT:
6
EXP.NO: 2(b) SMALLEST ELEMENT IN AN ARRAY
Date:
AIM:
To find the smallest element in an array of data stored in memory and also to verify the result.
APPARATUS REQUIRED:
ALGORITHM:
1. Start the program.
2. Place all the elements of an array in the consecutive memory locations.
3. Fetch the first element from the memory location and load it in the accumulator.
4. Initialize a counter (register) with the total number of elements in an array.
5. Decrement the counter by 1.
6. Increment the memory pointer to point to the next element.
7. Compare the accumulator content with the memory content (next element).
8. If the accumulator content is smaller, then move the memory content (largest
element) to the accumulator. Else continue.
9. Decrement the counter by 1 and repeat steps 5 to 8 until the counter reaches zero
10. Store the result (accumulator content) in the specified memory location.
11. Stop the program
7
PROGRAM:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
9500 9600
9501
9502
9503
9504
RESULT:
8
EXP.NO: 2(c) SORTING AN ARRAY OF DATA IN ASCENDING ORDER
Date:
AIM:
To sort the given numbers in the ascending order using 8085 microprocessor.
APPARATUS REQUIRED:
ALGORITHM:
9
PROGRAM:
INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
9500 05
9501 9501
9502 9502
9503 9503
9504 9504
9505 9505
RESULT:
10
EXP.NO: 2(d) SORTING AN ARRAY OF DATA IN DESCENDING ORDER
Date:
AIM:
To sort the given numbers in the descending order using 8085 microprocessor.
APPARATUSREQUIRED:
ALGORITHM:
11
PROGRAM:
INPUT OUTPUT
MEMORY DATA MEMORY DATA
LOCATION LOCATION
9500 05
9501 9501
9502 9502
9503 9503
9504 9504
9505 9505
RESULT:
12
EXP.NO: 2(e) CODE CONVERSION-DECIMAL TO HEXADECIMAL
Date:
AIM:
ALGORITHM:
13
PROGRAM:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
9500 9501
RESULT:
14
EXP.NO: 2(f) CODE CONVERSION-HEXADECIMAL TO DECIMAL
Date:
AIM:
To write an assembly language program to convert a given hexadecimal number to decimal number
and also to verify the result.
APPARATUS REQUIRED:
ALGORITHM:
15
PROGRAM:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
9500 9501
9502
RESULT:
16
EXP.NO: 2(g) CODE CONVERSION–HEXADECIMAL TO ASCII
Date:
AIM:
To write an assembly language program to covert the given Hexadecimal number into its
APPARATUS REQUIRED:
ALGORITHM:
17
PROGRAM:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
9500 9501
9502
RESULT:
18
EXP.NO: 2 (h) CODE CONVERSION–ASCII TO HEXADECIMAL
Date:
AIM:
To write an assembly language program to covert the given ASCII number into its Hexadecimal
APPARATUS REQUIRED:
ALGORITHM:
19
PROGRAM
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
9500 9501
Result:
20
EXP.NO 3 (a) INTERFACING ANALOG TO DIGITAL CONVERTER
Date:
AIM:
To write an assembly language program to convert an analog signal into a digital
signal using an ADC interfacing.
APPARATUS REQUIRED:
PROBLEM STATEMENT:
The program is executed for various values of analog voltage which are set with the help
of a potentiometer. The LED display is verified with the digital value that is stored in a memory
location.
THEORY:
An ADC usually has two additional control lines: the SOC input to tell the ADC when to
start the conversion and the EOC output to announce when the conversion is complete. The
following program initiates the conversion process, checks the EOC pin of ADC 0809 as to
whether the conversion is over and then inputs the data to the processor. It also instructs the
processor to store the converted digital data at RAM location.
ALGORITHM:
PROGRAM:
21
9003 3E 18 MVI A, 18 Load accumulator with value for ALE
low
9005 D3 C8 OUT C8 Send through output port
9006 3E 01 MVI A, 01 Store the value to make SOC high in
the accumulator
9008 D3 00 OUT 00 Send through output port
9009 AF XRA A
900A AF XRA A Introduce delay
900B AF XRA A
900C 3E 00 MVI A, 00 Store the value to make SOC low the
accumulator
900E D3 D0 OUT D0 Send through output port
900F 14 INR D
9010 E6 01 ANI 01 Read the EOC signal from port
&check for end of conversion
9012 FE 01 CPI 01
RESULT:
22
EXP.NO 3 (b) INTERFACING DIGITAL TO ANALOG CONVERTER
Date:
AIM:
PROBLEM STATEMENT:
The program is executed for various digital values and equivalent analog voltages are
measured and also the waveforms are measured at the output ports using CRO.
THEORY:
Since DAC0800 is an 8bit DAC and the output voltage variation is between–5v and
+5v. The output voltage varies in steps of10/256 =0.04 (approximately). The digital data input
and the corresponding output voltages are presented in the table. The basic idea behind the
generation of waveforms is the continuous generation of analog output of DAC. With 00 (Hex)
as input to DAC2 the analog output is –5v. Similarly with FF H as input, the output is +5v.
Outputting digital data 00 and FF at regular intervals, to DAC2, results in a square wave of
amplitude 5v. Output digital data from 00 to FF in constant steps of 01 to DAC2. Repeat this
sequence again and again. As a result, a saw-tooth wave will be generated at
DAC2output.Output digital data from 00 to FF in constant steps of 01 to DAC2.Output digital
data from FF to 00 in constant steps of 01 to DAC2.Repeat this sequence again and again. As a
result, a triangular wave will be generated at DAC2 output.
ALGORITHM:
Waveform generation:
Square Waveform:
1. Send low value (00) to the DAC.
2. Introduce suitable delay.
23
3. Send high value to DAC.
4. Introduce delay.
5. Repeat the above procedure.
Saw-tooth waveform:
1. Load low value (00) to accumulator.
2. Send this value to DAC.
3. Increment the accumulator.
4. Repeat step (2) and (3) until accumulator value reaches FF.
5. Repeat the above procedure from step 1.
PROGRAM:
Measurement of Analog Voltage
PROGRAM COMMENTS
DIGITALDATA ANALOGVOLTAGE
FF 5V
00 0V
Triangular waveform:
24
PROGRAM: SQUARE WAVE
ADDRESSS OPCODE PROGRAM COMMENTS
25
9004 0C INR C Increment contents of
accumulator
9005 C2 02 90 JNZ 9002 Send through output port until it
reaches FF
9008 0E FF MVI C, FF Load FF in accumulator
9009 7D MOV A, L Move contents of L to A
900A D3 C8 OUT C8 Send through output port
900B 0D DCR C Decrement contents of
accumulator
900C C2 09 90 JNZ 9009 Send through output port until it
reaches 00
900F C3 00 90 JMP 9000 Go to starting location
MODELGRAPH:
Triangular waveform
Amplitude
26
RESULT OF WAVEFORM GENERATION:
Square Waveform
Saw-tooth
waveform
Triangular
waveform
RESULT:
27
EXP.NO 3(c) TRAFFIC LIGHT CONTROLLER-
INTERFACING PPI 8255 WITH 8085
Date:
AIM:
To design traffic light controller using 8085 microprocessor through programmable
Peripheral interface 8255.
APPARATUS REQUIRED:
8085pkit, 8255 Interface board, DC regulated power supply, VXT parallel bus,
Traffic light controller interface board.
I/O MODES:
MODE0–SIMPLEI/O MODE:
This mode provides simple I/O operations for each of the three ports and is suitable for
synchronous data transfer. In this mode all the ports can be configured either as input or output
port.
Let us initialize port A as input port and port B as output port
Control Word:
28
PROGRAM:
29
MODE1 STROBED I/OMODE:
In this mode, port A and port B are used as data ports and port C is used as control
signals for strobed I/O data transfer.
Let us initialize port A as input port inmode1
BSRMODE (Bit Set Reset mode)
Any lines of port c can be set or reset individually without affecting other lines using this mode.
Let us set PC0 and PC3 bits using this mode.
ALGORITHM
1. Start
2. Write the control word to initialize 8255.Obtain the data for each direction and store in
the memory.
3. Initialize a counter to indicate the number of directions.
4. Initialize HL Pair to the starting address of the data.
5. Check the result.
6. Decrement the counter and repeat step3 till counter becomes 0
7. Stop
RESULT:
30
EXP.NO 4 STEPPER MOTOR INTERFACING WITH 8085
Date:
AIM:
To operate stepper motor by interfacing with 8085 microprocessor.
THEORY:
Stepper Motor
A stepper motor is a device that translates electrical pulses into mechanical movement in steps of
fixed step angle.
The stepper motor rotates in steps in response to the applied signals.
It is mainly used for position control.
It is used in disk drives, dot matrix printers, plotters and robotics and process control circuits.
Structure
Stepper motors have a permanent magnet called rotor (also called the shaft) surrounded by a stator.
The most common stepper motors have four stator windings that are paired with a center-tap. This
typeofsteppermotoriscommonlyreferredtoasafour-phaseorunipolarsteppermotor. The center tap
allows a change of current direction in each of two coils when a winding is grounded, thereby
resulting in a polarity change of the stator.
Interfacing
Even a small stepper motor requires a current of 400 mA for its operation. But the ports of the
microcontroller cannot source this much amount of current. If such a motor is directly connected to
the microprocessor/microcontroller ports, the motor may draw large current from the ports and
damage it. So, a suitable driver circuit is used with the microprocessor/microcontroller to operate the
motor.
Motor Driver Circuit (ULN2003)
Stepper motor driver circuits are available readily in the form of ICs.ULN2003 is one such driver
IC
Motor Driver Circuit (ULN2003)
Stepper motor driver circuits are available readily in the form of ICs. ULN2003 is one such driver
IC which is a High-Voltage High-Current Darlington transistor array and can give a current of
500mA.Thiscurrent is sufficient to drive a small stepper motor. Internally, it has protection diodes
used to protect the motor from damage due to back emf and large eddy currents. So, thisULN2003
is used as a driver to interface the stepper motor to the microprocessor.
31
Operation
The important parameter of a stepper motor is the step angle. It is the minimum angle through
which the motor rotates in response to each excitation pulse. In a four phase motor if there are 200
steps in one complete rotation then then the step angle is 360/200 = 1.8O . So to rotate the stepper
motor we have to apply the excitation pulse. For this the controller should send a hexadecimal code
Through one of its ports. The hexcode mainly depends on the construction of the stepper motor.
So, all the stepper motors do not have the same Hex code for their rotation. (refer the operation
manual supplied by the manufacturer.)
For example , let us consider the hex code for a stepper motor to rotate in clockwise direction is 77H
,BBH, DDH and EEH. This hex code will be applied to the input terminals of the driver through
the assembly language program. To rotate the stepper motor in anti-clockwise direction the same
code is applied in the reverse order.
32
33
PROGRAM:
9200 09
05
06
0A
34
PROCEDURE:
1. Enter the above program starting from location 4100 and execute the same.
RESULT:
35
EXP.NO 5 (a) 8-BITADDITION
Date:
AIM:
To write a program to add two 8-bit numbers using 8051 microcontroller and also
to verify the result.
APPARATUS REQUIRED:
ALGORITHM:
36
PROGRAM:
OUTPUT
MEMORYLOCATION DATA
9500
RESULT:
37
EXP.NO 5 (b) 8-BITSUBTRACTION
Date:
AIM:
To perform subtraction of two 8 bit data using the 8051 microcontroller and store
the result in memory.
APPARATUS REQUIRED:
ALGORITHM:
38
PROGRAM:
OUTPUT
MEMORY LOCATION DATA
9500
RESULT:
39
EXP.NO 5 (c) 8-BITMULTIPLICATION
Date:
AIM:
To perform multiplication of two 8 bit data using 8051 microcontroller and to store
the result in memory.
APPARATUSREQUIRED:
ALGORITHM:
40
PROGRAM:
Data1:04
Data2:02
OUTPUT
MEMORY LOCATION DATA
9500
9501
RESULT:
41
EXP.NO 5 (d) 8-BIT DIVISION
Date:
AIM:
To perform division of two 8 bit data using 8051 microcontroller and to store the result
in memory.
APPARATUS REQUIRED:
ALGORITHM:
42
PROGRAM:
Data1:08
Data2:02
OUTPUT
MEMORY LOCATION DATA
9500 (Remainder)
9501 (Quotient)
RESULT:
43
EXP.NO 6 ASCII TO HEXADECIMAL CONVERSION
Date
AIM:
To add two 8 bit numbers stored at consecutive memory locations and also to verify
the result.
APPARATUS REQUIRED:
ALGORITHM:
1. Initialize R0 with number which is required to find equivalent Hexadecimal number code.
44
PROGRAM:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
RESULT:
45
EXP.NO 7 (a) INTERFACING DAC WITH 8051
Date:
AIM:
To interface DAC with 8051to demonstrate the generation of square wave, triangular
wave and saw tooth wave
APPARATUSREQUIRED:
ALGORITHM:
SQUAREWAVEGENERATION:
1. Move the port address of DAC to DPTR
2. Load the initial value 00 to accumulator and move it to DAC
3. CALL THE DELAY PROGRAM
4. Load the final value FF to accumulator and move it to DAC
5. Call the delay program
6. Repeatsteps2to5
SAWTOOTH WAVEGENERATION:
1. Move the port address of DAC to DPTR
2. Load the initial value 00 to accumulator
3. Move the accumulator content to DAC
4. Increment the accumulator content by1.
5. Repeat Steps 3 and 4
46
TRIANGULAR WAVE GENERATION
1. Move the port address of DAC to DPTR
2. Load the initial value (00)to Accumulator
3. Move the accumulator content to DAC
4. Increment the accumulator content by 1.
5. If accumulator content is zero proceed to next step. Else go to step 3.
6. Load value(FF) to Accumulator
7. Move the accumulator content to DAC
8. Decrement the accumulator content by 1.
9. If accumulator content is zero go to step2.Else go to step 7.
PROGRAM:
47
(B) SAWTOOTH WAVE GENERATION
RESULT:
48
EXP.NO 7(b) TRAFFIC LIGHT CONTROLLER –INTERFACING WITH 8051
Date:
AIM:
To design traffic light controller using 8051 microcontroller
APPARATUSREQUIRED:
8051 kit, DC regulated power supply, Traffic light controller interface board.
ALGORITHM:
1. Start.
2. Write the data for each direction and load it into theP0
3. Initialize a counter to indicate the number of directions.
4. Call the delay program and repeat the process.
PROGRAM:
RESULT:
49
EXP.NO 8 STEPPER MOTOR INTERFACING WITH 8051
Date:
AIM:
To operate stepper motor by interfacing with8051 microcontroller.
THEORY:
A motor in which the rotor is able to assume only discrete stationary angular position is
a stepper motor. The rotary motion occurs in a step-wise manner from one equilibrium position
to the next. Stepper Motors are used very wisely in position control systems like printers, disk
drives, process control machine tools, etc.
The basic two-phase stepper motor consists of two pairs of stator poles. Each of the four
poles has its own winding. The excitation of any one winding generates a North Pole. A South
Pole gets induced at the diametrically opposite side. The rotor magnetic system has two end
faces. It is a permanent magnet with one face as South Pole and the other as North Pole.
The Stepper Motor windings A1,A2, B1, B2 are cyclically excited with a DC current to
run the motor in clockwise direction. By reversing the phase sequence as A1, B2, A2, B1,
anticlockwise stepping can be obtained.
ANTICLOCKWISE CLOCKWISE
STEP A1 A2 B1 B2 DATA STEP A1 A2 B1 B2 DATA
1 1 0 0 1 9h 1 1 0 1 0 Ah
2 0 1 0 1 5h 2 0 1 1 0 6h
3 0 1 1 0 6h 3 0 1 0 1 5h
4 1 0 1 0 Ah 4 1 0 0 1 9h
The 74138 chip is used for generating the address decoding logic to generate the device
select pulses, CS1&CS2forselectingtheIC74175.The74175latchesthedatabustothestepper motor
driving circuitry.
Stepper Motor requires logic signals of relatively high power. Therefore, the interface
circuitry that generates the driving pulses use silicon darlington pair transistors. The inputs for
the interface circuit are TTL pulses generated under software control using the Microcontroller
Kit. The TTL levels of pulse sequence from the data bus is translated to high voltage output
pulses using a buffer 7407 with open collector.
50
PROGRAM:
Mnemonics
Address Label Operand Comments
ORG 4100h
51
PROCEDURE:
1. Enter the above program starting from location 4100 and execute the same. The
stepper motor rotates.
2. By varying the countatR4 andR5can vary the speed.
3. By entering the data in the look-up TABLE in the reverse order can vary
direction of rotation.
RESULT:
52
EXP.NO 9 DISPLAYING A MOVING/ ROLLING MESSAGE USING 8051
Date:
AIM:
To display a moving/rolling message "WELCOME" using the 8051 microcontroller.
APPARATUS REQUIRED:
8051 kit, DC regulated power supply, Traffic light controller interface board.
PROGRAM:
This table outlines an assembly language program for displaying a moving/rolling message
"WELCOME" using the 8051 microcontroller. It initializes the memory locations with the
characters of the message, then continuously moves the message across the display.
53
ALGORITHM:
1. Start.
2. Initialize the memory locations with the ASCII codes for each character of the message
"WELCOME".
3. Set the starting position on the display to the first character of the message.
4. Enter a loop to continuously display the moving message.
5. Move the current display position to the accumulator.
6. Move the character from the memory location pointed by the memory pointer to
the current displayposition.
7. Increment the display position to move the message.
8. Move the display position leftwards to create the effect of a moving message.
9. Increment the memory pointer to point to the next character of the message.
10. Check if the end of the message has been reached.
11. If not, repeat the loop by jumping back to step 4.
12. If the end of the message has been reached, reset the memory pointer to the beginning of
the message.
13. End the program.
OUTPUT:
RESULT:
54
EXP.NO 10 . PROGRAMMING PIC ARCHITECTURE WITH SOFTWARE TOOLS.
Date:
AIM:
To create an assembly language program for a PIC microcontroller using MPLAB X IDE
that blinks an LED connected to pin RB0 in a continuous loop.
APPARATUS REQUIRED:
ALGORITHM :
55
PROGRAM:
This table provides a structured representation of the assembly language program for the PIC
microcontroller, including memory addresses, opcodes , labels, mnemonics, operands, and
comments.
RESULT :
56