Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

stepper motor control via parallel port interface

Not open for further replies.


Newbie level 2
Dec 15, 2005
Reaction score
Trophy points
Activity points
stepper motor control via parallel port

can anyone help me to create complete programming ( in C or Visual Basic) which can control stepper motor through parallel port.

kindly help.

this is my email :

controlling stepper motor via lpt port

In the hardware side, what you need is only a current amplifier to amplify the output of the parallel port to be used as the input for the stepper motor driver. I've made such a thing in the past. If you want to control it under linux, you can use linux IO facilities (IIRC #include <io.h> with kernel source supplied.)

stepper motor control visual basic parallel port

Get an IO dll that allows you to output on the parallel port on Win2K of XP. Then use the Win32 API calls QueryPerformanceCounter and QueryPerformanceFrequency to get the timing resolution you need (I don't think the millisecond functions give enough resolution). I used an array (better to use a linked list but it was a quick and dirty piece of programming for a student friend) to contain some StepperControl structures (or types in VB) that contained stuff like microseconds between step, steps per revolution, stepper direction, current step, etc, used to control each stepper. Then you have a tight loop where you check to see if the time interval for each stepper has been reached, if so step it. It was a pretty cool project, we controlled two stepper with the MS Speech Recognition software to have the two motors running like a winch and a winch base. The kid and his partner both spoke poor English (they were from Hong Kong) and the speech recognition software didn't miss one command. They got A's for 'their' project and I got a free dinner.

Do you happen to remember what dll you used for this. I am considering writing some software to make my cnc do pick and place in visual basic on windows xp. However, my understanding is that because software can't talk directly to the parallel port in windows xp, communications with the port is slow. Thus, the speed that the motor can be stepped is limited.

My understanding is that I would need a dll that I can pass an array of steps and times to, and that dll would talk to the parallel port with faster access. Is this what you did?

Thanks for your help, if you see this. I'll try to private message you too.

Just google io.dll. You can download it from geekhideoutDOTcom. Use PortIn and PortOut. The port access should be quick enough. Guys use it to drive CNC routers at adequate speeds. There are other dlls out there also, but I found this one to be the most straightforward.

Added: Port access is slow if you use the proper Microsoft interface, that is if you wrote a driver in kernel mode. Access at this level takes about a millisecond But most of these dll's do it behind Microsofts back by using undocumented commands that lets you do io at close to a microsecond.

Thanks very much for replying. I'll try it out.

Not open for further replies.

Part and Inventory Search

Welcome to