Shop OBEX P1 Docs P2 Docs Learn Events
5804 and Stepper Motor help — Parallax Forums

5804 and Stepper Motor help

CeeterCeeter Posts: 4
edited 2005-10-29 02:56 in BASIC Stamp
I have a ucn5804 that I am trying to use with a BS2. I searched google and the forums trying to find some sample code but I can't seem to find any. If someone could point me in the right direction or post some sample code to get me started I would appreciate it. Thanks.


Hardware being used-
29STP5 Unipolar Stepper Motor
UCN5804 Stepper motor driver


Schematic
5804_stepper_stamp.jpg

Comments

  • Clock LoopClock Loop Posts: 2,069
    edited 2005-10-27 11:24
    The data sheet says this.

    The outputs will advance one sequence
    position on the high-to-low transition of the STEP
    INPUT pulse.

    So I would imagine if you did something as simple as

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    step      PIN      5
    
    
    DO
        HIGH  step
        pause 10
        LOW  step
        pause 1
    Loop
    
    
    



    This should make the motor turn continually (or jerky). If not, try a different pause time for pause 10. more/less
    pulsout might be your next way to go if above didn't work.

    After reading your data sheet again... I saw this
    Minimum Step Input Pulse Width . . . . . . . . . . . . . . . . . . . . . 3.0 μs

    So pulsout would work if set right. But the above code should work also.


    If all you are doing with your BS2 is generating a pulse for your stepper motor, then you might want to look into other
    ways of generating a pulse, ways that don't take up such a valuable microcontroller.
    Like using a 555 timer. However if you plan to controll the stepper motor based on other inputs ( sensors or the like, then the BS2 would be a good thing to use.


    P.S. ALWAYS make sure if your circuits are connected with a different power supply than your STAMP, that the GROUNDs of each power supply are wired together.

    Post Edited (BPM) : 10/27/2005 11:32:46 AM GMT
  • CeeterCeeter Posts: 4
    edited 2005-10-29 02:56
    Thank you for the help. Using a 555 sounds like a good idea for my application, I'll give that a try.
Sign In or Register to comment.