The PIC output lines are first buffered by a 4050 hex buffer chip, and are then connected to an NPN transistor. The transistor used, TIP120, is actually a NPN Darlington (it is shown as a standard NPN). The TIP120 act like switches, activating one stepper motor coil at a time.
Due to a inductive surge created when a coil is toggled, a standard 1N4001 diode is usually placed across each transistor as shown in the figure, providing a safe way of dispersing the reverse current without damaging the transistor. Sometimes called a snubbing diode. The TIP120 transistors do not need an external snubbing diode becasue they have a built in diode. So the diodes shown in the drawing are the internal diodes in the TIP120 transistors.
The simplest way to operate a stepper motor with a PIC is with the full step pattern shown in Table 1. Each part of the sequence turns on only one transistor at a time, one after the other. After the sequence is completed, it repeats infinitly until power is removed.
I purposly made this first program as small as possible, simply to demonstrate how easy it is to control a stepper motor. Also note the use of high and low commands to control the output lines, rather than peek and poke routines. For our purposes, high and low are sufficent.
Visit Here for more.