0% found this document useful (0 votes)
135 views

Lab Manual For Microprocessor

The document is a lab manual for a Microprocessor and Microcontroller laboratory course. It contains a list of 12 experiments to be conducted including interfacing an 8-bit DAC and ADC converter with an 8085 microprocessor. It also includes experiments on arithmetic operations, sorting numbers, number conversions between BCD and hexadecimal using an 8085 microprocessor. The document provides algorithms and flowcharts for experiments on 16-bit addition, subtraction, multiplication and division operations.

Uploaded by

Ravi Chandran
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views

Lab Manual For Microprocessor

The document is a lab manual for a Microprocessor and Microcontroller laboratory course. It contains a list of 12 experiments to be conducted including interfacing an 8-bit DAC and ADC converter with an 8085 microprocessor. It also includes experiments on arithmetic operations, sorting numbers, number conversions between BCD and hexadecimal using an 8085 microprocessor. The document provides algorithms and flowcharts for experiments on 16-bit addition, subtraction, multiplication and division operations.

Uploaded by

Ravi Chandran
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

SSN COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING

EE 2356 MICROPROCESSOR & MICRO CONTROLLER LABORATORY

.e

ee

ex

DEC 2011-APRIL 2012

cl u

LAB MANUAL

si

ve

.b l

og

sp ot

.c o

Expt.No. 1 2 3 4 5 6 7 8a 8b 9 10 a 10 b

Name of the experiment 8 bit and 16 bit Arithmetic operations using 8085 Microprocessor Sorting of numbers (Ascending & descending) using 8085 Microprocessor. Number Conversion(BCD to Hex and Hex to BCD) Arithmetic Operations using 8086 Microprocessor

Interfacing 8 bit DAC Converter with 8085 Microprocessor.

Square Wave Generation using 8254 Serial Data Transmission using 8251

.e

ee

ex

11 12

Interfacing 8 bit DAC Converter with 8051 Microcontroller Interfacing of Stepper Motor with 8051 Microcontroller

cl u

si

Finding the smallest and largest number in an array of numbers using 8051 Microcontroller

ve

.b l

Interfacing 8279 with 8085 microprocessor 8 bit Arithmetic operations using 8051 Microcontroller.

og

sp ot

Traffic Light controller using 8085 Microprocessor.

.c o

Interfacing 8 bit ADC Converter with 8085 Microprocessor.

EXPT NO 1 a AIM:

ARITHMETIC OPERATIONS USING 8085

To write the assembly language programs for performing the following arithmetic operations: a) 16 bit binary addition. b) 16 bit binary subtraction. c) 16 bit binary multiplication. d) 16 bit binary division.

APPARATUS REQUIRED: Microprocessor kit, Power supply. PROBLEM STATEMENT:

Write an ALP in 8085 P to add and subtract two 16-bit binary numbers stored in the memory locations 4100 & 4101 and 4102 & 4103 and store the result starting from the memory location 4105H. Also provide an instruction in the above program to observe the carry also and store the carry in the memory location 4104H.

1. 2. 3. 4. 5.

Enter the two 16 bit data in two register pairs HL and DE. Initialize a carry counter register B to zero. Add the contents of register pairs. If a carry is generated, increment the carry counter B. Store the Carry in the B register and the sum, which is in the register pair HL in the memory.

6.

Stop.

Start.

.e

16 BIT ADDITION:

ee

ALGORITHM:

ex

cl u

si

ve

.b l

og

sp ot

.c o

16 BIT SUBTRACTION: 1. 2. 3. 4. 5. 6. Start. Get the two 16 bit data in two of the register pairs. Subtract the Low Order Byte of data1 from that of the data 2. Subtract the How Order Byte of data1 along with borrow from that of the data2. Store the result in memory. Stop.

PROBLEM STATEMENT:

memory locations 4100(LOB) & 4101(HOB) and 4102(LOB) & 4103(HOB) and store the result in the memory location 4104H & 4105H.Write instructions for performing 16-bit division also. 16 BIT MULTIPLICATION. 1. 2. 3. 4. 5. 6. 7. 8. 9. Start.

Initialize BC register pair to store the Carry.

Initialize the HL register pair to zero, to store the result.

16 - BIT DIVISION 1. 1. 2. 3. 4. Start. Store the dividend in HL register pair. Store the divisor in BC register pair Initialize the DE register pair to zero, to carry the quotient. Perform repeated subtraction of divisor from dividend till the dividend is less than the divisor. 5. 6. For every subtraction done, keep on incrementing the quotient register pair DE. Store the remainder pair in memory.

