Shop OBEX P1 Docs P2 Docs Learn Events
Assembly to PBasic — Parallax Forums

Assembly to PBasic

NWUpgradesNWUpgrades Posts: 292
edited 2009-06-16 20:39 in General Discussion
I am having an issue with a stepper motor controller that I had posted about on the Basic Stamp site. I was told that this code is in Assembly.· The problem is I am not the best at programming and was wondering if there is anyone that can convert the code to PBasic for me, or tell me whet I need to do. I have tried known working code that John sent me some time ago, but the motor will only go CW, unless I swap the wires from the motor to the controller, then I can get it to go CCW. I am using Pin 0 for Direction and Pin 1 for Step. Thanks in advance for any help.

Here is their code:
;16c54 step motor asm;Control by pulse and signals (JP1 Removed);==========================================MODE_A BTFSC PORTB,3 ;CP pouse in? GOTO MODE_A_BACK ;CP=1 no pouse BTFSC FLAG, 0 GOTO $+2 ;high-->low GOTO MODE_A ; BCF FLAG, 0 BTFSS PORTB,2 ;when RB2 =low voltage and RB2-DIR=high,TEMP=TEMP+1 ,contrarily TEMP=TEMP-1 GOTO A_LOOP1 INCF TEMP, F GOTO A_LOOP2 A_LOOP1 DECF TEMP, F A_LOOP2 CALL STEP_RUN ;one pouse step one,so differ frequency can adjust step motor speed. GOTO MODE_A MODE_A_BACK BSF FLAG, 0 ;normal RB3=H,FLAG D0=1 GOTO MODE_A

Comments

Sign In or Register to comment.