This application note describes the implementation of the STM32 firmware library for the dSPIN
stepper motor control product (L6470). It provides a guide on how to use the library for final
application development.
The L6470 is a fully integrated microstepping motor driver with embedded motion engine and SPI
communication interface. A low R
supports different operating modes including a 128-microstep resolution. It is based on digital
control core surrounded with a number of different peripherals and protections. Chip operating
mode, motion profiles, and all the other parameters are memorized in an embedded set of
registers. Communication with the IC is done through an integrated 5 MHz SPI periphery in
determined data format according to the documentation. See the L6470 datasheet for more details
about registers, application commands, etc. The firmware library speeds up the application
development process and saves time consumed by register constant definitions and command
routine implementation in the microcontroller source code.
AN3980
Application note
STM32™ firmware library for dSPIN L6470
DMOS power stage is also a part of the IC. The chip
DSON
Firmware library main features
■
Designed for the STM32F1xx microcontroller family
■
STEVAL-PCC009V2 + STM32 value line Discovery demonstration boards supported with library
configuration (dspin.h) and development tools project files
■
Easy portability due to ANSI C standard compliance
– Only HAL (“Hardware Abstraction Layer”) routines should be modified when used with
another platform
– Simple portability to STM8™ families thanks to similar HAL routines for peripherals - SPI,
GPIOs, etc.
■
Library contains project folders (files) for development tools:
– IAR™ - EWARM v5
(interrupt routines) and standard library for GPIO and SPI
Firmware is available for download in compressed zip format. By decompressing the archive
the following folder structure is created on a drive:
Figure 1.Firmware library folder structure
The “Libraries” folder contains microcontroller related files like peripheral source/header
files, startup file, etc.
Doc ID 022200 Rev 14/18
Library file structureAN3980
The “Project” folder contains demonstration board related subfolders. dSPIN library source
and header files and other subfolders with project files for different development tools
appear in each of the demonstration board subfolders. A list of the source/header files can
be seen in Figure 2:
Figure 2.Firmware library file list
5/18Doc ID 022200 Rev 1
AN3980Demonstration board electrical connection
3 Demonstration board electrical connection
The firmware library supports two demonstration boards:
1.STEVAL-PCC009V2 universal USB to serial bus interface
2. STM32F100 value line Discovery kit
In the case of STEVAL-PCC009V2, the connection of the L6470 demonstration board is
simple. It is only necessary to use a 10-wire flat cable connection line inserted into J1 on
STEVAL-PCC009V2 and J10 on the L6470 demonstration board. The signals are assigned
according to the appropriate section in the dSPIN.h file, see Table 1 :
Table 1.Microcontroller signal assignment for STEVAL-PCC009V2
Microcontroller peripherals for the STM32F100 value line Discovery kit connection have
been selected according to Table 2. The user is free to modify the assignment according to
their needs. The condition for correct functionality is consistency between physical
connection and dSPIN.h file content.
Table 2.Microcontroller signal assignment for STM32F100 value line Discovery kit