AN4355
Application note
L648x devices: high power stepper motor controllers
Enrico Poli
Introduction
The L6480 and L6482 devices are motor controllers providing a flexible solution for the high
power stepper motor applications. The devices can be controlled by a host microcontroller
through a fast SPI interface and are able to execute a complete set of motion commands.
This document describes how the devices can be configured and gives some suggestions
on the operation and application design.
The current control algorithm of the devices - voltage mode driving for the L6480 and the
advanced current control for the L6482 device - will be not investigated in this document.
Please refer to the respective application notes AN4144 “Voltage mode control operation
and parameter optimization” and AN4158 “Peak current control with automatic decay
adjustment and predictive current control: basics and setup” for more details about them.
March 2015
DocID025240 Rev 2
1/25
www.st.com
25
Contents
AN4355
Contents
1
The L6480 and L6482 communication interface . . . . . . . . . . . . . . . . . . . 3
1.1
1.2
1.3
Communication protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Daisy chain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
5 V and 3.3 V communication interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2
Motion engine control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1
2.2
2.3
2.4
Speed tracking commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Positioning commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Change the target position of the on-the-fly command . . . . . . . . . . . . . . . . . . . . . . 9
Stop commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Initializing position using GoUntil and ReleaseSW commands . . . . . . . . 10
3
4
Supply management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Gate driving circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.1
4.2
Turn-on sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Turn-off sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5
Protections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.1
5.2
5.3
5.4
Overtemperature protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Overcurrent protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Gate drivers undervoltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
V
S
undervoltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
6
7
8
9
Stall detection (L6480 only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Main clock source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Layout suggestions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2/25
DocID025240 Rev 2
AN4355
The L6480 and L6482 communication interface
1
The L6480 and L6482 communication interface
The device (always slave) can be driven by an MCU (always master) sending commands
through an 8-bit SPI interface. The 8-bit shift register of the device is kept enabled while the
CS input is forced low. During this time, at every raising edge of the serial clock (CK), the
SDI input is stored into the shift register. At CK falling edges the SDO output is updated
according to the last bit of the shift register.
When the CS input is raised, the device catches the shift register content and interprets its
value as a command or an argument of the previously received command.
All the bytes are sent through the SPI data lines starting from the most significant bit.
1.1
Communication protocol
The communication protocol is based on single byte commands that can be followed by
a command argument up to 3 byte long which must be transmitted starting from the most
significant byte.
Part of the information needed to execute the target operation could be embedded into the
command byte, for example the target register address in the GetParam and SetParam
commands, and the argument provides extra data as well as the target position of the GoTo
command.
By default the response byte of the device is h00 (hexadecimal format). Some commands,
for example those used to read the value of a register, generate a response from the device
up to 3 byte long which is transmitted during the following transmission cycles starting from
the most significant byte.
1.2
Daisy chain
The device is compatible with the daisy chain architecture allowing the MCU to drive
multiple devices with a single SPI interface.
The daisy chain architecture is obtained as follows:
Master serial clock line is connected to the CK input of each slave device.
Master slave select line is connected to the CS input of each slave device.
Master serial data output (MOSI) is connected to the SDI input of the first slave of the
chain.
The SDO output of each slave device is connected to the SDI input of the next one, last
slave excluded.
Master serial data input (MISO) is connected to the SDO output of the last slave of the
chain.
DocID025240 Rev 2
3/25
25
The L6480 and L6482 communication interface
The connection diagram of the configuration is shown in
Figure 1.
Figure 1.
MCU
Slave select
Serial clock
Serial data out
Serial data in
CS
CK
SDI
SDO
CS
CK
SDI
SDO
CS
CK
SDI
SDO
CS
CK
SDI
SDO
AN4355
Daisy chain connection diagram
Device 1 (1st of the chain)
Device X
Device X+1
Device N (last of the chain)
to SDI of
device 2
from SDO of
device X -1
to SDI of
device X+2
from SDO of
device N -1
AM16587v1
In this configuration, the chain of slaves acts as a single slave with an SPI device of N byte.
Each communication cycle, for example when the master needs to transmit/receive a byte
from/to a slave, the master must fill all the shift registers of the slaves before raising the CS
line.
The devices are addressed according to the position of the byte in the communication cycle:
the first byte transmitted by the master is received by the last device of the chain; the
second one is received by the last-but-one slave and so on down to the last transmitted byte
which is received by the first slave of the chain. The response bytes from the device chain
are addressed to the same way: the first byte received by the master has been transmitted
by the last device of the chain; the second one has been transmitted by the last-but-one
slave and so on down to the last received byte which has been transmitted by the first slave
of the chain.
In theory, the number of slaves that an MCU can drive using the daisy chain configuration is
unlimited; in practice the maximum number of devices connected to the same SPI depends
on the clock skew.
The number of slaves limits the communication speed also because every time a byte has
to be transmitted to a device, the whole N slave chain has to be filled transmitting N - 1 extra
bytes.
4/25
DocID025240 Rev 2
AN4355
The L6480 and L6482 communication interface
1.3
5 V and 3.3 V communication interface
The device can be configured to operate both with 3.3 V or 5 V standard logic as shown in
Figure 2.
Figure 2. Logic interface supply scenarios
DocID025240 Rev 2
5/25
25