- This topic has 4 replies, 3 voices, and was last updated 12 years, 5 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › ‘c’ code for stepper motor
hi………… i need ‘c’ code for stepper motor which rotate stepper motor up and down.
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();
}
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();
}
such projects are available on this site.. please browse thru EG Labs projects before posting such threads.
such projects are available on this site.. please browse thru EG Labs projects before posting such threads.