Stop.

Store the contents of the BC register pair which is the carry in memory.

.e

Store the product available in HL pair in memory.

ee

If carry flag is set during addition., increment the carry register pair.

ex

Multiply by repeated addition of data 1 data 2 times.

cl u

si

Store the data 1 and data 2 in DE register pair and SP register.

ve

.b l

og

sp ot

.c o

Write an ALP in 8085 P to multiply two 16-bit binary numbers stored in the

7. 8.

Store the quotient in memory. Stop.

FLOW CHART 16-BIT ADDITION 16-BIT SUBTRACTION


START START LOAD THE TWO NUMBERS

INITIALISE CARRY REGISTER

YES

cl u

si

ANY CARRY

NO

ve

.b l

og

ADD THE TWO NUMBERS

sp ot ex w .e ee
STOP

SUBTRACT THE TWO NUMBERS

.c o

LOAD TWO NOS. IN REGISTER PAIRS

INTIALIZE BORROW REGISTER

NO ANY BORROW?

YES
INCREMENT CARRY REGISTER

INCREMENT CARRY REGISTER

STOP

STORE THE RESULT

STORE THE RESULT

16-BIT MULTIPLICATION

16-BIT DIVISION

START

START

LOAD DIVISOR & DIVIDEND

GET MULTIPLIER AND MULTIPLICAND IN REGISTER PAIRS QUOTIENT = 0

PRODUCT=0000

sp ot ve .b l
NO

og cl u si

REG. PAIR = REG. PAIR + MULTIPLICAND

MULTIPLIER = MULTIPLIER 1

ex

.c o
NO

DIVIDEND = DIVIDEND DIVISOR

QUOTIENT = QUOTIENT + 1

IS DIVIDEND < DIVISOR YES

IS MULTIPLIER = 0?

.e

ee

STORE QUOTIENT

w
YES
STOP

STORE REGISTER PAIR

w
STOP

EXPT NO 2

SORTING of NUMBERS USING 8085 (ASCENDING AND DESCENDING ORDER)

AIM: To write an Assembly Language Program (ALP) to sort a given array of numbers in ascending and descending order. APPARATUS REQUIRED: Microprocessor kit, Power supply.

An array of length 10 is stored from the location starting from 5000H. Sort it into descending and ascending orders and store the resultant starting from the location

a. Start.

b. Load the array count in a register. Initialize a carry flag FF to zero.

e. Repeat the steps c and d till the array is completed. f. Repeat the steps c, d and e till carry flag FF remains Reset. f. Stop

SORTING IN DESCENDING ORDER: a. Start. b. Load the array count in a register. Initialize a Carry Flag FF to zero. c. Get the first two numbers.

ascending order. If swapping is done, set the carry flag FF.

.e

d. Compare the numbers and swap them if necessary so that the two numbers are in

ee

c. Get the first two numbers.

ex

cl u

si

ve

SORTING IN ASCENDING ORDER:

.b l

ALGORITHM:

og

5300H.

sp ot

.c o

PROBLEM STATEMENT:

d. Compare the numbers and swap them so that the two numbers are in descending order. And set the Carry Flag FF. e. Repeat steps c and d till the array is completed. f. Repeat the steps c, d and e till the Carry Flag FF remains Reset. g. Stop. FLOW CHART: ASCENDING ORDER
START

DESCENDING ORDER
START

og

sp ot

INITIALIZE POINTER COUNT = COUNT 1 FLAG = 0

.c o ve .b l
YES

INITIALIZE POINTER COUNT = COUNT 1 FLAG = 0

YES IS POINTER POINTER + 1


NO

IS POINTER POINTER + 1
NO TEMP = POINTER POINTER = POINTER + 1 POINTER + 1 = TEMP FLAG=FLAG+1

si

.e

ee

ex

TEMP = POINTER POINTER = POINTER + 1 POINTER + 1 = TEMP FLAG=FLAG+1

cl u

POINTER = POINTER +1 COUNT = COUNT + 1

POINTER = POINTER +1 COUNT = COUNT + 1

NO

NO

IS COUNT =0

IS COUNT =0 YES

YES NO
IS FLAG = 0 IS FLAG = 0

YES YES STOP STOP

EXPT NO 3

