Shop OBEX P1 Docs P2 Docs Learn Events
two steppers — Parallax Forums

two steppers

BILL COOLEYBILL COOLEY Posts: 4
edited 2007-11-16 03:08 in BASIC Stamp
I am trying to run 2 stepper motors using 8 I/Os I recall reading that the last 8 pins could be configured this way. I am imagining the first four I/Os to motor one and the higher four to motor two. Then I'm guessing I could make a sub rutine that could repeat for each moving mode, like; All ahead full, slow left, sharp left, spin left...
Could you show me 2 things?

1. a little code showing how to get to that mode where 8 LEDs can read values 0-255

2. how to make and call a sub rutine of slow and fast turns for instance

I'm thinking such a thing is already made, I'm just too new to find it

I think I have the BS2 it came with a book called What's a Microcontroller, but I didn't see this in the book.

Thanks very much
Bill

Comments

  • D FaustD Faust Posts: 608
    edited 2007-11-16 01:44
    Bi-polar or unipolar?

    4 wires usually bi polar
    5 usually unipolar

    You know that you will need transistors or somehting because a Stmap can't supply that much current. That WILL tie up your stamp too. (in code)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --DFaust
  • BILL COOLEYBILL COOLEY Posts: 4
    edited 2007-11-16 02:12
    They have 6 but two are the center tap of their own pair
    I think they are unipolar - all voltages in one direction

    Yes, I have got 8 Darlington pair type Transisters to get the power requirements to the motors.

    I'm so ready to get movement, I want try the byte 0-255 method with GOTO or GOSUB speed and turning schemes.
    But, what's the real way, I'm very new to this, And I'm sure there are less taxing methods for these tasks. I cetainly haven't considered the sensors yet, just the go... my instant gradification plan is to just preprogram a rutine into it like; go straight 30", spin left 3 times, go left a little right a little roll in a serpatine (sine wave) kinda way, spinright a little, stop. Just so I can assure myself it will move
  • D FaustD Faust Posts: 608
    edited 2007-11-16 02:32
    If there are 6 wires, then you should need a maximum of 5 pins.

    I have not done this but I would think of somehting like:

    Dirs = $F

    outs = %10000000

    outs = %01000000

    outs = %00100000



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --DFaust
  • metron9metron9 Posts: 1,100
    edited 2007-11-16 03:08
    Also read the Memory Organization and Variables in the Help > Contents from the Pbasic editor. This will give you the understanding of how the pins are mapped to the memory contents. Remember there are three different bits that refer to each pin. INS,OUTS and DIRS. Those names are broken down to refer to 4 bits and single bit names. Read and understand that, if you dont understand that ask about what you don't understand until you do understand these three very important memory addresses that interface you to the outside world.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
Sign In or Register to comment.