: hello guyz
: how r u all?
:
: i had a problem while testing stepper motor
: i wrote an assembly code to rotate the stepper motor for a Specific
: number of steps and then it should stop but the stepper is still
: moving!!! can u tell what to do coz i want to stop the stpper motor
: after the count=0 .
: am using pic16f84a and 6 wire stepper motor
:
:
:
:
: ;
: ;*******************************************************************
: ; NOTES:
: ;
: ;
: ; PORTBO= NORTH POLE
: ; PORTB1= EAST POLE
: ; PORTB2= SOUTH POLE
: ; PORTB3= WEST POLE
: ;*****************************************************************
:
:
: PORTA EQU 5
: PORTB EQU 6
: STATUS Equ 3
: TMR0 EQU 1
: COUNT EQU 0CH
: COUNT1 EQU 0DH
: INTCON EQU 0BH
: COUNTD EQU 0FH
:
: ;******************************************************************
: LIST P=16F84A
:
: org 0
: goto START
:
: ;*********************************************
:
:
: DELAY CLRF TMR0
: MOVLW .10
: MOVWF COUNT
: BCF STATUS,5
: WAITA BCF INTCON,2
: WAITB BTFSS INTCON,2
: GOTO WAITB
: DECFSZ COUNT,1
: GOTO WAITA
: RETURN
: RETLW 0
: ;**************************************
:
: START
:
: BSF STATUS,5 ;BANK1
: MOVLW B'00000000'
: TRIS PORTB ; b0:b3 " stepper output "
: MOVLW B'00000011'
: TRIS PORTA
: MOVLW B'0000001'
: OPTION
: BCF STATUS,5 ; BANK0
:
: CLRF PORTB
: MOVLW .10
: MOVWF COUNTD
:
: LOOP1
: BSF PORTB,4
: CALL DELAY
:
: MOVLW .1
: MOVWF PORTB
:
: CALL DELAY
:
:
:
: MOVLW .2
: MOVWF PORTB
:
:
: CALL DELAY
:
:
: MOVLW .4
: MOVWF PORTB
:
: CALL DELAY
:
:
: MOVLW .8
: MOVWF PORTB
:
:
: BCF PORTB,4
: DECFSZ COUNTD
: GOTO LOOP1 <-- Unconditional jump to beginning of loop, instead should check if COUNTD is 0, if bigger only then jump
:
: BSF PORTB,5
: LL NOP
: GOTO LL
:
: END
:
:
: plzz help me
: