22 Replies Latest reply on Dec 13, 2017 10:05 AM by schlimoff

    PSoC 4 Pioneer Kit Community Project#045 – Stepper Motor Example




      In today’s example we will be showcasing a very simple stepper motor example project. In this example we show you how to spin a stepper motor using the PSoC 4 Pioneer kit and the Arduino Motor Shield.


      001 - Schematic Design.png


      Forum Post Attachments:


      At the bottom of this post we are including the following items:

      • Example Project Zip File
      • Zip File of Images
        • Project Schematic
        • Component Configurations


      Components Used:


      The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:

      • PWM
      • Control Register
      • CyClock
      • CyPin


      The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.


      Firmware Description:


      The main.c firmware is included in the example project. Please review the commented sections for more details.


      In this example we are giving users an example on how to control a Stepper Motor. In this example we have included a number of motor control source files that will provide you simple APIs to control the motor. These files are:

      • genSine.c/h
      • inputScan.c/h
      • Move.c/h
      • PhaseControl.c/h
      • systemInit.c/h


      The firmware is designed to drive the stepper motor is various directions and different speeds and different lengths of time. There are a number of if/else statements that progress through the demonstration. Please take a few moments to review the included source files to get a feel for the firmware controls for the motor.


      Hardware Connections:


      Connect the Arduino Motor Shield to the PSoC 4 Pioneer Board. Then connect wires from the stepper motor to the Arduino Motor Shield and power the motor.


      002 - Stepper Motor Example a.jpg


      Test Your Project:


      Program your project and power up the Motor Shield using an external power supply.



      I hope this example can help you in your design.