Page 253 - Robots Androids and Animatrons : 12 Incredible Projects You Can Build
P. 253
The following is a PICBASIC program that uses a dedicated step-
per motor IC.
‘Stepper motor with UCN-5804
Symbol TRISB = 134 ‘Initialize TRISB to 134
Symbol PortB = 6 ‘Initialize portb to 6
Poke TRISB,0 ‘Set PORTB lines output
low1 ‘Bring output enable low to run
start:
pulsout 0, 10000 ‘Send 10-ms pulse to UCN-5804
goto start ‘Do again
In this case I again wrote a simple core program to show how easy it
is to get the stepper motor running. You can, of course, add options
to the program to change the pulse frequency, connect the direction
and step mode pins, etc.
Parts list for the stepper motor controller
(1) 16F84 microcontroller
(2) 22-picofarad (pF) capacitors
(1) 4.0-MHz crystal
232 (1) 4.7K-ohm, / 4-W resistor
1
(1) 555 timer
(1) UCN-5804B stepper motor controller chip
(1) Stepper motor [unipolar (six-wire)]
(1) Step-down wall transformer
(6) 1N914 diodes
(4) TIP 120 NPN transistors
(1) Voltage regulator (7805, 7812)
(1) Rectifier 50V, 1 A
(1) 150- F capacitor
(1) 4050 hex buffer chip
Miscellaneous: Solderless breadboard
Parts are available from: Images Company, James Electronics, JDR
MicroDevices, and Radio Shack. See Suppliers at the end of the
book.
Team LRN
Chapter ten