English
Language : 

AN3208 Datasheet, PDF (1/19 Pages) STMicroelectronics – Microstepping motor drive with STM8A and STM8S microcontrollers
AN3208
Application note
Microstepping motor drive
with STM8A and STM8S microcontrollers
Introduction
Stepper motors are electrically powered motors that create rotation from electrical current
driven into the motor.
They are used in a wide variety of applications such as printers, automated machine tools,
disk drives, automotive dashboard instrument clusters, and other applications requiring
precise motion control. They are well-suited for positioning applications since they can
achieve very good positional accuracy without complicated feedback loops associated with
servomechanism (servo) systems. However, their resolution, when driven in the
conventional full or half step modes of operation, is limited by the configuration of the motor.
Many designers today seek methods to increase the resolution of stepper motor drives.
Dedicated stepper motor controllers/ICs are available on the market. These controllers
contain the special logic and high-current drive circuits necessary to operate the stepper
motors. In some applications, for example in automotive dashboards, stepper motors with a
lower current rating (20 mA) are used to power the needles or pointers that display
parameters such as vehicle speed or the engine RPM.
Stepper motors need to be driven in microstepping mode (see Section 4: Driving stepper
motors using STM8A and STM8S microcontrollers). However, in this case, the use of
dedicated stepper motor controllers may increase the system cost and complexity. As an
alternative, the motors can be driven easily using the resources located within a
microcontroller (example, pulse-width modulation timers and I/O pins), thus reducing the
hardware cost and complexity. CPU load is very low when using internal resources and the
microcontroller is not precluded from performing other control activities or driving other
external peripherals. For example, the STM8 is able to drive two stepper motors together
with an LCD glass containing a high number of segments such as a motorcycle dashboard
application.
The application described in this document is a software/low cost solution to drive stepper
motors in microstepping mode using the STM8 microcontroller. The main focus of this
application note is to explain how to drive the microstepping motor with STM8A and STM8S
devices. An overview of the various stepper motor types is given in Section 2: Types of
stepper motor. Stepper motor basics are explained inSection 4: Driving stepper motors
using STM8A and STM8S microcontrollers. Section 5 summarizes stepper motor software.
Reference documents
● STM8A reference manual (RM0009)
● STM8S reference manual (RM0016)
● STM8A/S datasheets
Reference firmware
● STM8A/S firmware library
July 2010
Doc ID 17411 Rev 1
1/19
www.st.com