PIC16F628 Rotary Encoder Operates Stepper Motor Controller

For more background on stepper motor control and Easy Driver see the following:

rotary_encoderrotary_encoder waveform

To see wiring schematic for the encoder click here.

The program works by polling RA0 for a low, then checks state of RA1, which will determine direction. Then 200 step pulses are sent to RB5, which will turn this particular motor (1.8 degrees per step) 360 degrees for every position (20 in this case for 360 degrees) on the encoder.

RA0 and RA1 both have Schmitt trigger inputs, one should also connect a .0047 uF cap to ground from each pin.

Easy Driver

Download ASM code a5.asm.



Pin connections PIC 16F628.


Related Videos, Links