NUMBER CONVERSIONS USING 8085 (BCD TO HEXA AND HEXA TO BCD)

AIM: To write an Assembly language program for converting a two digit BCD number (maximum of 99) to hexadecimal and to convert a hexadecimal number (maximum of FFH) to BCD.

ALGORITHM: CONVERSION OF BCD TO HEXADECIMAL: 1. 2. Start.

unpacked BCD nibbles(BCD1 and BCD2). 3. 4. 5.

2. 3.

Read the hexadecimal number. Initialize a memory location to store the number of 100s. Find the number of 100s and store it in the memory.

4.

Find the number of 10s from the remainder and store it in the next

7.

5.

Stop.

memory location. The remainder now contains the number of 1s and store it in the next memory location.

.e

ee

ex

cl u

1.

Start.

si

CONVERSION OF BCD TO HEXADECIMAL:

ve

Store the result and Stop.

.b l

Add BCD1 to the answer from step3.

og

Multiply BCD2 the most significant nibble, by 10.

sp ot

Separate the given 8 - bit packed BCD number into two 4 bit

.c o

FLOW CHART: BCD TO HEX HEXA TO BCD

START START GET DATA CARRY =0 HUNDREDS =0 TENS=0

GET MOST SIGNIFICANT DIGIT(MSD)

HEX DATA = MSD + LSD (LEAST SIGNIFICANT DIGIT)

sp ot og

.c o
NO IS CARRY =1 ? YES DATA =DATA +100 DATA =DATA - 10 NO IS CARRY =1? YES DATA =DATA -10 UNITS =DATA
STORE HUNDREDS , TENS , UNITS STOP

MSD = MSD x 10

HUNDREDS =HUNDREDS + 1

.e

ee

ex

cl u

START

si

ve

STORE HEX DATA

TENS = TENS + 1

.b l

DATA =DATA -100

EXPT NO: 5

INTERFACING 8 BIT ADC CONVERTER USING 8085

Aim: To obtain the digital output corresponding to the analog input.

Apparatus Required: 1. Microprocessor 8085 Trainer Kit

4. Power Supply +5 V

Algorithm: 1. Start

3. Initialize accumulator

9. Call display subroutine to display digital output 10. Stop.

8. Go to step 4

7. Decrement contents of accumulator

.e

6. If accumulator =0 go to step 5else goto step 9

ee

5. Obtain comparator output to port c.

ex

4. Send contents of accumulator to DAC through port A

cl u

si

output port.

ve

2. Initialize control word of 8255 to enable ports A, B as output ports and port C as

.b l

og

sp ot

.c o

3. Flat Cable Connector

2. Display Interface Kit

Flowchart
START

ACTIVATE THE 8255 CONTROLLER

INITIALIZE ACCUMULATOR

SEND CONTENTS OF ACCUMULATOR TO DAC THROUGH PORT A

og

DECREMENT CONTENTS OF ACCUMULATOR

.e

ee

ex

CALL DISPLAY SUBROUTINE TO DISPLAY DIGITAL OUTPUT

cl u

si

STOP

ve

.b l
NO

IS ACCUMULATOR = 0?

sp ot
YES

OBTAIN COMPARATOR OUTPUT TO PORT C

.c o

EXPT NO: 6

INTERFACING 8 BIT DAC CONVERTER USING 8085

AIM:To generate different types of waveforms by interfacing a DAC with a microprocessor trainer kit.

EQUIPMENT REQUIRED Intel 8085 based MPS 85 2 trainer kit, DAC interface card, 26 pin flat cable connector, CRO with probe. ALGORITHM:-

1. Initialize the control word register i.e., 8255 as input port. 2. Send 00 to port A of 8255 3. Call delay subroutine 4. Send FF to port A of 8255 5. Call delay subroutine 6. Repeat the step 2 onwards. SAW TOOTH WAVE FORM

1. Initialize the control word register.

5. If zero flag is not set then repeat the step 3 onwards, otherwise repeat the step 2 onwards.

.e

4. Increment the accumulator content

ee

3. Send to port A of 8255

ex

2. Initialize the accumulator content

cl u

si

ve

.b l

og

sp ot

.c o

SQUARE WAVE FORM

FLOW CHART: Square Waveform:


START

Saw tooth Waveform:


START

ACTIVATE THE 8255 CONTROLLER

ACTIVATE THE 8255 CONTROLLER

