A stepper motor is a brushless, synchronous electric motor that converts digital pulses into mechanical shaft rotation. Every revolution of the stepper motor is divided into a discrete number of steps, and the motor must be sent a separate pulse for each step.stepper motor is connected with atmega32 output port pins through a L293D. So when the controller gives pulses with particular frequency to L293D,the motor is rotated in clockwise direction
PROTEUS DESIGN
CODE
/*
* stepper.c
*
* Created: 10/3/2014 11:13:07 AM
* Author: rohit
*/
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRD=0xff;
while(1)
{
PORTD=0b00001000;
_delay_ms(1000);
PORTD=0b00000100;
_delay_ms(1000);
PORTD=0b00000010;
_delay_ms(1000);
PORTD=0b00000001;
_delay_ms(1000);
}
}
VIDEO
Category: