I am using a stamp 2p microcontroller with a drv 8825 driver and a unipolar/bipolar hybrid stepper motor 4v 1200mA with 200 steps per revolution in the bipolar configuration. My stepper motor vibrates but does not turn . The code I’m using is:
’{$stamp B2p}
’{$PBasic 2.5}
x VAR Byte
Stepper VAR Nib
Steps VAR Word
DIRS.HIGHBYTE = %00001111
Main:
Steps = 200
GOSUB Clockstep
Pause 1000
GOSUB Counterclockstep
PAUSE 1000
Clockstep:
DEBUG “Counter” , CR
FOR x = 0 to steps
LOOKUP x//4 , [%1010, %1001, %0101, %0110], Stepper
OUTS.HIGHBYTE.LOWNIB = stepper
PAUSE 2
NEXT
RETURN
Counterclockstep:
DEBUG “Clockwise” , CR
FOR x = 0 To steps
LOOKUP x//4 , [%0110, %0101, %1001, %1010] , Stepper
OUTS.HIGHBYTE.LOWNIB = stepper
PAUSE 2
NEXT
RETURN
Hello.
It looks like that code was written for something other than our stepper motor driver, in which case there would be little reason to expect it to work. Where did that program come from?
- Ben
A pbasic resource. The information with the driver had no programming suggestions. Can I use PBasic to run the driver? This is the only program that I know that the stamp 2p microcontroller will operate on? Alternatively do I need to get a different driver?