8086 program for parallel port programming in xp
You need a port IO dll for port access. Then use an ohmmeter to find the ground and windings lines. You will get a low reading and a low reading times 2. Times 2 reading means you are hooked to 2 windings, a times 1 reading means one of the lines is ground. Once you have found your power wires touch power to each of them in turn (one at a time). When you get one that turns the shaft mark it as one. When you find one that moves the shaft a little bit forward, mark it as 2. If it goes backwards mark it as 4. If it doesn't move, mark it as 3. This is the order of the wires. To halfstep it CW you go 1,2,3,4. To halfstep it CCW you go 4,3,2,1. To move in a full step omit 2 and 4.
To tiime the stepper use WinAPI calls QueryPerformanceCounter and QueryPerformanceFrequency.
Create some structures or a class to contain the data needed to control a stepper. Things
like RPM, direction, StepsPerRevolution and DegreesPerStep and so on. Two control two stepper motors you could then use a linked list of the two structure or classes and loop through the list until the reference to the next structure was NULL. Then you can link in or out any number of steppers you want to.
I used the Speech Recognition SDK from MS to do voice command and control of two stepper motors hooked up as a 'winch' and a 'base' for a friends project. He could command 16 speeds for the winch or the base, control eaches direction, stop them, reverse them and so on. It was actually a pretty siimple project but it had a pretty good wow factor and my friend got really high marks for it. And I got a free lunch.