Thursday 3 January 2013

Programming for 2-wire connection of Unipolar Stepper Motor

Programming for 2-wire connection of Unipolar Stepper Motor

►C Programming
CODE:
void main(){
        while(1){
                stepper = 0x03;
                delay();
                stepper = 0x01;
                delay();
                stepper = 0x00;
                delay();
                stepper = 0x02;
                delay();
        }
}



►Assembly Programming
CODE:
main:
        mov stepper, #03H
        acall delay
        mov stepper, #01H
        acall delay
        mov stepper, #00H
        acall delay
        mov stepper, #02H
        acall delay
        sjmp main


The working of the above code can be seen in the demo animation below.

unipolar stepper motor in 2-wire connection mode

No comments:

Post a Comment