Microcontroller › 8051 › ‘c’ code for stepper motor › first you need to find the
May 12, 2012 at 9:48 pm
#7773
D.V.G. Krishna
Participant
first you need to find the type of stepper you are using.
incase of unipolar stepper then
the control algorithm willbe
if(condition for forword)
while(condition for forword)
{
control port=0x11; 0001
delay(); define as per the motor
control port=0x22; 0010
delay();
control port=0x44; 0100
delay();
control port=0x88; 1000
delay();
if(condition for backword)
while(condition for backword)
{
control port=0x88; 1000
delay();
control port=0x44; 0100
delay();
control port=0x22; 0010
delay();
control port=0x11; 0001
delay();
}