Professional Documents
Culture Documents
Stepper Motor Control - A
Stepper Motor Control - A
Stepper Motor Control - A
PROCEDURE:
Find the right excitation sequence: From the table, for counter cw
rotation the lower nibble should be 05H, 09H, 0AH, 06H.
For cw rotation, sequence is in reverse, i.e., 06H, 0AH, 09H, 05H.
Control Word = 80H for setting Port A as output port.
Port designation: PA (10H), PB (11H), PC (12H) and CR (13H)
• One sequence gives 1.8 x 4 Program for continuous rotation in CCW dir.
START MVI A 80 H : 8255A CW for PA as O/P
steps of rotation in CCW dir.
OUT CR (13H) : CW sent to CR of 8255A
• Register B is used to count the LOOP MVI B 04H : Counts excitation seq.
four sequence steps. LXI H C0 E0 : Set memory pointer
• DELAY controls rotation time. BACK MOV A, M : Get the excitation code
Write a RP based delay sub- OUT PA (10H) : Send excitation code
CALL DELAY : Wait
routine. e.g., given in next slide INX H : Increment pointer
• In this program, the sequence DCR B : Repeat 4 times
CCW rotation is stored in C0E0H JNZ BACK
to C0E3H. JMP LOOP : Repeat 50 times
• Change contents of C0E0H to END RST1
DELAY : Delay sub-routine
C0E3H for CW rotation. <C0E0>=05, <C0E1>=09, <C0E2>=0A, <C0E3>=06
A. Srinivasan, Department of Physics, Indian Institute of Technology Guwahati
stepper motor control using 8085 kit
For counter cw rotation the lower nibble should be 05H, 09H, 0AH, 06H.
For cw rotation, it is in reverse, i.e., 06H, 0AH, 09H, 05H.
Control Word = 80H for setting Port A as output port.
• One step of the sequence gives Program for fixed step CCW/CW rotation
0
1.8 rotation. <B> keeps count. START MVI A 80 H : 8255A CW for PA as O/P
• DELAY controls rotation time. OUT CR (13H) : CW sent to CR of 8255A
• Sequence is in C0E0H to C0E3H. MVI C 32H : Set repeat count to 50ıο
LOOP MVI B 04H : Counts excitation seq.
• <C> keeps count of rotation LXI H C0 E0 : Set memory pointer
steps. It is 3216=5010 in this case. BACK MOV A, M : Get the excitation code
• RP delay program using <<DE>> OUT 10H : Send excitation code
DELAY LXI D FF FF : <DE>=FFFF, 10T CALL DELAY : Execute DELAY sub-rout
LOOP1 DCX D : Decr. RP 6T INX H : Increment pointer
MOV A, E : 4T DCR C : Decrement step counter
JZ END : Check 50 steps are over
ORA D : 4T
DCR B : Do 4 step sequence
JNZ LOOP1 : (10/7)T JNZ BACK :
RET 10T JMP LOOP
Delay time calc. for Tclock = 0.5 s END HLT
TLoop1 = (Tclock*24*6553510) – 3*Tclock <C0E0>=05, <C0E1>=09, <C0E2>=0A, <C0E3>=06
Ttotal = TLoop1+10*Tclock = 0.7864235 s <C0E0>=06, <C0E1>=0A, <C0E2>=09, <C0E3>=05
A. Srinivasan, Department of Physics, Indian Institute of Technology Guwahati