Fig. 1
Click here for larger image.
PIC16F628 Rotary Encoder Operates Stepper Motor Controller
by Lewis Loflin
Follow @Lewis90068157
For more background on stepper motor control and Easy Driver see the following:
- How to Connect Easy Driver Micro-Stepper Controller to Arduino
- Rotary Encoder Used with Arduino Interrupts
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.
Download ASM code a5.asm.
See How I got into Electronics
- You Tube Videos for this Series
- Home Built PIC Development Board
- PIC16F628 PIC Using Rotary Encoder to Operate Stepper Motor
- Using a Serial ADC with PIC16F628
- Calculating Pulse-Width Modulation with a PIC
- PIC16F84A-628A Hardware Time Delays
- PIC16F84A-628A Timer Interrupt Delays
- PIC16F84A-628A Pullups and Interrupts
- PIC16F84A-628A Hardware Interrupts Tutorial
- Projects using PIC16F628:
- Home Built PIC16F628 Prototyping Board
- Exploring the Microchip PIC in Assembly
- Using a Microchip PIC with TLC548 Serial ADC
- Controlling PIC Pulse Width Modulation with a Serial ADC
- Using TMR0 on a PIC with Interrupts
- External Clock Crystal with PIC16F628 TMR1 Generates Interrupt
- PIC Using Rotary Encoder to Operate Stepper Motor
- PIC16F628 Pulse Width Modulation Controls Brightness of LED
- Another way to Turn On-Off PWM in a PIC
- TLC548 Serial ADC Spec. Sheet
- Programming PIC16F84A-PIC16F628A Interrupts by Example
- PIC16F84A-PIC16F628A Pull Up Resistors with Interrupts
- Programming PIC16F84A-PIC16f628a Timers by Example
- Programming PIC16F84A-PIC16F628A TMR0 Interrupts
- Programming PIC16F84A Software Delay Routines by Example
Web site Copyright Lewis Loflin, All rights reserved.
If using this material on another site, please provide a link back to my site.