SEND 00 TO PORT A

ACC = 00

og ve .b l

CALL DISPLAY SUBROUTINE

sp ot
NO

SEND FF TO PORT A

.c o cl u si

ACC = ACC + 1

m
IF Z =0

CALL DISPLAY SUBROUTINE

SEND ACC TO PORT A

YES

.e

ee

ex

EXPT. NO:7 TRAFFIC LIGHT CONTROLLER USING 8085 MICROPROCESSOR

AIM:To write an Assembly language Programme for traffic light controller. EQUIPMENT REQUIRED 8085 microprocessor kit and Power Supply. ALGORITHM:-

2. Write the control word to initialize 8255.Obtain the data for

3. Initialize a counter to indicate the number of directions.

6. Decrement the counter and repeat step 3 till counter becomes zero. 7. Stop.

.e

ee

ex

cl u

si

ve

.b l

5. Check the result.

og

4. Initialize HL Pair to the starting address of the data..

sp ot

each direction and store in the memory.

.c o

1. Start.

FLOW CHART

TRAFFIC CONTROLLER

START

Write control word to initialize 8255

Initialize a counter. Initialize HL pair to 9000h

Call Display Program

Introduce a Delay of 4 Seconds

Call Display Program

Introduce a Delay of 4 Sec.

.e

NO
COUNTER = 0?

ee

ex

Decrement the counter

cl u

si

ve

Call Display Program

Introduce a Delay Of 4 Sec.

.b l
YES

og

sp ot

.c o

FLOW CHART DISPLAY PROGRAM

DISPLAY

SEND CONTROL WORD TO ACC FROM MEMORY

OUTPUT THE DATA TO A PORT

INCREMENT HL REG. PAIR CONTENT

SEND CONTROL WORD TO ACC FROM MEMORY

OUTPUT THE DATA TO A PORT

.e

ee

SEND CONTROL WORD FROM MEMORY TO ACC.

INCREMENT HL REG. PAIR CONTENT

ex

OUTPUT THE DATA TO PORT C

cl u

INCREMENT HL REG. PAIR CONTENT

si

RETURN

ve

.b l

og

sp ot

.c o

EXPT. NO. :8 A SQUARE WAVE GENERATION USING 8254

AIM:
To interface 8254 with 8085 microprocessor and generate a square wave

ALGORITHM 1. Start 2. Write control word to initialize 8254 in mode 3 3. Load the LSB of the count and output in channel 0

5. Stop. FLOW CHART

.e

ee

Output the LSB and MSB of the count in channel 0

ex

Write control word to initialize 8254 in mode 3

cl u

si

ve

STOP

.b l
START

og

sp ot

.c o

4. Load the MSB of the count and output in channel 0

EXPT. NO. : 8 B SERIAL DATA TRANSMISSION USING 8251

AIM:
To interface 8251 with 8085 microprocessor and to check the transmission and reception of a character.

ALGORITHM

For transmitting the data

1. Start 2. Write control word to initialize 8254 in mode 3

3. Load the LSB of the count and output in channel 0

4. Load the MSB of the count and output in channel 0

7. Read the data from the data register 8. Store the data to a memory location

9. Stop

.e

ee

ex

cl u

For Receiving the data

si

ve

6.

Output the data to be transmitted to data register and enable an interrupt.

.b l

5. Write mode instruction word and command instruction word for 8251.

og

sp ot

.c o

FLOW CHART For transmitting the data

START

Write control word to initialize 8254 in mode 3

Output the LSB and MSB of the count in channel 0

ee

ex

.e

cl u

si

Output the data in data register

ve

STOP

.b l

instruction word for 8251

og

Write mode instruction word and command

sp ot

.c o

FLOW CHART For receiving the data

START

Read the data from data register

.e

ee

ex

cl u

si

ve

.b l

og

STOP

sp ot

.c o

Store the data in memory location

EXPT. NO. :9 INTERFACING 8279 WITH 8085 MICROPROCESSOR

AIM:
To interface 8279 with 8085 microprocessor and display the rolling message HELP US

ALGORITHM 5. Start

6. Load the HL pair with the starting address of the message to be displayed

7. Initialize 8279

.e

ee

ex

cl u

12. Stop.

si

11. Repeat until counter becomes 0.

ve

10. Increment the pointer and decrement the counter.

.b l

9. Call delay.

og

8. Output the data from memory to the data register

sp ot

and initialize a counter.

.c o

FLOW CHART

START

Load the HL pair with the starting address of the

message to be displayed and

initialize a counter.

Initialize 8279 and Output the data from memory to

Call Delay SUBROUTINE

ee

ex

cl u

No

.e

si

Increment the pointer Decrement the counter

ve

Is the counter value 0


Yes

.b l

og

sp ot

the data register

.c o

EXPT NO 10 a

8 BIT ARITHMETIC OPERATIONS USING 8051

AIM: To write the assembly language programs for performing the following arithmetic operations: a) b) c) d) 8 bit binary addition. 8 bit binary subtraction. 8 bit binary multiplication. 8 bit binary division.

Microcontroller kit.

PROBLEM STATEMENT:

Write an ALP in 8051 c to perform 8-bit arithmetic operations for the numbers stored in the memory location 4500H and 4501H and store the result in the memory location 4600H.Also provide an instruction in the above program to consider

4. 5. 6. 7. 8. 9.

10.

Store date 2 in B register. Load the data pointer with external memory address Add the contents of B register to that of the accumulator. If a carry is generated, increment the carry counter. Store the contents of the Accumulator, which is the sum in memory. Move the carry register contents to Accumulator and store the same in memory. Stop.

3.

Store data 1 in accumulator.

2.

Initialize carry register to zero.

.e

1.

Start

ee

8 BIT ADDITION:

ex

ALGORITHMS:

cl u

si

the carry also and store the carry in the memory location 4601H.

ve

.b l

og

sp ot

.c o

APPARATUS REQUIRED:

. exe i

8 BIT SUBTRACTION: 1. 2. 3. 4. 5. 6. 7. 8. Start Initialize Barrow register to zero. Store data 1 in accumulator and date 2 in B register respectively. Subtract the contents of B register to that of the accumulator. Load the data pointer with external memory address If a borrow is generated, increment the borrow counter. Store the contents of the Accumulator, which is the difference in memory. Move the barrow register contents to Accumulator and store the same in

9.

Stop.

8 BIT MULTIPLICATION: 1. Start. 2. 3. 4. 5. 6. 7.

Move the A and B register contents to the memory Stop.

8 BIT DIVISION:

2. 3. 4. 5. 6. 7.

1.

Start.

Store data 1 in register Accumulator. Store data 2 in register B. Load the data pointer with external memory address Divide A and B register Move the A and B register contents to the memory Stop.

.e

ee

ex

cl u

Multiply A and B register

si

Load the data pointer with external memory address

ve

Store data 2 in register B.

.b l

Store data 1 in register Accumulator.

og

sp ot

.c o

memory.

FLOWCHART: 8-BIT ADDITION


START

8-BIT SUBTRACTION
START

SET UP COUNTER (CARRY)

SET UP COUNTER (CARRY) GET FIRST OPERAND TO A

GET FIRST OPERAND TO B

.b l

og

sp ot

GET SECOND OPERAND TO A

.c o cl u
YES

m
SUBTRACT SECOND OPERAND FROM MEMORY YES ANY CARRY? A=A+B

si

ve

NO

ee

ex

IS THERE ANY CARRY

COUNTER = COUNTER + 1

STORE THE SUM

NO

.e

COUNTER = COUNTER + 1

STORE THE DIFFERENCE

STORE THE CARRY

STORE THE CARRY

STOP

STOP

8-BIT MULTIPLICATION

8-BIT DIVISION
START

START

GET MULTIPLIER IN A AND MULTIPLICAND IN B register

GET DIVIDEND IN A AND DIVISOR IN B register

Load Data Pointer with External Memory Address

og cl u si ve .b l

sp ot
Load Data Pointer with External Memory Address Move the content of A and B to external Address
Move the content of A and B to external Address

STOP

.e

ee

ex

.c o

Multiply the content of A and B register

Divide the content of A and B register

STOP

EXPT NO 10 b

FINDING THE SMALLEST AND LARGEST NUMBER IN AN ARRAY OF NUMBERS USING 8051

AIM: To write Assembly Language Programs (ALP) to find the maximum and minimum of an array of numbers. APPARATUS REQUIRED: Microcontroller Kit PROBLEM STATEMENT:

An array of length 10 is stored from the location starting from 4600H. Sort it into descending and ascending orders and store the resultant starting from the location

FINDING THE SMALLEST NUMBER OF THE ARRAY:

