27964 Parallax Inc, 27964 Datasheet - Page 4

UNIPOLAR STEPPER MOTOR 12VDC

27964

Manufacturer Part Number
27964
Description
UNIPOLAR STEPPER MOTOR 12VDC
Manufacturer
Parallax Inc
Datasheet

Specifications of 27964

Accessory Type
Unipolar Stepper Motor
For Use With/related Products
BASIC Stamp®
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
M425P-5
Step_Fwd:
Step_Rev:
Do_Step:
BASIC Stamp 2 Application
This program demonstrates basic full-step, high-torque control of a unipolar stepper motor using the BS2
family of microcontrollers. With the BS2 family, the programmer can take advantage of an IO structure
(IO pins grouped as nibbles) which simplifies programming.
' {$STAMP BS2}
' {$PBASIC 2.5}
Phase
StpsPerRev
idx
stpIdx
stpDelay
Steps
Setup:
Main:
4
PAUSE 500
GOTO Main
END
stpIdx = stpIdx + 1 // 4
GOTO Do_Step
stpIdx = stpIdx + 3 // 4
GOTO Do_Step
READ stpIdx, phase
PINS = PINS & %00001111 | phase
PAUSE stpDelay
RETURN
DIRB = %1111
stpDelay = 15
FOR idx = 1 TO StpsPerRev
NEXT
PAUSE 500
FOR idx = 1 TO StpsPerRev
GOSUB Step_Fwd
VAR
CON
VAR
VAR
VAR
DATA
OUTB
48
Byte
Nib
Byte
%0011, %0110, %1100, %1001
© Parallax, Inc. • Unipolar Stepper Motor (#27964) • 02/2006
' one revolution
' one revolution
' wait 1/2 second
' point to next step
' point to previous step
' read new phase data
' update stepper pins
' pause between steps
' phase control outputs
' whole steps per rev
' loop counter
' step pointer
' delay for speed control
' make P4..P7 outputs
' set step delay
' rotate clockwise
' wait 1/2 second

Related parts for 27964