For a non-realtime OS, you have several methods.
You can sometimes use a "micro" sleep. Linux has usleep()
or use the select() TCP/IP call with a microsecond timeout.
For a real time OS, you just setup a timer running at whatever
rate you want, and it calls your step routine at the right rate.
Stepper motors really don't need THAT high a step rate.
I have almost 50 motors on one serial chain, so I need to send
200 bits of information out the parallel port to get the motors
to step one step. (4-phase: 24 steps-per-rev (48 at halfstep))
At 5 revs-per-second for my motors, that's 240 steps-per-second
and 200 bits-per-step = 48,000 bits-per-second out the parallel port.
(It's really more like 3 times that since I'm not doing anything
fancy with the clock.
Of course if you use 400 steps-per-rev motors, you need more
steps-per-second, but you can do the math no problem.
So anyway, unless you are trying to step faster than the motors
can handle it, you'll probably be able to run as fast as you like
with any PC.
I'm using a 233 MHz Compaq laptop right now.
- Alan Kilian <alank(at)timelogic.com>
Bioinformatics Applications Director, TimeLogic Corporation
Click to see the full signature.