0% found this document useful (0 votes)
34 views2 pages

Program: Address Opcodes Label Mnem Onics Operand Comments

This program loads data from a table into the data pointer to control a stepper motor. It loads the table address and count into registers, loads the table value into A and sends it to the motor port address in a loop. It delays between values using another loop to control motor speed. Incrementing the data pointer rotates the motor continuously.

Uploaded by

Arun Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views2 pages

Program: Address Opcodes Label Mnem Onics Operand Comments

This program loads data from a table into the data pointer to control a stepper motor. It loads the table address and count into registers, loads the table value into A and sends it to the motor port address in a loop. It delays between values using another loop to control motor speed. Incrementing the data pointer rotates the motor continuously.

Uploaded by

Arun Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

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 (DPTA)

4103 MOV R0, #04 Load the count in R0

Load the number in


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

Send the value 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, #OFFh delay before next data
Y1!
item is sent to the motor
4114 DJNZ R4, DELAY

4116 POP DPL 1


POP back DPTR value
4118 POP DPH from stack
Increment DPTR to
411A INC DPTR point to next item in the
table

Decrement Ro, if not


411B DJNZ
zero or repeat the loop

Short jump to start of the


411D SJMP program to make the
motor rotate continous
Values as per two phase
411F TABLE DB
switching scheme

PROCEDURE:

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy