Hi all, i am learning to control stepper motor by using ULN2003a chip together with PIC 16f628a with a stepper motor.
But unfortunately it is not working. I am able to feel the motor is vibrating but the shaft is not rotating.
My code is as below:
void main()
{
CMCON = 0x07; // To turn off comparators
TRISB = 0; // PORT B as output port
PORTB = 0x0F;
do
{
PORTB = 0b00000011;
Delay_ms(500);
PORTB = 0b00000110;
Delay_ms(500);
PORTB = 0b00001100;
Delay_ms(500);
PORTB = 0b00001001;
Delay_ms(500);
}while(1);
}
The motor i that i am using
The ULN2003a module
Does anyone here can let me know what is wrong? Thanks
But unfortunately it is not working. I am able to feel the motor is vibrating but the shaft is not rotating.
My code is as below:
void main()
{
CMCON = 0x07; // To turn off comparators
TRISB = 0; // PORT B as output port
PORTB = 0x0F;
do
{
PORTB = 0b00000011;
Delay_ms(500);
PORTB = 0b00000110;
Delay_ms(500);
PORTB = 0b00001100;
Delay_ms(500);
PORTB = 0b00001001;
Delay_ms(500);
}while(1);
}
The motor i that i am using
The ULN2003a module
Does anyone here can let me know what is wrong? Thanks