Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

PROGRAM:

MNEM
ADDRESS OPCODES LABEL OPERAND COMMENTS
ONICS
ORG 4100h
Load the start address of
switching scheme data
4100 START MOV DPTR, #TABLE
TABLE into Data
pointor (DPTR)

4103 MOV R0, #04 Load the count in R0

Load the number in


4105 Loop MOVX A, @DPTA
TABLE into A
4106 PUSH DPH Push DPTA value to
4108 PUSH DPL Stack
DPTR, # Load the motor port
410A MOV
OFFCoh address into DPTA

Send the value R in A to


410D MOV X @DPTR, A stepper motor port
address
410E MOV R4, #OFFh
DELA
4110 MOV R5, #OFFh Delay loop to cause
Y!
specific amount of time
DELA
4112 DJNZ R5, DELAY delay before next data
Y1!
item is sent to the motor
4114 DJNZ R4, DELAY
4116 POP DPL POP back DPTR value
4118 POP DPH from stack
Increment DPTR to point
411A INC DPTR
to next item in the table

Decrement Ro, if not


411B DJNZ RO, LOOP
zero repeat at the loop

Short jump to start of the


411D SJMP START program to make the
motor rotate continuous

Values as per two phase


411F TABLE DB OAH,06,05,04
switching scheme

PROCEDURE:

1. Enter the above program starting from location 4100 and execute the same.
2. The Stepper motor rotates.
3. Varying the count R4 and R5 can vary the speed.
4. Entering the data in the look-up table in the reverse order can vary direction of
rotation.
RESULT:

Thus a stepper motor was interacted with 8051 and run in forward and reverse directions
at various speeds.

STEPPER MOTOR INTERFACING WITH 8051 CLOCKWISE SPEED VARIATION

AIM:

To interface a stepper motor with 8051 microcontroller and operate it.


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 4h

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 4h 4 1 0 0 1 9h

BLOCK DIAGRAM:

8051 825 DRIVER STEPPER


CIRCUIT MOTOR
MICROCONTROLLER
5

You might also like