Bipolar stepper motor control using PIC12F1822 and L293D – CCS C

In this blog there are several posts talking about bipolar stepper motor and how to drive it. The bipolar stepper motor has two windings and 4 wires and to drive this windings 2 H-bridge circuits are needed. L293D motor driver chip is a good choice for driving this type of motor because it’s low cost and easy to use.
This post shows how to drive a cd-rom bipolar stepper motor using Microchip PIC12F1822 microcontroller and L293D motor driver IC.

To understand how this motor works read the following post:
Bipolar stepper motor control with PIC16F877A microcontroller

Bipolar stepper motor control using PIC12F1822 and L293D circuit:

PIC12F1822 stepper motor control circuit

Hardware Required:

  • PIC12F1822 microcontroller   —> datasheet
  • L293D motor driver   —> datasheet
  • Bipolar stepper motor
  • 2 x push button
  • Breadboard and jumper wires
  • PIC microcontroller programmer (PICkit 3, PICkit 4 …)

The two push buttons for moving the motor in direction 1 or direction 2.
PIC12F1822 internal oscillator is used and internal pull-ups are enabled for the 2 inputs.
The stepper motor voltage is 5V which is the same as the L293D chip VS and VSS.

Bipolar stepper motor control using PIC12F1822 and L293D CCS C code:
In this project the speed of the stepper motor is fixed by a variable called speed_delay = 10. If that number changed the speed of the motor will also change, if you increase that number the motor speed will decrease and if you decrease it the speed will increase.

Bipolar stepper motor control using PIC12F1822 and L293D video:
Project hardware video….

1 thought on “Bipolar stepper motor control using PIC12F1822 and L293D – CCS C”

  1. friend congratulations for all those beautiful projects I want to ask you the favor of if you can do this project with a pic12f615 what happens is that here you can’t get the pic12f1822 and I have some but they are pic12f615 I thank you immediately for a hug

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top