Pin connections PIC 16F628.

PIC16F628 Rotary Encoder Operates Stepper Motor Controller

by Lewis Loflin


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

rotary_encoderrotary_encoder waveform

To see wiring schematic for the encoder.

YouTube video see PIC16F628 PIC Using Rotary Encoder to Operate Stepper Motor

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.

See How I got into Electronics