FPGA : RC Servo and Stepper motor control in Verilog

fpga_servo-stepper

Trandi blogged about his RC servo and stepper motor project.  He writes:

For those interested in reproducing this example:

  • The board is called “EP2C5 Mini Board” and has a EP2C5T144C8 Cyclone II FPGA on it
  • I used a standard, 9grams micro RC Servo
  • I used a 28BYJ-48 stepper motor and it’s driver (you can purchase these as a bundle for very cheap on dealextreme or banggood)
  • I used the free edition of Quartus II from Altera, version 13.0 SP 1 (be careful, later versions do not support Cyclone II FPGAs anymore)
  • I created a simple project, pasted all this code as a single module (it would of course be cleaner to separate the RC Servo and stepper control code into independent modules)
  • made the “Top level entity” in the General configuration page equal to “counter” (the name of my module)
  • used the Pin Planner to assign the inputs/outputs as follows:

-clock Input PIN_17
-led[2] Output PIN_3
-led[1] Output PIN_7
-led[0] Output PIN_9
-reset Input PIN_144
-servoPin Output PIN_40
-stepperPins[3] Output PIN_69
-stepperPins[2] Output PIN_70
-stepperPins[1] Output PIN_71
-stepperPins[0] Output PIN_72

Check out the video after the break.

Join the Conversation

1 Comment

Leave a comment

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

Notify me of followup comments via e-mail. You can also subscribe without commenting.