Shop OBEX P1 Docs P2 Docs Learn Events
Stepper Motor Driver (PASM) from OBEX not working. Please help — Parallax Forums

Stepper Motor Driver (PASM) from OBEX not working. Please help

TCTC Posts: 1,019
edited 2013-05-22 14:31 in Propeller 1
Hello all,
I am trying to get a stepper motor to work. I downloaded “Stepper Motor Driver (PASM)” from OBEX. It does not seam to work, and I know nothing about PASM. I can get
CON                  
  _CLKMODE      = XTAL1 + PLL16X                         
  _XINFREQ      = 5_000_000

  StepPin = 16
  
PUB  temp
repeat
    dira[StepPin]~~
    dira[StepPin+1]~~
    Outa[StepPin+1]~            ' set to negative direction

    repeat 1000                 ' Move 1000 steps in the negative direction
       outa[StepPin]~
       outa[StepPin]~~
       waitcnt(clkfreq/2000+cnt)

    waitcnt(clkfreq+cnt)
    
    outa[StepPin+1]~~            ' set to positive direction

    repeat 1000                  ' Move 1000 steps in the positive direction
       outa[StepPin]~
       outa[StepPin]~~
       waitcnt(clkfreq/7000+cnt)

    waitcnt(clkfreq+cnt)

to work on the same pins, but the object will not work. Could someone please take a look, and tell me if I have to do something.
I do also have pin 20 (Home switch) set to HIGH, I even tried it set to LOW.
Thanks
TC

Comments

  • desikodesiko Posts: 18
    edited 2013-05-21 20:06
    Hi, TC

    I think you are confusing the pin numbers with the I/O designations.
    In the code you posted the stepper output is Pin 21 (I/O 16) and the Home signal is Pin 25 (I/O 20).

    Does this make sense?

    regards,
    Desiko
  • TCTC Posts: 1,019
    edited 2013-05-21 20:27
    desiko wrote: »
    Hi, TC

    I think you are confusing the pin numbers with the I/O designations.
    In the code you posted the stepper output is Pin 21 (I/O 16) and the Home signal is Pin 25 (I/O 20).

    Does this make sense?

    regards,
    Desiko

    Yes it does. That is what I have setup, but it still does not work.
  • desikodesiko Posts: 18
    edited 2013-05-21 21:08
    In your original post you are calling the Home signal pin 20, so are you using pin 20 or pin 25?
    Same goes for stepper output, are you using pin 21 or pin 16?
  • kuronekokuroneko Posts: 3,623
    edited 2013-05-21 21:18
    Works fine here on a QS board. With outa[HomeSwPin] forced high pins StepPin/StepPin+1 show some movement. Locking it down to 0 (switch active) doesn't show anything (expected).
  • TCTC Posts: 1,019
    edited 2013-05-22 14:31
    Thank you desiko, and kuroneko. It was the LCD object that was giving me problems. I dont have a display hooked up. Once I commented all the lines out that delt with the display, it started working.
Sign In or Register to comment.