CEstudent
Junior Member level 1
steeper motor application in lifts
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 count=0 .
am using pic16f84a and 6 wire stepper motor
this is the code
plz help
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 count=0 .
am using pic16f84a and 6 wire stepper motor
this is the code
Code:
;
;*******************************************************************
; 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
BSF PORTB,5
LL NOP
GOTO LL
END
plz help