Stepper MotorOpen a new window or tab containing the Simulator.

Copy the example code from below and paste it into the simulator code editing area.

Click on STEPPER and select PORTB to make the motor visible.

Press F8 or click the "A" button to assemble the code and then run the program.

Please answer the reviseOmatic questions on this topic.


TASK:
Alter the code so the motor runs backwards.
Alter the code so the motor runs in half steps.

; ====================================
; ===== CONNECT STEPPER TO PORTB =====
; ====================================
start:
        movw    0x1
        movwr   portb
        nop
        nop

        movw    0x2
        movwr   portb
        nop
        nop

        movw    0x4
        movwr   portb
        nop
        nop

        movw    0x8
        movwr   portb

        jmp     start