Skip navigation
Electronic Design

Programmable speed control targets stepper motors using 8254

This design idea describes a basic speed controller for stepper motors implemented by programming a common 8254 programmable counter timer IC. The speed control of the stepper motor is achieved by varying the OFF time in its clock’s duty cycle. All three counters available in 8254 are used for this purpose.

Counter 0 is programmed in mode 2, which divides the system clock (supplied by a PC, microcontroller, or microprocessor system) connected to its clock input CLK1. The division factor can be calculated from the ON time requirement for the duty cycle of the selected stepper motor and then loaded into the counter register.

The time period TON of the OUT0 pulse only sets the ON time of the final output (see the figure). Counter 1 is programmed in mode 1 to function as a one-shot whose time period TOFF is set by loading the appropriate word pattern to the counter register. Counter 2 is programmed in mode 2 to generate the final clock output for the stepper motor by receiving the clock with a fixed period TON and triggering by the one-shot pulse with time period TOFF. The digital word written to Counter 0 will set the ON time, and the word written to Counter 1 will set the OFF time of the stepper clock.

This design provides a motor control output signal with user-programmable OFF times and ON times through simple programming of the 8254 IC. The duty cycle ON time TON is fixed for the stepper motor but will vary from type to type. The varying OFF time TOFF provides the motor speed control. The “Start” pulse will enable the Counter 0 and Counter 1.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.