Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

stepper motor controller using PIC16F84A

Status
Not open for further replies.

ameyach

Newbie level 3
Newbie level 3
Joined
Jan 20, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,305
Is this program correct for Stepper Motor controller using PIC16F84A


Stepper Motor controller using PIC16F84A
Code:
list p=pic16f84a
init
bsf status,rp0
clrf trisa
movlw b'00100111'
movwf trisb
movlw b'10000000'
movwf option_reg
bcf status,rp0
clrf mode
clrf count1
clrf count2
movlw b'00000101'
movwf porta
bsf portb,rb7
btfsc portb,rb5
goto $-1
start
btfsc portb,rb1
goto check1
clrf mode ;
goto drive
btfsc portb,rb2 ;
goto check2 ;
movlw d'1' ;
movwf mode
goto drive ;
btfsc portb,rb0
goto drive ;
movlw d'2' ;
movwf mode ;
movf mode,w
bz start ;
bsf portb,rb7 ;
btfsc portb,rb5 ;
goto $-1
movlw d'5' ;
movwf count1 ;
call timer ;
decfsz count1,f ;
goto loop ;
bcf portb,rb7 ;
btfss portb,rb5
goto $-1
movf porta,w ;
sublw b'000000101' ;
bnz drive2 ;
movf mode,w ;
sublw d'1' ;
bz drive1 ;
movlw b'00001001' ;
goto drive_end ;
movlw b'00000110' ;
goto drive_end ;
movf porta,w
sublw b'000000110' ;
bnz drive4 ;
movf mode,w ;
sublw d'1' ;
bz drive3 ;
movlw b'00000101' ;
goto drive_end ;
movlw b'00001010' ;
goto drive_end ;
movf porta,w ;
sublw b'000001010' ;
bnz drive6 ;
movf mode,w ;
sublw d'1' ;
bz drive5 ;
movlw b'00000110' ;
goto drive_end ;
movlw b'00001001' ;
goto drive_end ;
movf porta,w ;
sublw b'000001001' ;
bnz drive8 ;
movf mode,w ;
sublw d'1' ;
bz drive7 ;
movlw b'00001010' ;
goto drive_end ;
movlw b'00000101' ;
goto drive_end ;
movlw b'00000101' ;
movwf porta ;
goto start ;
nop ;
decfsz count2,f ;
goto tmlp ;
return ;
 

Hi Friend

which type of stepper motor, you are using?

Unipolar or bipolar.

Which type of driver circuit, you are using?
 

That stepper is a bipolar type and the driving circuit is by using Darlington transistors.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top