Stepper Motor Virtual Peripheral This Virtual Peripheral adds the ability to control a stepper motor. This routine
excites the stepper motor using half-step sequence but the excitation method can
be changed to any sequence you choose simply by modifying the startstep
lookup-table with the appropriate sequence of excite output.
The stepper motor can be connected to portb via the following circuit: The stepper motor is controlled via the step_con register. The motor can be
single stepped by setting the step_con.0 bit or run continuously by setting the
step_con.1 bit. Modifying the step_lo and step_hi registers sets the rotation rate.
To calculate the values of step_lo and step_hi for a desired revolution rate the
following equation can be used:
step_lo x step_hi = delay delay = desired rev. per second / (RTCC x CLK-1 x steps) Where: CLK = SX clock frequency
steps = number of steps/rotation for stepper used
(i.e. 360degrees / 7.5degrees per step = 48)