4. Compare the numbers and swap them if necessary so that the two numbers are

5. Repeat the steps 3 and 4 till the array is completed. 6. Repeat the steps 3, 4 and5 and store the smallest number.. 7. Stop

in descending order.

.e

ee

3. Get the first two numbers.

ex

2. Load the array count in a register.

cl u

1. Start.

si

ve

.b l

ALGORITHM:

og

4700H.

sp ot

.c o

FINDING THE LARGEST NUMBER OF THE ARRAY: 1. Start. 2. Load the array count in a register. 3. Get the first two numbers. 4. Compare the numbers and swap them so that the two numbers are in ascending order. 5. Repeat steps 3 and 4 till the array is completed.

memory.
7.

Stop.

.e

ee

ex

cl u

si

ve

.b l

og

sp ot

.c o

6. Repeat the steps 3, 4 and 5 and store the largest number as the result in

FLOW CHART: FINDING THE MINIMUM AND MAXIMUM NUMBER OF AN ARRAY


START

START

INITIALIZE POINTER COUNT = COUNT 1

INITIALIZE POINTER COUNT = COUNT 1

sp ot

.c o ve .b l og
NO

IS POINTER POINTER + 1
NO

YES

YES

IS POINTER POINTER + 1
NO

TEMP = POINTER POINTER = POINTER + 1 POINTER + 1 = TEMP

TEMP = POINTER POINTER = POINTER + 1 POINTER + 1 = TEMP

si

.e

IS COUNT =0

ee

NO

ex

cl u

POINTER = POINTER +1 COUNT = COUNT + 1

POINTER = POINTER +1 COUNT = COUNT + 1

IS COUNT =0 YES

YES

STORE THE POINTER RESULT

STORE THE POINTER RESULT

STOP STOP

EXPT. NO: 11
INTERFACING DAC CONVERTER USING 8051 AIM:To generate different types of waveforms by interfacing a DAC with a microcontroller.

EQUIPMENT REQUIRED Intel 8051 based MPS 85 2 trainer kit, DAC interface card, 26 pin flat cable connector, CRO with probe.

ALGORITHM:SQUARE WAVE FORM

SAW TOOTH WAVE FORM

2. Initialize the accumulator content 3. Send to port A of 8255 4. Increment the accumulator content 5. If zero flag is not set then repeat the step 3 onwards, otherwise repeat the step 2 onwards.

1. Initialize the control word register.

.e

ee

6. Repeat the step 2 onwards.

ex

5. Call delay subroutine

cl u

4. Send FF to port A of 8255

si

3. Call delay subroutine

ve

2. Send 00 to port A of 8255

.b l

1. Initialize the control word register i.e., 8255 as input port.

og

sp ot

.c o

FLOW CHART: Square Waveform:


START

Saw tooth Waveform:


START

SEND 00 TO PORT A

og ve .b l cl u si

CALL DISPLAY SUBROUTINE

SEND FF TO PORT A
CALL DISPLAY SUBROUTINE

sp ot
NO

ee

ex

.c o
ACC = 00

ACTIVATE THE 8255 CONTROLLER

ACTIVATE THE 8255 CONTROLLER

SEND ACC TO PORT A

ACC = ACC + 1

m
IF Z =0

.e

YES

EXPT. NO. :12

INTERFACING STEPPER MOTOR USING 8051


AIM: To write an assembly language program for running stepper motor and test.

APPARATUS REQUIRED: Microcntroller Kit, power supply, Stepper motor interface

ALGORITHM: 1. Start. 2. 3. 4. 5. 6. Get the number of times the motor has to be rotated. Initialize the port and store data into accumulator.

Drive the stepper motor circuitry and introduce delay

Decrement the counter and repeat step 4 until zero is reached.

.e

ee

ex

cl u

si

ve

.b l

Stop.

og

sp ot

.c o

FLOW CHART STEPPER MOTOR CONTROLLER

START

INITIALIZE COUNTER TO NO. OF PULSES

ACTIVATE THE 8255 CONTROLLER

LOAD THE SEQUENCE IN A

GET THE DATA FOR NEXT SEQUENCE

INTRODUCE A DELAY OF 2 SECONDS

NO

.e

ee

DECREMENT THE COUNTER BY 1.

ex

cl u

COUNTER = 0?

YES

si

STOP

ve

.b l

og

OUTPUT THE DATA IN ACC. TO PORT

sp ot

.c o

You might also like