36V 2A + Smart Integrated Stepper Driver With S/D and SPI: General Description
36V 2A + Smart Integrated Stepper Driver With S/D and SPI: General Description
36V 2A + Smart Integrated Stepper Driver With S/D and SPI: General Description
TMC2240 36V 2ARMS+ Smart Integrated Stepper Driver with S/D and SPI
Applications
● Textile, Sewing Machines, Knitting Machines
● Lab and Factory Automation
● 3D Printers, ID Printers/Card Printers
© 2023 Analog Devices, Inc. All rights reserved. Trademarks and registered trademarks are the property of their respective owners.
One Analog Way, Wilmington, MA 01887 U.S.A. | Tel: 781.329.4700 | © 2023 Analog Devices, Inc. All rights reserved.
TMC2240 36V 2ARMS+ Smart Integrated Stepper Driver with S/D and SPI
SINGLE
UART SpreadCycle
WIRE UART
PRGRMMBLE DRV
SPI SPI 256 StealthChop2
MICROSTEP
SEQUENCER
ENCODER
CLK CLK / OSC CoolStep StallGuard2/4
UNIT
TMC2240
ABN
TABLE OF CONTENTS
General Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Benefits and Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Simplified Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Absolute Maximum Ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Package Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
TQFN32 5mm x 5mm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
TSSOP38 9.7mm x 4.4mm EP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Pin Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
TMC2240 TQFN Pin Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
TMC2240 TSSOP Pin Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Pin Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Functional Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
TMC2240 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Principles of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Step and Direction Driver with Serial Interface and Diagnostic Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Key Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Control Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Step and Direction Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Automatic Standstill Power Down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
StealthChop2 and SpreadCycle Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
StallGuard2/4 – Mechanical Load Sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
CoolStep – Load Adaptive Current Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Encoder Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
SPI Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
SPI Datagram Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Selection of Write/Read (WRITE_notREAD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
SPI Status Bits Transferred with Each Datagram Read Back . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Data Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
SPI Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
SPI Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
UART Single-Wire Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Datagram Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Write Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Read Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
CRC Calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
C-Code Example for CRC Calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
LIST OF FIGURES
Figure 1. Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 2. Block Diagram with Typical External Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 3. Automatic Motor Current Control at Standstill and Ramp-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 4. SPI Timing Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Figure 5. UART Daisy-Chaining Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 6. STEP/DIR Signal Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Figure 7. STEP/DIR Signal Input Filter Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Figure 8. MicroPlyer Microstep Interpolation with Rising STEP Frequency (Example: 16 to 256) . . . . . . . . . . . . . . . . . 30
Figure 9. StealthChop2 Automatic Tuning Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 10. StealthChop2: Good Setting for PWM_REG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 11. StealthChop2: Too Small Setting for PWM_REG during AT#2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Figure 12. Successfully Determined PWM_GRAD(_AUTO) and PWM_OFS(_AUTO) . . . . . . . . . . . . . . . . . . . . . . . . . 34
Figure 13. Example for Too Small PWM_GRAD Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Figure 14. Velocity-Based PWM Scaling (pwm_autoscale = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Figure 15. TPWMTHRS for Optional Switching to SpreadCycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Figure 16. Typical Chopper Decay Phases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Figure 17. SpreadCycle Chopper Scheme Showing Coil Current during a Chopper Cycle . . . . . . . . . . . . . . . . . . . . . . 44
Figure 18. Classic Constant Off-Time Chopper with Offset Showing Coil Current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Figure 19. Zero Crossing with Classic Chopper and Correction Using Sine Wave Offset . . . . . . . . . . . . . . . . . . . . . . . 46
Figure 20. Choice of Velocity-Dependent Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Figure 21. Function Principle of StallGuard2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Figure 22. StallGuard4 Mode of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Figure 23. CoolStep Adapts Motor Current to the Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Figure 24. DIAG0 and DIAG1 Output Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Figure 25. Index Signal at Positive Zero Transition of the Coil B Microstep Wave (in Open-Drain Configuration) . . . . . 59
Figure 26. LUT Programming Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Figure 27. Shifting the Cosine Wave through OFFSET_SIN90 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Figure 28. Outline of ABN Signals of an Incremental Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Figure 29. Brake Chopper Circuit Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Figure 30. Quick Configuration Guide for Current Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Figure 31. Quick Configuration Guide for StealthChop2 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Figure 32. Quick Configuration Guide for SpreadCycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Figure 33. Quick Configuration Guide for CoolStep with StealthChop2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Figure 34. Quick Configuration Guide for CoolStep with SpreadCycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Figure 35. Standard Application Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Figure 36. Simple ESD Enhancement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Figure 37. Extended Motor Output Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
LIST OF TABLES
Table 1. SPI Datagram Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Table 2. SPI Read/Write Example Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Table 3. SPI_STATUS – Status Flags Transmitted with Each SPI Access in Bits 39 to 32 . . . . . . . . . . . . . . . . . . . . . . 23
Table 4. UART Write Access Datagram Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Table 5. UART Read Access Request Datagram Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Table 6. UART Read Access Reply Datagram Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Table 7. TMC2240 UART Interface Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Table 8. UART Example for Addressing up to 255 Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Table 9. Fullstep/Half Step Lookup Table Values for Phase A/B Coil Currents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Table 10. Constraints and Requirements for StealthChop2 Autotuning AT#1 and AT#2 . . . . . . . . . . . . . . . . . . . . . . . . 30
Table 11. Choice of PWM Frequency for StealthChop2 (Bold Font = Recommended) . . . . . . . . . . . . . . . . . . . . . . . . . 32
Table 12. Parameters Controlling StealthChop2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Table 13. Parameters Controlling SpreadCycle and Classic Constant Off Time Chopper . . . . . . . . . . . . . . . . . . . . . . . 42
Table 14. SpreadCycle Mode Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Table 15. Parameters Controlling Constant Off-Time Chopper Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Table 16. Parameters Controlling the Motor Current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Table 17. IFS Full-Scale Peak Range Settings (Example for RREF = 12kΩ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Table 18. IFS Full-Scale RMS Current in Ampere (A RMS) Based on DRV_CONF Bits 1..0 Setting and Different
RREF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Table 19. Velocity-Based Mode Control Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Table 20. StallGuard2-Related Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Table 21. StallGuard4-Related Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Table 22. CoolStep Critical Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Table 23. CoolStep Additional Parameters and Status Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Table 24. Encoder Example Settings for a 200 Fullstep Motor with 256 Microsteps . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Table 25. Methods for Position Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Table 26. Overcurrent Protection Thresholds Based on the Full-Scale Current Setting . . . . . . . . . . . . . . . . . . . . . . . . . 67
Table 27. Overview of Register Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. These are stress ratings only, and functional operation of the
device at these or any other conditions beyond those indicated in the operational sections of the specifications is not implied. Exposure to absolute maximum rating conditions for
extended periods may affect device reliability.
Package Information
TQFN32 5mm x 5mm
Package Code T3255+5C
Outline Number 21-0140
Land Pattern Number 90-0013
Thermal Resistance, Single-Layer Board:
Junction to Ambient (θJA) 47°C/W
Junction to Case (θJC) 1.7°C/W
Thermal Resistance, Four-Layer Board:
Junction to Ambient (θJA) 29°C/W
Junction to Case (θJC) 1.7°C/W
Electrical Characteristics
(VS = 4.5V to 36V, RREF = from 12kΩ to 24kΩ , Typical Values assume TA = 25ºC and VS = 24V, Limits are 100% tested at TA =
+25°C. Limits over the operating temperature range and relevant supply voltage range are guaranteed by design and characterization.)
PARAMETER SYMBOL CONDITIONS MIN TYP MAX UNITS
POWER SUPPLY
Supply Voltage Range VS 4.5 36 V
Sleep Mode Current
IVS V(SLEEPN) = 0 4 18 μA
Consumption
Pin Configurations
TMC2240 TQFN Pin Configuration
OUT1A
OUT1B
OUT2A
OUT2B
TOP VIEW
VS
VS
VS
VS
24 23 22 21 20 19 18 17
SLEEPN 25 16 VCP
CSN/AD2 26 15 CPO
SCK/AD1 27 14 CPI
SDI/AD0 28 13 OV
TMC2240
SDO/NAO 29 12 DIAG1/SW
CLK 30 11 DIAG0
1 2 3 4 5 6 7 8
IREF
ENCB
ENCA
AIN
VDD1V8
ENCN
VCC_IO
AGND
TQFN
5mm x 5mm
SLEEPN
OUT2B
OUT1A
OUT2A
OUT1B
PGND
PGND
CPO
CPI
VCP
NC
NC
NC
NC
VS
VS
VS
38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20
TMC2240
EP = GND
+
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
CLK
NC
DIR
DIAG0
AGND
ENCN
UART_EN
VCC_IO
VDD1V8
IREF
SDI/AD0
SDO/NAO
STEP
OV
ENCB
DIAG1/SW
AIN
ENCA
DRV_ENN
TSSOP38
4.4mm x 9.7mm
Pin Description
PIN REF
NAME FUNCTION TYPE
TQFN32 TSSOP38 SUPPLY
4 10 AGND Analog Ground. Connect to ground plane. GND
27, 31 PGND Power ground. Connect to ground plane. GND
Motor supply voltage. Provide filtering capacity
17, 20, 21, 24 25, 29, 33 VS near pin with shortest loop to GND plane/exposed Supply
pad.
Output of internal 1.8V regulator. Attach 2.2µF or
3 9 VDD1V8 larger ceramic capacitor to AGND near to pin for Supply
best performance.
Charge pump voltage. Tie to VS using 1.0µF
capacitor.
Analog
16 23 VCP
Output
Connect positive end of capacitor close to VS pin
to avoid inductive peaks.
Digital IO supply voltage provided from external
5 11 VCC_IO source to define circuit IO level. Required for VCC_IO Analog Input
proper voltage level settings on output pins.
Analog
15 22 CPO Charge pump capacitor output.
Output
Charge pump capacitor input. Tie to CPO using Analog
14 20 CPI
22nF 50V capacitor. Output
CLK input. Tie to GND using short wire for
internal clock or supply external clock. Internal
30 3 CLK VCC_IO Digital Input
clock-fail over circuit protects against loss of
external clock signal.
31 5 STEP STEP input. VCC_IO Digital Input
32 6 DIR Direction input. VCC_IO Digital Input
SPI chip select input (negative active) (UART_EN
Digital Input
26 36 CSN/AD2 = 0) or Address input 2 (+4) in UART mode VCC_IO
(pull up)
(UART_EN = 1).
SPI serial clock input (UART_EN = 0) or address Digital Input
27 38 SCK/AD1 VCC_IO
input 1 (+2) in UART mode (UART_EN = 1). (pull up)
SPI data input (UART_EN = 0) or address input 0 Digital Input
28 1 SDI/AD0 VCC_IO
(+1) in UART mode (UART_EN = 1). (pull up)
SPI data output (three-state) (UART_EN = 0) or
29 2 SDO/NAO next address output (NAO) in UART mode VCC_IO Digital Output
(UART_EN = 1).
Analog reference current for current scaling.
1 7 IREF VCC_IO Analog Input
Provide external resistor to GND.
Interface selection pin.
12 18 DIAG1/SW Use external pullup resistor in open drain mode. VCC_IO Digital IO
fCLK
.
2048
General-purpose analog input measured with
f
internal ADC with CLK .
2048
2 8 AIN VCC_IO Analog Input
Input range 0 to 1.25V.
Functional Diagrams
TMC2240
STEP
IREF
DIR
F = SPIKE FILTER F F
VCC_IO
VS
IREF
IREF
CoolStep
DIAG1/SW
IRQ & DIAG
DIAG0 StallGuard2
OUTPUTS
OV
StallGuard4 HB2 OUT2B
VS
TEMP ISENSE
AIN ADC
ENCODER HB1
CLK OUT1B
UNIT
CLK/OSC A B N ISENSE VS
ENCB
ENCN
ENCA
AGND
SLEEPN
GND (EP)
DRV_ENN
Detailed Description
Principles of Operation
Step and Direction Driver with Serial Interface and Diagnostic Feedback
The TMC2240 is a smart Step and Direction stepper motor driver with serial interface (SPI, UART) for parameterization
and monitoring & diagnostics.
An external high-performance motion controller like the TMC4361A or a CPU generates step and direction signals
synchronized to other components like additional motors within the system. The TMC2240 takes care of intelligent current
control and provides feedback on the state of the motor via one of its serial interfaces.
+VIO RRef
VCC_IO
STEP
IREF
DIR
100n
F = SPIKE FILTER F F 100n +VS
VS
+VS
VCP OUT1A
HB1
1µ CPI CHARGE
IREF ISENSE
PUMP STEP &
CPO
22n DIR
PULSE
HB2 OUT2A
VDD1V8 1.8V LDO GEN
ISENSE
2.2µ 2-PHASE
STEPPER
MOTOR
IREF
N
CSN/AD2 DRV_ENN COMP DAC S
SCK/AD1 CHOP
SDI/AD0 CONTROL MODES
IF REGISTER CONFIG.
SDO/NAO
SET SINE
TABLE PROTECT
UART_EN & DIAG COMP DAC
IREF
CoolStep
DIAG1/SW
IRQ & DIAG
DIAG0 StallGuard2
OUTPUTS
OV
HB2 OUT2B
StallGuard4
VS
TEMP ISENSE
OPT. EXT. AIN ADC
CLOCK
8MHz-20MHz ENCODER HB1 OUT1B
CLK
UNIT
CLK/OSC A B N ISENSE VS
100n +VS
ENCB
ENCN
ENCA
AGND
SLEEPN
GND (EP)
DRV_ENN
Key Concepts
The TMC2240 implements advanced features which are exclusive to ADI-Trinamic products. These features contribute
toward greater precision, greater energy efficiency, higher reliability, smoother motion, and cooler operation in many
stepper motor applications.
StealthChop2 No-noise, high-precision chopper algorithm for inaudible motion and standstill of the motor
SpreadCycle High-precision cycle-by-cycle current control for highest dynamic movements
StallGuard2 Sensorless stall detection and mechanical load measurement
StallGuard4 Sensorless homing safes end switches and warns in case of motor overload
Active peak current control based on StallGuard feedback for best efficiency and lowest motor and driver
CoolStep
temperature
MicroPlyer Microstep interpolator to run at full 256 microstepping with low resolution step input
In addition to these performance enhancements, ADI-Trinamic motor drivers offer safeguards to detect and protect
against shorted outputs, output open-circuit, overtemperature, and undervoltage conditions to enhance safety and
recovery from equipment malfunctions.
Control Interfaces
The TMC2240 supports both, an SPI interface and a UART-based single-wire interface with CRC checking. Selection
of the actual interface combination is done through the UART_EN pin, which can be hardwired to GND or VCC_IO
depending on the desired interface selection.
The SPI interface is a bit-serial interface synchronous to a bus clock. For every bit sent from the bus controller to the
bus peripheral, another bit is sent simultaneously from the peripheral back to the controller. Communication between an
SPI controller (e.g., an MCU) and the peripheral always consists of sending one 40-bit command word and receiving one
40-bit status word.
The single-wire interface allows a bidirectional single-wire interfacing. It can be driven by any standard UART. No baud
rate configuration is required.
STEP
STANDSTILL FLAG
(stst)
CURRENT LEVELS
IRUN
IHOLD
t
IRUNDELAY STANDSTILL DELAY TPOWERDOWN IHOLDDELAY
2^20 / 2^18 CLOCKS
POWER UP (faststandstill) POWER DOWN POWER DOWN
RAMP TIME DELAY TIME DELAY TIME
Benefits
● Highest energy efficiency, power consumption decreased by up to 75%
● Motor generates less heat
● Improved mechanical precision
● Less or no cooling
● Improved reliability
● Use of smaller motor is possible, less torque reserve required
● Less motor noise due to less energy exciting motor resonances
Encoder Interface
The TMC2240 provides an encoder interface for external incremental encoders. The encoder can be used for
consistency checks on-the-fly between encoder position and external ramp generator position. A programmable
prescaler allows the adaptation of the encoder resolution to the motor resolution. A 32-bit encoder counter is provided.
SPI Interface
SPI Datagram Structure
The TMC2240 uses 40-bit SPI datagrams for communication with a microcontroller. Microcontrollers which are equipped
with hardware SPI are typically able to communicate using integer multiples of 8 bits. The CSN line of the device must
stay active (= low) for the complete duration of the datagram transmission.
Each datagram sent to the device is composed of an address byte followed by four data bytes. This allows direct 32-bit
data word communication with the register set. Each register is accessed through 32 data bits even if it uses less than
32 data bits.
For simplification, each register is specified by a one byte address:
● For a read access, the most significant bit of the address byte is 0.
● For a write access, the most significant bit of the address byte is 1.
All registers are readable, most of them are read write, some read only, and some write 1 to clear (e.g., GSTAT registers).
Table 1. SPI Datagram Structure
MSB (TRANSMITTED FIRST) 40 BIT LSB (TRANSMITTED LAST)
39 ... 0
write: 8 bit address
read/write 32 bit data
read: 8 bit SPI status
39 ... 32 31 ... 0
write to
RW + 7 bit address
8 bit data 8 bit data 8 bit data 8 bit data
read from
8 bit SPI status
39 / 38 ... 32 31 ... 24 23 ... 16 15 ... 8 7 ... 0
W 38...32 31...28 27...24 23...20 19...16 15...12 11...8 7...4 3...0
Data Alignment
All data are right aligned. Some registers represent unsigned (positive) values, some represent integer values (signed)
as two’s complement numbers, single bits or groups of bits are represented as single bits respectively as integer groups.
SPI Signals
The SPI bus on the TMC2240 has four signals:
● SCK – bus clock input
● SDI – serial data input
● SDO – serial data output
● CSN – chip select input (active low)
The SPI peripheral is enabled for an SPI transaction by a low on the chip select input CSN. Bit transfer is synchronous
to the bus clock SCK, with the peripheral latching the data from SDI on the rising edge of SCK and driving data to SDO
following the falling edge. The most significant bit is sent first. A minimum of 40 SCK clock cycles is required for a bus
transaction with the TMC2240.
If more than 40 clocks are driven, the additional bits shifted into SDI are shifted out on SDO after a 40-clock delay through
an internal shift register. This can be used for daisy chaining multiple chips.
The CSN must be low during the whole bus transaction. When CSN goes high, the contents of the internal shift register
are latched into the internal control register and recognized as a command from the SPI controller to the SPI peripheral. If
more than 40 bits are sent, only the last 40 bits received before the rising edge of CSN are recognized as the command.
SPI Timing
The SPI max frequency is at 10MHz. SCK is independent from the clock frequency of the system while the only parameter
depending on the clock frequency is the minimum CSN high time. All SPI inputs are internally filtered to avoid triggering
on pulses shorter than 10ns. The figure shows the timing parameters of an SPI bus transaction. Timing values are given
in the EC table.
The SPI interface uses SPI MODE 3.
CSN
SCK
tDU tDH
tDO tZC
Datagram Structure
Write Access
Table 4. UART Write Access Datagram Structure
EACH BYTE IS LSB…MSB, HIGHEST BYTE TRANSMITTED FIRST
0 … 63
8 bit node RW + 7 bit register
sync + reserved 32 bit data CRC
address addr.
0…7 8…15 16…23 24…55 56…63
Reserved (don’t cares but register data bytes 3, 2, 1, 0 (high to
1 0 1 0 NODEADDR 1 CRC
included in CRC) address low byte)
0 1 2 3 4 5 6 7 8 … 15 16 … 23 24 … 55 56 … 63
A sync nibble precedes each transmission to and from the TMC2240 and is embedded into the first transmitted byte,
followed by an addressing byte. Each transmission allows a synchronization of the internal baud rate divider to the UART
host clock. The actual baud rate is adapted and variations of the internal clock frequency are compensated. Thus, the
baud rate can be freely chosen within the valid range. Each transmitted byte starts with a start bit (logic 0, low level on
DIAG1/SW) and ends with a stop bit (logic 1, high level on DIAG1/SW). The bit time is calculated by measuring the time
from the beginning of start bit (1 to 0 transition) to the end of the sync frame (1 to 0 transition from bit 2 to bit 3). All data
is transmitted byte wise. The 32-bit data words are transmitted with the highest byte first.
A minimum baud rate of 9000 baud is permissible, assuming 20MHz clock (worst case for low baud rate). Maximum baud
rate is fCLK/16 due to the required stability of the baud clock.
The initial peripheral address NODEADDR is selected by CSN_AD2, SCK_AD1, SDI_AD0 in the range 0 to 7.
The peripheral address is determined by the sum of the register NODEADDR and the pin selection given above. This
means that a high level on SDI (with CSN low and SCK low) increments the NODEADDR setting by one.
Bit 7 of the register address identifies a Read (0) or a Write (1) access. Example: Address 0x10 is changed to 0x90 for a
write access.
The communication becomes reset if a pause time of longer than 63 bit times between the start bits of two successive
bytes occurs. This timing is based on the last correctly received datagram. In this case, the transmission needs to be
restarted after a failure recovery time of minimum 12 bit times of bus idle time. This scheme allows the UART host to
reset communication in case of transmission errors. Any pulse on an idle data line below 16 clock cycles is treated as a
glitch and leads to a timeout of 12 bit times, for which the data line must be idle. Other errors like wrong CRC are also
treated the same way. This allows a safe resynchronization of the transmission after any error conditions. Consider that
due to this mechanism an abrupt reduction of the baud rate to less than 15% of the previous value is not possible.
Each accepted write datagram becomes acknowledged by the receiver by incrementing an internal cyclic datagram
counter (8 bit). Reading out the datagram counter allows the UART host to check the success of an initialization sequence
or single write accesses. Read accesses do not modify the counter.
Read Access
Table 5. UART Read Access Request Datagram Structure
EACH BYTE IS LSB…MSB, HIGHEST BYTE TRANSMITTED FIRST
sync + reserved 8 bit node address RW + 7 bit register address CRC
0...7 8…15 16…23 24…31
1 0 1 0 Reserved (don’t cares but included in CRC) NODEADDR register address 0 CRC
0 1 2 3 4 5 6 7 8 … 15 16 … 23 24 … 31
The read access request datagram structure is identical to the write access datagram structure, but uses a lower number
of user bits. Its function is the addressing of the UART node and the transmission of the desired register address for the
read access. The TMC2240 responds with the same baud rate as the UART host uses for the read request.
In order to ensure a clean bus transition from the host to the node, the TMC2240 does not immediately send the reply
to a read access, but it uses a programmable delay time after which the first reply byte becomes sent following a read
request. This delay time can be set in multiples of eight bit times using SENDDELAY time setting (default = 8 bit times)
according to the needs of the UART host. In a multi-node system, set SENDDELAY to min. 2 for all nodes. Otherwise a
non-addressed node might detect a transmission error upon read access to a different node.
Table 6. UART Read Access Reply Datagram Structure
EACH BYTE IS LSB…MSB, HIGHEST BYTE TRANSMITTED FIRST
0 ...... 63
sync + reserved 8 bit node address RW + 7 bit register addr. 32 bit data CRC
0…7 8…15 16…23 24…55 56…63
1 0 1 0 reserved (0) 0xFF register address 0 data bytes 3, 2, 1, 0 (high to low byte) CRC
0 1 2 3 4 5 6 7 8 … 15 16 … 23 24 … 55 56 … 63
The read response is sent to the UART host using address code %11111111. The transmitter becomes switched inactive
four bit times after the last bit is sent.
Address %11111111 is reserved for read accesses going to the UART host. A node cannot use this address.
CRC Calculation
An 8-bit CRC polynomial is used for checking both read and write access. It allows detection of up to eight single-bit
errors. The CRC8-ATM polynomial with an initial value of zero is applied LSB to MSB, including the sync and addressing
byte. The sync nibble is assumed to be always correct. The TMC2240 responds only to correctly transmitted datagrams
containing its own node address. It increases its datagram counter for each correctly received write access datagram.
CRC = x8 + x2 + x1 + x0
Serial calculation example
CRC = (CRC << 1) OR (CRC.7 XOR CRC.1 XOR CRC.0 XOR [new incoming bit])
*crc = 0;
UART Signals
The UART interface on the TMC2240 comprises five signals. In UART mode, each node checks the single-wire pin
DIAG1/SW for correctly received datagrams with its own address continuously. The pin is switched as input during this
time. It adapts to the baud rate based on the sync nibble, as described earlier. In case of a read access, it switches on
its output driver on DIAG1/SW and sends its response using the same baud rate.
Table 7. TMC2240 UART Interface Signals
SIGNAL DESCRIPTION
DIAG1/SW Data input and output
CSN/AD2 Bit 2 of UART address increment (+4)
SCK/AD1 Bit 1 of UART address increment (+2)
SDI/AD0 Bit 0 of UART address increment (+1), tie to NAO of previous IC in chain
SDO/NAO NAO pin for chained sequential addressing scheme (reset default = high)
+VCC_IO
DIAG1/SW
DIAG1/SW
DIAG1/SW
HOST
RIDLE
CPU WITH UART
TXD
FIRMWARE
SWITCHES TXD RXD
TO THREE-
STATE FOR RIDLE FORCES STOP BIT LEVEL IN IDLE CONDITION,
RECEIVING 3k3 IS SUFFICIANT WTH 14 NODES FOR EXAMPLE
Step/Direction Interface
The STEP and DIR inputs provide a simple, standard interface compatible with many existing motion controllers. The
MicroPlyer step pulse interpolator brings the smooth motor operation of high-resolution microstepping to applications
originally designed for coarser stepping.
Timing
The figure below shows the timing parameters for the STEP and DIR signals. When the dedge mode bit in the
CHOPCONF register is set, both edges of STEP are active. If dedge is cleared, only rising edges are active. STEP and
DIR are sampled and synchronized to the system clock. An internal analog filter of approximately 10ns removes glitches
on the signals, such as those caused by long PCB traces. If the signal source is far from the chip, and especially if the
signals are carried on cables, the signals should be filtered or transmitted differentially.
See the Electrical Characteristics table for the specified timing parameters.
DIR
STEP
(dedge = 0)
ACTIVE EDGE
(dedge = 0)
ACTIVE EDGE
Figure 6. STEP/DIR Signal Timing
VCC_IO 1.8V
10ns±40%
STEP/ LEVEL INTERNAL
DIR SHIFTER SIGNAL
Changing Resolution
A reduced microstep resolution allows limitation of the step frequency for the STEP/DIR interface, or compatibility to an
older, less performing driver. The internal microstep table with 1024 sine wave entries generates sinusoidal motor coil
currents. These 1024 entries correspond to one electrical revolution or four fullsteps. The microstep resolution setting
determines the step width taken within the table. Depending on the DIR input, the microstep counter is increased (DIR =
0) or decreased (DIR = 1) with each STEP pulse by the step width. The microstep resolution determines the increment
respectively the decrement. At maximum resolution, the sequencer advances one step for each step pulse. At half
resolution, it advances two steps. Increment is up to 256 steps for fullstepping. The sequencer has special provision to
allow seamless switching between different microstep rates at any time. When switching to a lower microstep resolution,
it calculates the nearest step within the target resolution and reads the current vector at that position. This behavior
especially is important for low resolutions like fullstep and halfstep, because any failure in the step sequence would lead
to asymmetrical run when comparing a motor running clockwise and counterclockwise.
Examples:
Fullstep: Cycles through table positions: 128, 384, 640, and 896 (45°, 135°, 225°, and 315° electrical position, both coils
on at identical current). The coil current in each position corresponds to the RMS-Value (0.71 x amplitude). Step size is
256 (90° electrical)
Half step: The first table position is 64 (22.5° electrical), Step size is 128 (45° steps)
Quarter step: The first table position is 32 (90°/8 = 11.25° electrical), Step size is 64 (22.5° steps)
This way equidistant steps result and they are identical in both rotation directions. Some older drivers also use zero
current (table entry 0, 0°) as well as full current (90°) within the step tables. This kind of stepping is avoided because it
provides less torque and has a worse power dissipation in driver and motor.
Table 9. Fullstep/Half Step Lookup Table Values for Phase A/B Coil Currents
STEP POSITION TABLE POSITION CURRENT COIL A CURRENT COIL B
Half step 0 64 38.3% 92.4%
Fullstep 0 128 70.7% 70.7%
Half step 1 192 92.4% 38.3%
Half step 2 320 92.4% -38.3%
Fullstep 1 384 70.7% -70.7%
Half step 3 448 38.3% -92.4%
Half step 4 576 -38.3% -92.4%
Fullstep 2 640 -70.7% -70.7%
Half step 5 704 -92.4% -38.3%
Half step 6 832 -92.4% 38.3%
Fullstep 3 896 -70.7% 70.7%
Half step 7 960 -38.3% 92.4%
(dedge=0)
(dedge=0)
(dedge=0)
(dedge=0)
ACTIVE
ACTIVE
ACTIVE
ACTIVE
EDGE
EDGE
EDGE
EDGE
STEP
INTER-
POLATED
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 32 40 48 56 64
MICROSTEP
MOTOR
ANLGE
2^20 tCLK
STANDSTILL
(stst) ACTIVE
Figure 8. MicroPlyer Microstep Interpolation with Rising STEP Frequency (Example: 16 to 256)
In the figure, the first STEP cycle is long enough to set the standstill bit stst. This bit is cleared on the next STEP
active edge. Then, the external STEP frequency increases. After one cycle at the higher rate MicroPlyer adapts the
interpolated microstep rate to the higher frequency. During the last cycle at the slower rate, MicroPlyer did not generate
all 16 microsteps, so there is a small jump in motor angle between the first and second cycles at the higher rate.
StealthChop2
StealthChop2 is an extremely quiet mode of operation for stepper motors. It is based on a voltage mode PWM. In
case of standstill and at low velocities, the motor is absolutely noiseless. Thus, StealthChop2-operated stepper motor
applications are very suitable for indoor or home use. The motor operates absolutely free of vibration at low velocities.
With StealthChop, the motor current is applied by driving a certain effective voltage into the coil, using a voltage mode
PWM. With the enhanced StealthChop2, the driver automatically adapts to the application for best performance. No more
configurations are required. Optional configuration allows for tuning the setting in special cases, or for setting initial values
for the automatic adaptation algorithm. For high velocity drives, SpreadCycle should be considered in combination with
StealthChop2.
Operate the motor within your application when exploring StealthChop2. Motor performance often is better with a
mechanical load because it prevents the motor from stalling due to mechanical oscillations which can occur without load.
Automatic Tuning
StealthChop2 integrates an automatic tuning (AT) procedure, which adapts the most important operating parameters to
the motor automatically. This way, StealthChop2 allows high motor dynamics and supports powering down the motor to
very low currents. Just two steps have to be taken into account for best results: Start with the motor in standstill, but
powered with nominal run current (AT#1). Move the motor at a medium velocity, e.g., as part of a homing procedure
(AT#2). The flowchart in the next figure shows the tuning procedure.
Table 10. Constraints and Requirements for StealthChop2 Autotuning AT#1 and
AT#2
STEP PARAMETER CONDITIONS REQUIRED DURATION
Table 10. Constraints and Requirements for StealthChop2 Autotuning AT#1 and
AT#2 (continued)
AT#1 PWM_ ● Motor in standstill and actual current scale (CS) is ≤ 220 + 2 x 218 tCLK,
OFS_AUTO identical to run current (IRUN). ≤ 130ms
● If standstill reduction is enabled, an initial step (with internal clock)
pulse switches the drive back to run current, or set
IHOLD to IRUN.
● Pin VS at operating level.
AT#2 PWM_ ● Move motor at a velocity, where a significant 8 fullsteps are required for a change of ±1.
GRAD_AUTO amount of back EMF is generated and where the For a typical motor with PWM_GRAD_AUTO
full run current can be reached. Conditions: optimum at 50 or less, up to 400 fullsteps are
● 1.5 x PWM_OFS_AUTO x (IRUN+1)/32 < required when starting from default value 0.
PWM_SCALE_SUM < 4 x PWM_OFS_AUTO x
(IRUN+1)/32
● PWM_SCALE_SUM < 255
Hint: A typical range is 60RPM to 300RPM.
Hint:
Determine best conditions for automatic tuning with the evaluation board.
Use application-specific parameters for PWM_GRAD and PWM_OFS for initialization in firmware to provide initial tuning
parameters.
Monitor PWM_SCALE_AUTO going down to zero during the constant velocity phase in AT#2 tuning. This indicates a
successful tuning.
Attention:
Operating in StealthChop2 without proper tuning can lead to high motor currents during a deceleration ramp, especially
with low resistive motors and fast deceleration settings. Follow the automatic tuning process and check optimum tuning
conditions using the evaluation board. It is recommended to use an initial value for settings PWM_OFS and PWM_GRAD
determined per motor type.
Modifying GLOBALSCALER or VS voltage invalidates the result of the automatic tuning process. Motor current regulation
cannot compensate significant changes until next AT#1 phase. Automatic tuning adapts to changed conditions whenever
AT#1 and AT#2 conditions are fulfilled in the later operation.
StealthChop2 Options
In order to match the motor current to a certain level, the effective PWM voltage becomes scaled depending on the actual
motor velocity. Several additional factors influence the required voltage level to drive the motor at the target current: The
motor resistance, its back EMF (e.g., directly proportional to its velocity) as well as the actual level of the supply voltage.
Two modes of PWM regulation are provided: The automatic tuning mode (AT) using current feedback (pwm_autoscale
= 1, pwm_autograd = 1) and a feed forward velocity-controlled mode (pwm_autoscale = 0). The feed forward velocity-
controlled mode does not react to a change of the supply voltage or to events like a motor stall, but it provides very stable
amplitude. It does not use or require any means of current measurement. This is perfect when motor type and supply
voltage are well known. Therefore, we recommend the automatic mode, unless current regulation is not satisfying in the
given operating conditions.
It is recommended to use application-specific initial tuning parameters, fitting the motor type and supply voltage.
Additionally, operate in automatic tuning mode in order to respond to parameter change, e.g., due to motor heat-up or
change of supply voltage.
Non-automatic mode (pwm_autoscale = 0) should be taken into account only with well-known motor and operating
conditions. In this case, careful programming via the interface is required. The operating parameters PWM_GRAD and
PWM_OFS can be determined in automatic tuning mode initially.
The StealthChop2 PWM frequency can be chosen in four steps in order to adapt the frequency divider to the frequency
of the clock source. A setting in the range of 20kHz–50kHz is good for most applications. It balances low current ripple
and good higher velocity performance vs. dynamic power dissipation.
Power-up
PWM_GRAD_AUTO becomes
initialized upon power-up
Y Y
PWM_
GRAD_AUTO initialized from Y
CPU?
Store PWM_GRAD_AUTO to
Ready StealthChop2 settings are optimized! Option with interface CPU memory for faster
tuning procedure
Table 11. Choice of PWM Frequency for StealthChop2 (Bold Font = Recommended)
CLOCK FREQUENCY PWM_FREQ = %00 PWM_FREQ = %01 PWM_FREQ = %10 PWM_FREQ = %11
fCLK fPWM = 2/1024 fCLK fPWM = 2/683 fCLK fPWM = 2/512 fCLK fPWM = 2/410 fCLK
20MHz 39.1kHz 58.1kHz 78.1kHz 97.6kHz
18MHz 35.2kHz 52.7kHz 70.3kHz 87.8kHz
16MHz 31.3kHz 46.9kHz 62.5kHz 78.0kHz
Table 11. Choice of PWM Frequency for StealthChop2 (Bold Font = Recommended)
(continued)
12.5MHz (internal) 24.4kHz 36.6kHz 48.8kHz 61.0kHz
10MHz 19.5kHz 29.3kHz 39.1kHz 48.8kHz
8MHz 15.6kHz 23.4kHz 31.2kHz 39.0kHz
Figure 11. StealthChop2: Too Small Setting for PWM_REG during AT#2
The quality of the setting PWM_REG in phase AT#2 and the finished automatic tuning procedure (or non-automatic
settings for PWM_OFS and PWM_GRAD) can be examined when monitoring motor current during an acceleration phase
as shown in the next figure.
MOTOR CURRENT
PWM SCALE
VELOCITY
PWM REACHES MAX AMPLITUDE
255
GR
D
RA
AD=
STANDSTILL PWM
SCALE
0
0 t
MOTOR CURRENT
PWM SCALE
VELOCITY
NOMINAL
CURRENT
(SINE WAVE RMS)
0
t
0
IRUN ≥ 8: Current settings for IRUN below 8 do not work with automatic tuning.
ILOWERLIMIT: Depending on the setting of bit pwm_meas_sd_enable (in register PWM_CONF[22]) for automatic tuning,
a lower coil current limit applies.The motor current in automatic tuning phase AT#1 must exceed this lower limit. Calculate
ILOWERLIMIT or measure it using a current probe. Setting the motor run-current or hold-current below the lower current
limit during operation by modifying IRUN and IHOLD is possible after successful automatic tuning. The lower current limit
also limits the capability of the driver to respond to changes of GLOBALSCALER.
The lower current limit also limits the capability of the driver to respond to changes of GLOBALSCALER.
To overcome the lower limit set pwm_meas_sd_enable = 1. This allows the IC to additionally measure coil current in the
slow decay phase.
Velocity-Based Scaling
Velocity-based scaling scales the StealthChop2 amplitude based on the time between every two steps, e.g., based on
TSTEP, measured in clock cycles. This concept basically does not require a current measurement, because no regulation
loop is necessary. A pure velocity-based scaling is available via programming, only, when setting pwm_autoscale = 0.
The basic idea is to have a linear approximation of the voltage required to drive the target current into the motor. The
stepper motor has a certain coil resistance and thus needs a certain voltage amplitude to yield a target current based on
the basic formula I = U/R. With R being the coil resistance, U the supply voltage scaled by the PWM value, the current I
results. The initial value for PWM_OFS can be calculated:
374 × RCOIL × ICOIL
PWM_OFS = VS
With VS the motor supply voltage and ICOIL the target RMS current
The effective PWM voltage UPWM (1/SQRT(2) x peak value) results considering the 8-bit resolution and 248 sine wave
peak for the actual PWM amplitude shown as PWM_SCALE:
PWM_SCALE 248 1 PWM_SCALE
UPWM = VS × 256
× 256 × 2 = VS ×
√ 374
With rising motor velocity, the motor generates an increasing back EMF voltage. The back EMF voltage is proportional to
the motor velocity. It reduces the PWM voltage effective at the coil resistance and thus current decreases. The TMC2240
provides a second velocity dependent factor (PWM_GRAD) to compensate for this. The overall effective PWM amplitude
(PWM_SCALE_SUM) in this mode automatically is calculated in dependence of the microstep frequency as:
CS_ACTUAL takes into account the actual current scaling as defined by IHOLD and IRUN or respectively by CoolStep.
With fSTEP being the microstep frequency for 256 microstep resolution equivalent and fCLK the clock frequency supplied
to the driver or the actual internal frequency.
As a first approximation, the back EMF subtracts from the supply voltage and thus the effective current amplitude
decreases. This way, a first approximation for PWM_GRAD setting can be calculated:
[]
V
rad fclk × 1.46
PWM_GRAD = CBEMF s × 2π × V × MSPR
M
CBEMF is the back EMF constant of the motor in Volts per radian/second.
MSPR is the number of microsteps per rotation related to 1/256 microstep resolution, e.g., 51200 = 256 microsteps
multiplied by 200 fullsteps for a 1.8° motor.
MOTOR
CURRENT
PWM SCALING
(PWM_STATUS) PWM REACHES MAX AMPLITUDE
255
AD
_GR
P WM
CONSTANT MOTOR RMS
CURRENT
(DE C
NOMINAL CURRENT PEN URREN
DS T
(e.g.SINE WAVE RMS) ON DROP
MO
TOR S
LOA
D )
PWM_AMPL
0
VELOCITY
0 VPWMMAX
The values for PWM_OFS and PWM_GRAD can easily be optimized by tracing the motor current with a current
probe on the oscilloscope. Alternatively, automatic tuning determines these values and they can be read out from
PWM_OFS_AUTO and PWM_GRAD_AUTO.
Understanding the back EMF constant of a motor:
The back EMF constant is the voltage a motor generates when turned with a certain velocity. Often motor datasheets
do not specify this value, as it can be deducted from motor torque and coil current rating. Within SI units, the numeric
value of the back EMF constant CBEMF has the same numeric value as the numeric value of the torque constant. For
example, a motor with a torque constant of 1 Nm/A would have a CBEMF of 1V/rad/s. Turning such a motor with 1rps
(1rps = 1 revolution per second = 6.28 rad/s) generates a back EMF voltage of 6.28V. Thus, the back EMF constant can
be calculated as:
[]
V HoldingTorque[Nm]
CBEMF rad = 2 × I
s
COILNOM[A]
ICOILNOM is the motor’s rated RMS phase current for the specified holding torque.
HoldingTorque is the motor specific holding torque, e.g., the torque reached at ICOILNOM on both coils. The torque unit
is [Nm] where 1Nm = 100Ncm = 1000mNm.
The voltage is valid as RMS voltage per coil, thus the nominal current is multiplied by 2 in this formula, since the nominal
current assumes a fullstep position, with two coils operating.
CHOPPER MODE
StealthChop2
MOTOR IN STANDBY
MOTOR GOING TO STANDBY
MOTOR
MOTOR IN RUNNING RUNNING RUNNING IN
STANDBY LOW SPEED HIGH SPEED LOW SPEED STAND-
TSTEP < STILL
TPWMTHRS+TPWMTHRS/16
TSTEP > TPWMTHRS
0
t
CURRENT
I_RUN
I_HOLD
t
VACTUAL
IHOLDDELAY
TPOWERDOWN
~1/TSTEP RMS CURRENT
As a first step, both chopper principles should be parameterized and optimized individually.
In a next step, the switchover velocity has to be defined. For example, StealthChop2 operation is used for precise low
speed positioning, while SpreadCycle shall be used for highly dynamic motion. TPWMTHRS determines this transition
velocity. Read out TSTEP when moving at the desired velocity and program the resulting value to TPWMTHRS. Use a
low transfer velocity to avoid a jerk at the switching point.
Jerkless switching to SpreadCycle:
A jerk occurs when switching at higher velocities, because the back-EMF of the motor (which rises with the velocity)
causes a phase shift of up to 90° between motor voltage and motor current. So when switching at higher velocities
between voltage PWM and current PWM mode, this jerk occurs with increased intensity. A high jerk may even produce
a temporary overcurrent condition (depending on the motor coil resistance). At low velocities (e.g., 1 to a few 10RPM),
it can be completely neglected for most motors. Therefore, consider the jerk when switching the driver between
SpreadCycle and StealthChop2. With automatic switching controlled by TPWMTHRS, the driver can automatically
eliminate the jerk by using StallGuard4 to determine the phase shift. It applies the same phase shift to SpreadCycle until
the velocity falls back below the switching threshold. Set flag SG4_THRS.sg_angle_offset to enable this function.
Set TPWMTHRS zero if you want to work with StealthChop2 only.
When enabling the StealthChop2 mode the first time using automatic current regulation, the motor must be at standstill
in order to allow a proper current regulation. When the drive switches to SpreadCycle at a higher velocity, StealthChop2
logic stores the last current regulation setting until the motor returns to a lower velocity again. This way, the regulation
has a known starting point when returning to a lower velocity, where StealthChop2 becomes re-enabled. Therefore,
neither the velocity threshold nor the supply voltage must be considerably changed during the phase while the chopper
is switched to a different mode because otherwise, the motor might lose steps or the instantaneous current might be too
high or too low.
A motor stall or a sudden change in the motor velocity may lead to the driver detecting a short circuit or to a state of
automatic current regulation, from which it cannot recover. Clear the error flags and restart the motor from zero velocity
to recover from this situation.
Start the motor from standstill when switching on StealthChop2 the first time and keep it stopped for at least 128 chopper
periods to allow StealthChop2 to do initial standstill current control.
Flags in StealthChop2
As StealthChop2 uses voltage mode driving, status flags based on current measurement respond slower, respectively
the driver reacts delayed to sudden changes of back EMF, like on a motor stall.
A motor stall, or abrupt stop of the motion during operation in StealthChop2 can lead to an overcurrent condition.
Depending on the previous motor velocity, and on the coil resistance of the motor, it significantly increases motor current
for a time of several 10ms. With low velocities, where the back EMF is just a fraction of the supply voltage, there is no
danger of triggering the short detection.
Switch the driver stage to the lowest current range (DRV_CONF.current_range) supporting your motor. This
automatically adapts the overcurrent threshold in three steps and thus reduces peak currents in case of a sudden motor
stall.
Default = 0
PWM_LIM Limiting value for limiting the current jerk when switching from 0 … 15 Upper four bits of 8 bit
SpreadCycle to StealthChop2. Reduce the value to yield a lower amplitude limit
current jerk.
Default = 12
pwm_ Enable automatic current scaling using current measurement. If 0 Forward controlled mode
autoscale off, use forward controlled velocity-based mode. 1 Automatic scaling with
current regulator
Default = 1
pwm_ Enable automatic tuning of PWM_GRAD_AUTO 0 disable, use PWM_GRAD
autograd from register instead
Default = 1 1 enable
PWM_FREQ PWM frequency selection. Use the lowest setting giving good 0 fPWM = 2/1024 fCLK
results. The frequency measured at each of the chopper outputs 1 fPWM = 2/683 fCLK
is half of the effective chopper frequency fPWM.
2 fPWM = 2/512 fCLK
Default = 0 3 fPWM = 2/410 fCLK
PWM_REG User defined PWM amplitude regulation loop P-coefficient. A 1 … 15 Results in 0.5 to 7.5 steps
higher value leads to a higher adaptation speed when for PWM_SCALE_AUTO
pwm_autoscale = 1. regulator per fullstep
Default = 4
Default = 0x1D
PWM_GRAD User defined PWM amplitude (gradient) for velocity-based 0 … 255
scaling and initialization value for automatic tuning of
PWM_GRAD_AUTO.
Default = 0
PWM_SCALE_SUM Actual PWM scaling as determined by the actual settings. This 0 ... 1023
value is shown in higher precision (10 Bit) compared to 8 bit for
PWM_GRAD/OFS_AUTO values.
Default = 0
FREEWHEEL Standstill option when motor current setting is zero (I_HOLD = 0 Normal operation
0). Only available with StealthChop2 enabled. The freewheeling 1 Freewheeling
option makes the motor easily movable, while both coil short
options realize a passive brake. 2 Coil short via LS drivers
3 Coil short via HS drivers
Default = 0
PWM_SCALE Read back of the actual StealthChop2 voltage PWM scaling -255 … (read-only) Scaling value
_AUTO correction as determined by the current regulator. Shall regulate 255 becomes frozen when
close to 0 during tuning. operating in SpreadCycle
Default = 0
PWM_GRAD _AUTO Allow monitoring of the automatic tuning and determination of 0 … 255 (read-only)
PWM_OFS _AUTO initial values for PWM_OFS and PWM_GRAD.
Default = 0
TOFF General enable for the motor driver, the actual value does not 0 Driver off
influence StealthChop2 1 … 15 Driver enabled
Default = 0
TBL Comparator blank time. Choose a setting of 1 or 2 for typical 0 16 tCLK
applications. For higher capacitive loads, 3 may be required. 1 24 tCLK
Lower settings allow StealthChop2 to regulate down to lower coil
current values. 2 36 tCLK
3 54 tCLK
Default = 2
Although the current could be regulated using only on phases and fast decay phases, insertion of the slow decay phase
is important to reduce electrical losses and current ripple in the motor. The duration of the slow decay phase is specified
in a control parameter and sets an upper limit on the chopper frequency. The current comparator measures coil current
during phases when the current flows through exactly one lowside transistor, but not during the slow decay phase. The
slow decay phase is terminated by a timer. The on phase is terminated by the comparator when the current through the
coil reaches the target current. The fast decay phase may be terminated by either the comparator or another timer.
When the coil current is switched, spikes in the RDS(ON)-based current measurement occur due to charging and
discharging parasitic capacitance. During this time, typically one or two microseconds, the current cannot be measured.
Blanking is the time when the input to the comparator is masked to block these spikes.
There are two cycle-by-cycle chopper modes available: a new high-performance chopper algorithm called SpreadCycle
and a proven constant off-time chopper mode. The constant off-time mode cycles through three phases: on, fast decay,
and slow decay. The SpreadCycle mode cycles through four phases: on, slow decay, fast decay, and a second slow
decay.
The chopper frequency is an important parameter for a chopped motor driver. A too low frequency might generate
audible noise. A higher frequency reduces current ripple in the motor, but with a too high frequency magnetic losses
may rise. Also power dissipation in the driver rises with increasing frequency due to the increased influence of switching
slopes causing dynamic dissipation. Therefore, a compromise needs to be found. Most motors are optimally working in a
frequency range of 25kHz to 40kHz. The chopper frequency is influenced by a number of parameter settings as well as
by the motor inductivity and supply voltage.
Hint: A chopper frequency in the range of 25kHz to 40kHz gives a good result for most motors when using SpreadCycle.
A higher frequency leads to increased switching losses.
Table 13. Parameters Controlling SpreadCycle and Classic Constant Off Time
Chopper
PARAMETER DESCRIPTION SETTING COMMENT
Table 13. Parameters Controlling SpreadCycle and Classic Constant Off Time
Chopper (continued)
TOFF Sets the slow decay time (off time). This setting also limits the maximum 0 chopper off
chopper frequency. 1…15 off time setting NCLK = 24
+ 32 x TOFF
For operation with StealthChop2, this parameter is not used, but it is (1 works with minimum
required to enable the motor. In case of operation with StealthChop2 only, blank time of 24 clocks)
any setting is OK.
Setting this parameter to zero completely disables all driver transistors and
the motor can free-wheel.
Default = 0
TBL Selects the comparator blank time. This time needs to safely cover the 0 16 tCLK
switching event and the duration of the ringing. For most applications, a Restriction: Use this
setting of 1 or 2 is good. For highly capacitive loads, e.g., when filter setting only in
networks are used, a setting of 2 or 3 is required. combination with external
clock oscillator <=8MHz
Default = 2 1 24 tCLK
Restriction: May be used
with internal clock, or if
external clock frequency
<=13MHz is applied.
2 36 tCLK
3 54 tCLK
chm Selection of the chopper mode 0 SpreadCycle
SpreadCycle Chopper
The SpreadCycle (patented) chopper algorithm is a precise and simple to use chopper mode which automatically
determines the optimum length for the fast-decay phase. The SpreadCycle provides superior microstepping quality even
with default settings. Several parameters are available to optimize the chopper to the application.
Each chopper cycle comprises an on phase, a slow decay phase, a fast decay phase and a second slow decay phase.
The two slow decay phases and the two blank times per chopper cycle put an upper limit to the chopper frequency. The
slow decay phases typically make up for about 30%–70% of the chopper cycle in standstill and are important for low
motor and driver power dissipation.
Example calculation of a starting value for the slow decay time TOFF:
● Target Chopper frequency: 25kHz
• tOFF = 1 / 25kHz × 50 / 100 × 1 / 2 = 10 µ s
• Assumption: Two slow decay cycles make up for 50% of overall chopper cycle time.
● For the TOFF setting this means: TOFF = (tOFF × fCLK − 12) / 32
● With 12MHz clock this results in TOFF = 3.4, which would require a setting of TOFF = 3 or 4
● With 16MHz clock this results in TOFF = 4.6, which would require a setting of TOFF = 4 or 5
Hint: Highest motor velocities sometimes benefit from setting TOFF to 1 or 2 and a short TBL setting.
The hysteresis start setting forces the driver to introduce a minimum amount of current ripple into the motor coils. The
current ripple must be higher than the current ripple which is caused by resistive losses in the motor in order to give best
microstepping results. This allows the chopper to precisely regulate the current for both rising and falling target current.
The time required to introduce the current ripple into the motor coil also reduces the chopper frequency. Therefore, a
higher hysteresis setting leads to a lower chopper frequency. The motor inductance limits the ability of the chopper to
follow a changing motor current. Further the duration of the on phase and the fast decay must be longer than the blanking
I
HDEC
TARGET CURRENT + HYSTERESIS START
TARGET CURRENT
ON SD FD SD t
Figure 17. SpreadCycle Chopper Scheme Showing Coil Current during a Chopper Cycle
ON FD SD ON FD SD t
Figure 18. Classic Constant Off-Time Chopper with Offset Showing Coil Current
After tuning the fast decay time, the offset should be tuned for a smooth zero crossing. This is necessary because the
fast decay phase makes the absolute value of the motor current lower than the target current (see figures below). If the
zero offset is too low, the motor stands still for a short moment during current zero crossing. If it is set too high, it makes
a larger microstep. Typically, a positive offset setting is required for smoothest operation.
t t
COIL CURRENT DOES NOT HAVE OPTIMUM SHAPE TARGET CURRENT CORRECTED FOR OPTIMUM SHAPE OF COIL CURRENT
Figure 19. Zero Crossing with Classic Chopper and Correction Using Sine Wave Offset
Default = 31
Default = 8
IHOLDDELAY Allows smooth current reduction from run current to hold current. IHOLDDELAY 0 instant power
controls the number of clock cycles for motor power down after TZEROWAIT in down to
increments of 218 clocks: 0 = instant power down, 1..15: Current reduction delay per IHOLD
current step in multiple of 218 clocks. 1…15 1 x 218 … 15
x 218
Example: When using IRUN = 31 and IHOLD = 16, 15 current steps are required for clocks per
hold current reduction. A IHOLDDELAY setting of 4 thus results in a power down time current
of 4 x 15 x 218 clock cycles, e.g., roughly one second at 16MHz. decrement
Default = 1
IRUNDELAY Controls the number of clock cycles for motor power up after start is detected. 0 instant power
up to IRUN
Allows smooth current increment upon start of a motion from hold current (IHOLD) to 1...15 Delay per
run current (IRUN). While a quick power-up is important to establish full motor torque, current
a small delay time helps to reduce acoustic noise and avoids a jump on the power increment step
supply current. in multiple of
IRUNDELAY x
Default = 4 512 clocks
Table 17. IFS Full-Scale Peak Range Settings (Example for RREF = 12kΩ)
REGISTER
CONFIG KIFS TYPICAL
MAX. FS SETTING
(A x RDS(ON) NOTES
DRV_CONF bits (PEAK)
kΩ) (HS + LS)
1..0
Optimized efficiency and extended operating range up
11 36 3A 0.23Ω
to 3AFS.
Optimized efficiency and extended operating range up
10 36 3A 0.23Ω
to 3AFS.
Reduced operating range up to 2AFS.
01 24 2A 0.27Ω
When high accuracy at lower current is required.
Table 17. IFS Full-Scale Peak Range Settings (Example for RREF = 12kΩ) (continued)
Reduced operating range up to 1AFS.
00 (default) 11.75 1A 0.40Ω When high accuracy at low current is required.
The following table is a matrix of different reference resistor values (at pin IREF) versus the different pin configurations
for the full-scale current. The resulting maximum RMS current is given in each cell.
Table 18. IFS Full-Scale RMS Current in Ampere (A RMS) Based on DRV_CONF Bits
1..0 Setting and Different RREF
MAX FULL SCALE CURRENT (A RMS) BASED ON DRV_CONF BITS 1..0 SETTING AND KIFS (A x kΩ)
RREF (kΩ)
DRV_CONF BITS 1..0 = 11 DRV_CONF BITS 1..0 = 10 DRV_CONF BITS 1..0 = 01 DRV_CONF BITS 1..0 = 00
CHOPPER MODE
StealthChop2
VHIGH+Δ
VHIGH
MOTOR
MOTOR HIGH VELOCITY MICRO-
STAND-
IN STANDBY MICROSTEPPING FULLSTEPPING STEPPING
VCOOLTHRS+Δ STILL
VCOOLTHRS
MOTOR IN STANDBY
VPWMTHRS
STEPPING
STEPPING
MICROSTEP
MICRO-
MICRO-
MICROSTEP + +
CoolStep CoolStep
0
t
I
I_RUN
I_HOLD
IHOLDDELAY
TPOWERDOWN
CoolStep
VACTUAL
CURRENT
~1/TSTEP RMS CURRENT REDUCTION
The figure shows all available thresholds and the required ordering. VPWMTHRS, VHIGH, and VCOOLTHRS are
determined by the settings TPWMTHRS, THIGH, and TCOOLTHRS. The velocity is described by the time interval
TSTEP between each two step pulses. This allows determination of the velocity when an external step source is used.
TSTEP always becomes normalized to 256 microsteps. This way, the thresholds do not have to be adapted when
the microstep resolution is changed. The thresholds represent the same motor velocity, independent of the microstep
settings. TSTEP becomes compared to these threshold values. A hysteresis of 1/16 TSTEP resp. 1/32 TSTEP is applied
to avoid continuous toggling of the comparison results when a jitter in the TSTEP measurement occurs. The upper
switching velocity is higher by 1/16, resp. 1/32 of the value set as threshold. The motor current can be programmed to a
run and a hold level, dependent on the standstill flag stst.
Using automatic velocity thresholds allows tuning the application for different velocity ranges. Features like CoolStep will
integrate completely transparently in your setup. This way, once parameterized, they do not require any activation or
deactivation via software.
small_ Hysteresis for step frequency comparison based on TSTEP (lower 0 Hysteresis is 1/16
hysteresis velocity threshold) and (TSTEP x 15/16) - 1, respectively (TSTEP x 31/ 1 Hysteresis is 1/32
32) - 1 (upper velocity threshold)
vhighfs This bit enables switching to fullstep, when VHIGH is exceeded. 0 No switch to fullstep
Switching takes place only at 45° position. The fullstep target current 1 Fullstep at high velocities
uses the current value from the microstep table at the 45° position.
vhighchm This bit enables switching to chm = 1 and fd = 0, when VHIGH is 0 No change of chopper mode
exceeded. This way, a higher velocity can be achieved. Can be 1 Classic const. Toff chopper
combined with vhighfs = 1. If set, the TOFF setting automatically at high velocities
becomes doubled during high velocity operation in order to avoid
doubling of the chopper frequency.
en_pwm_ StealthChop2 voltage PWM enable flag (depending on velocity 0 No StealthChop2
mode thresholds). Switch from off to on state while in standstill, only. 1 StealthChop2 below
VPWMTHRS
StallGuard threshold (SGTHRS) such that SG_RESULT reaches 0 (or near to 0) when the motor becomes overloaded/
stalls.
Hint: In order to use StallGuard2 and CoolStep, the StallGuard2 sensitivity should first be tuned using the SGT setting!
StallGuard2
READING
1000
900
200
100
0 10 20 30 40 50 60 70 80 90 100
over a wide range of load, velocity, and current settings, as shown in the next figure. When approaching maximum motor
load, the value goes down to a motor-specific lower value. This corresponds to a load angle of 90° between the magnetic
field of the coils and magnets in the rotor. This also is the most energy-efficient point of operation for the motor.
In order to use StallGuard4, check the sensitivity of the motor at border conditions.
StallGuard4 READING
SG_RESULT
500
450
START VALUE
400 DEPENDS ON
MOTOR, VELOCITY SG_RESULT REACHES COMPARE VALUE
AND OPERATING AND INDICATES DANGER OF STALL. THIS
350 CURRENT POINT IS SET BY StallGuard THRESHOLD
VALUE SG4_THRS.
100% LOAD
300
VALUE DEPENDS
ON MOTOR,
250 OPERATING
CURRENT AND
VELOCITY.
200
STALL DETECTION
THRESHOLD 150 MOTOR STALLS ABOVE
SG4_THRS THIS POINT. LOAD ANGLE
EXCEEDS 90° AND
100 AVAILABLE TORQUE
HIGH
STALL SINKS.
OUTPUT
50
LOW
0 10 20 30 40 50 60 70 80 90 100
Tuning StallGuard4
The StallGuard4 value SG4_RESULT is affected by motor-specific characteristics and application-specific demands on
load, coil current, and velocity. Therefore, the easiest way to tune the StallGuard4 threshold SG4_THRS for a specific
motor type and operating conditions is interactive tuning in the actual application.
The initial procedure for tuning StallGuard SG4_THRS is as follows:
1. Operate the motor at the normal operation velocity for your application and monitor SG4_RESULT.
2. Apply slowly increasing mechanical load to the motor. Check the lowest value of SG4_RESULT before the motor
stalls. Use this value as starting value for SG4_THRS (apply half of the value).
3. Now, monitor the StallGuard output signal via DIAG output (also set TCOOLTHRS to match the lower velocity limit
for operation) and stop the motor when a pulse is seen on the respective output. Make sure, that the motor is safely
stopped whenever it is stalled. Increase SG4_THRS if the motor becomes stopped before a stall occurs.
4. The optimum setting is reached when a stall is safely detected and leads to a pulse at DIAG in the moment where the
stall occurs. SG4_THRS in most cases can be tuned for a certain motion velocity or a velocity range. Make sure, that
the setting works reliable in a certain range (e.g., 80% to 120% of desired velocity) and also under extreme motor
conditions (lowest and highest applicable temperature).
DIAG is pulsed by StallGuard, when SG4_RESULT falls below SG4_THRS. It is only enabled in StealthChop2 mode,
and when TCOOLTHRS ≥ TSTEP > TPWMTHRS.
The external motion controller should react to a single pulse by stopping the motor if desired. Set TCOOLTHRS to match
the lower velocity threshold where StallGuard delivers a good result.
SG4_RESULT measurement has a high resolution, and there are a few ways to enhance its accuracy, as described in
the following sections.
motors. In filtered mode, sensitivity to a sudden load increase (hard motor blockage) is reduced.
StallGuard2 READING
MOTOR CURRENT
MECHANICAL LOAD
SEMIN
½ OR ¼ I_RUN
MOTOR CURRENT INCREMENT AREA (LOWER LIMIT)
0 = MAXIMUM LOAD
STALL POSSIBLE t
LOAD
SLOW CURRENT
REDUCED MOTOR
REDUCTION DUE TO
CURRENT INCREMENT
DUE TO INCREASED LOAD
LOAD
ANGLE LOAD ANGLE OPTIMIZED LOAD ANGLE OPTIMIZED
OPTIMIZED
Tuning CoolStep
Before tuning CoolStep in conjunction with SpreadCycle, first tune the StallGuard2 threshold level SGT, which affects the
range of the load measurement value SG_RESULT. CoolStep uses SG_RESULT to operate the motor near the optimum
load angle of +90°. In conjunction with StealthChop2, CoolStep uses SG4_RESULT. In this mode, the leveling is done
via SEMIN.
The current increment speed is specified in SEUP, and the current decrement speed is specified in SEDN. They can
be tuned separately because they are triggered by different events that may need different responses. The encodings
for these parameters allow the coil currents to be increased much more quickly than decreased, because crossing the
lower threshold is a more serious event that may require a faster response. If the response is too slow, the motor may
stall. In contrast, a slow response to crossing the upper threshold does not risk anything more serious than missing an
opportunity to save power.
CoolStep operates between limits controlled by the current scale parameter IRUN and the seimin bit.
Response Time
For fast response to increasing motor load, use a high current increment step SEUP. If the motor load changes slowly,
a lower current increment step can be used to avoid motor oscillations. If the filter controlled by sfilt is enabled, the
measurement rate and regulation speed are cut by a factor of four.
Advice: The most common and most beneficial use is to adapt CoolStep for operation at the typical system target
operation velocity and to set the velocity thresholds according. As acceleration and decelerations normally shall be quick,
they will require the full motor current, while they have only a small contribution to overall power consumption due to their
short duration.
Diagnostic Outputs
Operation with an external motion controller often requires quick reaction to certain states of the stepper motor driver.
Therefore, the DIAG outputs supply a configurable set of different real time information complementing the STEP/DIR
interface.
Both, the information available at DIAG0 and DIAG1 can be selected as well as the type of output (low active open drain
– default setting, or high active push-pull). In order to determine a reset of the driver, DIAG0 always shows a power-on
reset condition by pulling low during a reset condition. The figure below shows the available signals and control bits.
POWER-ON RESET
DRIVER ERROR
diag0_pushpull
diag0_error
DIAG0
OVERTEMP
PREWARNING
diag0_otpw
STALL
diag0_stall
diag1_stall
diag1_pushpull
SEQUENCER
DIAG1
MICROSTEP 0 INDEX
diag1_index
CHOPPER ON-STATE
diag1_onstate
The stall output signal allows StallGuard to be handled by the external motion controller like a stop switch.
Depending on the chopper mode, it becomes activated whenever the StallGuard value SG_RESULT reaches zero,
respectively when SG4_RESULT falls below SG4_THRS, and at the same time the velocity condition is fulfilled (TSTEP
≤ TCOOLTHRS).
Chopper on-state shows the on-state of both coil choppers (alternating) when working in SpreadCycle or constant off
time in order to determine the duty cycle.
The INDEX output signals the microstep counter zero position to allow the application to reference the drive to a certain
current pattern.The duration of the index pulse corresponds to the duration of the microstep. When working without
interpolation at less than 256 microsteps, the index time goes down to two clock cycles. The index output signals the
positive zero transition of the coil B microstep wave.
MICROSTEP
WAVE
COIL A
(CUR_A)
COIL B
0
(CUR_B)
INDEX
OUTPUT
t
STEP
PULSE
t
Figure 25. Index Signal at Positive Zero Transition of the Coil B Microstep Wave (in Open-Drain Configuration)
Microstep Table
In order to minimize required memory and the amount of data to be programmed, only a quarter of the wave becomes
stored. The internal microstep table maps the microstep wave from 0° to 90°. It becomes symmetrically extended to 360°.
When reading out the table the 10-bit microstep counter MSCNT addresses the fully extended wave table. The table is
stored in an incremental fashion, using each one bit per entry. Therefore only 256 bits (ofs00 to ofs255) are required to
store the quarter wave. These bits are mapped to eight 32 bit registers. Each ofs bit controls the addition of an inclination
Wx or Wx+1 when advancing one step in the table. When Wx is 0, a 1 bit in the table at the actual microstep position
means “add one” when advancing to the next microstep. As the wave can have a higher inclination than 1, the base
inclinations Wx can be programmed to -1, 0, 1, or 2 using up to four flexible programmable segments within the quarter
wave. This way even a negative inclination can be realized. The four inclination segments are controlled by the position
registers X1 to X3. Inclination segment 0 goes from microstep position 0 to X1-1 and its base inclination is controlled by
W0, segment 1 goes from X1 to X2-1 with its base inclination controlled by W1, etc.
When modifying the wave, care must be taken to ensure a smooth and symmetrical zero transition when the quarter
wave becomes expanded to a full wave. The maximum resulting swing of the wave should be adjusted to a range of -248
to 248 in order to give the best possible resolution while leaving headroom for the hysteresis-based chopper to add an
offset.
y
W0: +2/+3
W1: +1/+2
W2: +0/+1
W3: -1/+0
256
248
0
START_SIN90
START_SIN
LUT STORES
ENTRIES 0...255
-248
When the microstep sequencer advances within the table, it calculates the actual current values for the motor coils with
each microstep and stores them to the registers CUR_A and CUR_B. However, the incremental coding requires an
absolute initialization, especially when the microstep table becomes modified. Therefore, CUR_A and CUR_B become
initialized whenever MSCNT passes zero.
Matching the phase shift to the motor:
Two registers control the starting values of the tables.
● As the starting value at zero is not necessarily 0 (it might be 1 or 2), it can be programmed into the starting point
register START_SIN.
● In the same way, the start of the second wave for the second motor coil needs to be stored in START_SIN90. This
register stores the resulting table entry for a phase shift of 90° for a two-phase motor. To adapt for motor tolerances,
the phase shift can be modified from 90° (256 microsteps) to anywhere between 45° and 135°, by adding a
microstep offset in the range of -127 to +127 (register OFFSET_SIN90). Motor tolerance requires moderate
adaptations of a few, to a few 10 steps, maximum. The required correction offset can be found out using StallGuard4
individual values SG4_IND and trimming the offset until both coils give a symmetrical result.
256
248
DEFAULT WAVE
START_SIN90
FOR SHIFTED WAVE
WAVE SHIFTED VIA OFFSET_SIN90
START_SIN
OFFSET_SIN90
(HERE: NEGATIVE OFFSET)
-248
The default table is a good base for realizing an own table. This is an initialization example for the reset default microstep
table:
MSLUTSEL = 0xFFFF8056:
X1 = 128, X2 = 255, X3 = 255
W3 = %01, W2 = %01, W1 = %01, W0 = %10
MSLUTSTART = 0x00F70000:
To optimize the motor phase shift, run the motor at a medium velocity in StealthChop2 and set sg4_filt_en = 1.
Adapt the phase offset to match the StallGuard4 results for phase A (SG4_IND_0+SG4_IND_1) to phase B
(SG4_IND_2+SG4_IND_3).
If phase A value is > phase B value, increment OFFSET_SIN90, otherwise decrement. Repeat until best match is found.
Be sure to enter the correct value for START_SIN90. For an offset of -10 to +9 use START_SIN90 = 247; up to -17 or
+17 use START_SIN90 = 246. START_SIN is always 0.
N Signal
The N signal can be used to clear the position counter or to take a snapshot. To continuously monitor the N channel and
trigger clearing of the encoder position or latching of the position, where the N channel event has been detected, set the
flag clr_cont. Alternatively, it is possible to react to the next encoder N channel event only, and automatically disable the
clearing or latching of the encoder position after the first N signal event (flag clr_once). This might be desired because
the encoder gives this signal once for each revolution.
Checking for encoder latched event
● Option 1: Check ENC_LATCH for change. It starts up with 0, and shows the encoder count where the N-event
occurred, after starting motion for the first time. For consecutive rotations, it shows increased/decreased values and
thus always changes.
● Option 2: Check for the interrupt output active and read the flag only following active interrupt output. DIAG0 pin needs
to be configured for the interrupt lines using bit diag0_nint_step from GCONF register.
Some encoders require a validation of the N signal by a certain configuration of A and B polarity. This can be controlled
by pol_A and pol_B flags in the ENCMODE register. For example, when both pol_A and pol_B are set, an active N-event
is only accepted during a high polarity of both A and B channels.
For clearing the encoder position ENC_POS with the next active N event set clr_enc_x = 1 and clr_once = 1 or clr_cont
= 1.
POSITION -4 -3 -2 -1 0 1 2 3 4 5 6 7
In both cases, reset and standby, all internal register values and configurations are cleared and set to their defaults and
power bridges are off.
After power-up or leaving sleep mode and reset condition the registers need to be reconfigured.
While reconfiguring the IC it is advised to still hold the bridge drivers disabled with DRV_ENN.
Do not use during high motor velocity as energy fed back from the motor might damage the chip!
If not used, connect to VS or VCC_IO (this is a high-voltage pin).
For improved system reliability and overall circuit protection, the TMC2240 contains an overvoltage comparator and a
trigger output OV to control external switches in terms of excessive supply voltage increase.
Overcurrent Protection
Overcurrent protection (OCP) protects the device against short circuits to the rails (supply voltage and ground) and
between the outputs (OUT1A, OUT2A, OUT1B, OUT2B).
The OCP threshold depends on the selected full-scale current range or see the Electrical Characteristics table for the
respective threshold values.
The full-scale range is selected with the CURRENT_RANGE parameter in DRV_CONF register.
If the output current is greater than the OCP threshold for longer than the deglitch time (blanking time), then an OCP
event is detected.
When an OCP event is detected, the H-bridge is immediately disabled.
The short protection is trying three times before a fault flag (s2ga, s2gb, s2vsa, s2vsb in DRV_STATUS register) is set
and the bridge becomes continuously disabled.
The device is still alive and allows for configuration and status read out.
To re-enable the power bridge DRV_ENN pin must be cycled.
Another option is to disable the power bridge with TOFF = 0 in CHOPCONF and re-enable the bridges with TOFF > 0.
Temperature Measurement
The TMC2240 offers functions to measure the internal chip temperature as well as the motor temperature.
These diagnostic functions can be helpful in applications to monitor the chip or PCB temperature and the motor
temperature development over time to increase system robustness or gather additional information for predictive
maintenance.
+5V +VS
24k RDUMP
OV
LOGIC
LEVEL
MOSFET
flowing through the high-side MOSFETs. This is important, as most short circuit conditions result from a motor cable
insulation defect, e.g., when touching the conducting parts connected to the system ground. The short detection is
protected against spurious triggering, e.g., by ESD discharges, by retrying three times before switching off the motor.
Once a short condition is safely detected, the corresponding driver bridge becomes switched off, and the s2ga or s2gb
flag becomes set. In order to restart the motor, the user must intervene by disabling and re-enabling the driver. It should
be noted that the short to GND protection cannot protect the system and the power stages for all possible short events
as a short event is rather undefined and a complex network of external components may be involved. Therefore, short
circuits should basically be avoided.
Depending on the full-scale current setting, the low-side short protection triggers at different overcurrent protection
thresholds.
Table 26. Overcurrent Protection Thresholds Based on the Full-Scale Current Setting
FULL-SCALE CURRENT SETTING (BITS) OVERCURRENT PROTECTION THRESHOLD [A]
10 (and 11) 5.0
01 3.33
00 1.67
ESD Protection
The chip has internal ESD protection on every pin.
The TMC2240 motor phase output pins are protected up to 8kV HBM in the application when using a bypass capacitor
of at least 1uF on the positive voltage supply (VS pins).
This is not protection against hot plugging of a motor.
The AIN input can be used to monitor external analog variables and parameters that may represent system level
conditions and provide additional feedback on the system state.
Current Setting
CURRENT SETTING
CHECK HARDWARE
SETUP AND MOTOR
RMS CURRENT
SET CURRENTRANGE IN
DRV_CONF (AND IREF) TO
FIT MAXIMUM MOTOR
CURRENT
SET GLOBALSCALER AS
REQUIRED TO REACH
MAXIMUM MOTOR CURRENT
AT I_RUN = 31
SET IHOLDDELAY TO 1 TO 15
FOR SMOOTH STANDSTILL
CURRENT DECAY
SET TPOWERDOWN UP TO
255 FOR DELAYED
STANDSTILL CURRENT
REDUCTION
CONFIGURE CHOPPER TO
TEST CURRENT SETTINGS
StealthChop2 Configuration
StealthChop2
CONFIGURATION SC2
GCONF
SET en_pwm_mode
TRY MOTION ABOVE
TPWMTRHRS (IF
PWMCONF USED)
SET pwm_autoscale,
SET pwm_autograd
SET pwm_meas_sd_en
COIL CURRENT PWMCONF
OVERSHOOT UPON Y DECREASE PWM_LIM (DO
PWMCONF DECELERATION? NOT GO BELOW ABOUT 5)
SELECT PWM_FREQ WITH
REGARD TO fCLK FOR 20-
40kHz PWM FREQUENCY N
GO TO MOTOR
CHOPCONF STANDSTILL AND
ENABLE CHOPPER USING BASIC CHECK MOTOR
CONFIG, E.G.: TOFF = 3, TBL = 2, CURRENT AT IHOLD =
HSTART = 4, HEND = 0 IRUN
SC2
SpreadCycle Configuration
SpreadCycle
CONFIGURATION
GCONF
en_pwm_mode = 0
CHOPCONF
ENABLE CHOPPER USING BASIC CONFIG:
TOFF = 5, TBL = 2, HSTART = 0, HEND = 0
MONITOR SINE
WAVE MOTOR COIL
CURRENTS WITH
CURRENT PROBE AT
LOW VELOCITY
CURRENT ZERO
CROSSING SMOOTH?
CHOPCONF
N
Y INCREASE HEND (MAX. 15)
MOVE MOTOR
VERY SLOWLY OR TRY
AT STANDSTILL
CHOPCONF
DECREASE TOFF (MIN. 2),
AUDIBLE
Y TRY LOWER / HIGHER TBL
CHOPPER NOISE?
OR REDUCE CURRENT
CURRENT
N
MOVE MOTOR AT
MEDIUM VELOCITY OR
UP TO MAX. VELOCITY
CHOPCONF DECREASE
AUDIBLE
Y HEND AND INCREASE
CHOPPER NOISE?
HSTART (MAX. 7)
FINISHED OR ENABLE
CoolStep
ENABLE CoolStep C2
SET TCOOLTHRS
SLIGHTLY ABOVE TSTEP AT
SELECTED VELOCITY FOR
LOWER VELOCITY LIMITS
SET SGTHRS
TO ~90% OF THE MINIMUM
VALUE SEEN AT SG_RESULT
BEFORE STALL
COOLCONF
ENABLE CoolStep BASIC
CONFIGURATION: SET
SEMIN = 1 + SG_RESULT / 16
C2
ENABLE CoolStep C2
IS COIL
CURRENT SINE-SHAPED AT DOES CS_ACTUAL
N DECREASE VMAX REACH IRUN WITH LOAD
VMAX? N INCREASE SEUP
BEFORE MOTOR
Y STALL?
DOES
SG_RESULT GO DOWN TO 0 Y INCREASE SGT
WITH LAOD?
SET TCOOLTHRS
SLIGHTLY ABOVE TSTEP AT
SELECTED VELOCITY FOR
LOWER VELOCITY LIMITS
COOLCONF
ENABLE CoolStep BASIC
CONFIG.: SEMIN = 1, ALL
OHER 0
C2
Velocity Dependent Driver Feature Control This register group offers registers for
Register Set ● driver current control
● setting thresholds for CoolStep operation
● setting thresholds for different chopper modes
Direct Mode Registers This register group offers registers used for the direct coil current control mode.
Encoder Register Set The encoder register group offers all registers needed for proper ABN encoder
operation.
ADC Registers This register group offers registers to control and read the internal ADC.
Motor Driver Register Set This register group offers registers for
● setting/reading out microstep table and counter
● chopper and driver configuration
● CoolStep and StallGuard configuration
● reading out StallGuard values and driver error flags
Register Map
TMC2240
ADDRESS NAME MSB LSB
General Configuration Registers
GCONF[31:24] – – – – – – – –
direct_m
GCONF[23:16] – – – – – – –
ode
0x00 stop_ena small_hy diag1_pu diag0_pu diag1_on diag1_in diag1_st
GCONF[15:8] –
ble steresis shpull shpull state dex all
diag0_st diag0_ot diag0_er multistep en_pwm fast_stan
GCONF[7:0] shaft –
all pw ror _filt _mode dstill
GSTAT[31:24] – – – – – – – –
GSTAT[23:16] – – – – – – – –
0x01 GSTAT[15:8] – – – – – – – –
register_
GSTAT[7:0] – – – vm_uvlo uv_cp drv_err reset
reset
IFCNT[31:24] – – – – – – – –
IFCNT[23:16] – – – – – – – –
0x02
IFCNT[15:8] – – – – – – – –
IFCNT[7:0] IFCNT[7:0]
NODECONF[31:24] – – – – – – – –
NODECONF[23:16] – – – – – – – –
0x03
NODECONF[15:8] – – – – SENDDELAY[3:0]
NODECONF[7:0] NODEADDR[7:0]
IOIN[31:24] VERSION[7:0]
IOIN[23:16] – – – – – SILICON_RV[2:0]
0x04 ADC_ER EXT_CL EXT_RE COMP_ COMP_ COMP_ COMP_
IOIN[15:8] OUTPUT
R K S_DET B1_B2 A1_A2 B A
UART_E DRV_EN
IOIN[7:0] reserved ENCN ENCA ENCB DIR STEP
N N
DRV_CONF[31:24] – – – – – – – –
DRV_CONF[23:16] – – – – – – – –
0x0A DRV_CONF[15:8] – – – – – – – –
SLOPE_CONTROL[ CURRENT_RANGE[
DRV_CONF[7:0] – – – –
1:0] 1:0]
GLOBAL
– – – – – – – –
SCALER[31:24]
GLOBAL
0x0B – – – – – – – –
SCALER[23:16]
GLOBAL SCALER[15:8] – – – – – – – –
GLOBAL SCALER[7:0] GLOBALSCALER[7:0]
Velocity Dependent Configuration Registers
IHOLD_IRUN[31:24] – – – – IRUNDELAY[3:0]
0x10
IHOLD_IRUN[23:16] – – – – IHOLDDELAY[3:0]
Register Details
GCONF (0x0)
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – – – – direct_mode
Reset – – – – – – – 0x0
Access
– – – – – – – Write, Read
Type
BIT 15 14 13 12 11 10 9 8
small_hyste diag1_push diag0_push diag1_onsta
Field stop_enable – diag1_index diag1_stall
resis pull pull te
Reset 0x0 0x0 0x0 0x0 – 0x0 0x0 0x0
Access
Write, Read Write, Read Write, Read Write, Read – Write, Read Write, Read Write, Read
Type
BIT 7 6 5 4 3 2 1 0
multistep_fil en_pwm_m fast_standst
Field diag0_stall diag0_otpw diag0_error shaft –
t ode ill
Reset 0x0 0x0 0x0 0x0 0x1 0x0 0x0 –
Access
Write, Read Write, Read Write, Read Write, Read Write, Read Write, Read Write, Read –
Type
0x0: no StealthChop2
0x1: StealthChop2 voltage PWM mode enabled
multistep_filt 3 Enable step input filtering for StealthChop2
(depending on velocity thresholds). Switch from off
to on state while in stand-still and at IHOLD=
nominal IRUN current, only.
0x0: no StealthChop2
en_pwm_mo 0x1: StealthChop2 voltage PWM mode enabled
2 Enable the StealthChop2 mode
de (depending on velocity thresholds). Switch from off
to on state while in stand-still and at IHOLD=
nominal IRUN current, only.
Timeout for step execution until standstill 0x0: Normal time: 2^20 clocks
fast_standstill 1
detection 0x1: Short time: 2^18 clocks
GSTAT (0x1)
BIT 23 22 21 20 19 18 17 16
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 15 14 13 12 11 10 9 8
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 7 6 5 4 3 2 1 0
register_res
Field – – – vm_uvlo uv_cp drv_err reset
et
Reset – – – 0x1 0x1 0x1 0x0 0x1
Access Write 1 to Write 1 to Write 1 to Write 1 to Write 1 to
– – –
Type Clear, Read Clear, Read Clear, Read Clear, Read Clear, Read
IFCNT (0x2)
BIT 23 22 21 20 19 18 17 16
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 15 14 13 12 11 10 9 8
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 7 6 5 4 3 2 1 0
Field IFCNT[7:0]
Reset 0x0
Access
Read Only
Type
NODECONF (0x3)
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 15 14 13 12 11 10 9 8
Field – – – – SENDDELAY[3:0]
Reset – – – – 0x0
Access
– – – – Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field NODEADDR[7:0]
Reset 0x0
Access
Write, Read
Type
IOIN (0x4)
Reads the state of all input pins available and returns IC revision in highest byte
BIT 31 30 29 28 27 26 25 24
Field VERSION[7:0]
Reset
Access
Read Only
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – – SILICON_RV[2:0]
Reset – – – – – 0x0
Access
– – – – – Read Only
Type
BIT 15 14 13 12 11 10 9 8
EXT_RES_ COMP_B1_ COMP_A1_
Field ADC_ERR EXT_CLK OUTPUT COMP_B COMP_A
DET B2 A2
Reset 0x0 0x0 0x0 0x1 0x0 0x0 0x0 0x0
Access
Read Only Read Only Read Only Write, Read Read Only Read Only Read Only Read Only
Type
BIT 7 6 5 4 3 2 1 0
Field reserved UART_EN ENCN DRV_ENN ENCA ENCB DIR STEP
Reset 0x0 0x0 0x0 0x0 0x0 0x0
Access
Read Only Read Only Read Only Read Only Read Only Read Only Read Only Read Only
Type
DRV_CONF (0xA)
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 15 14 13 12 11 10 9 8
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 7 6 5 4 3 2 1 0
Field – – SLOPE_CONTROL[1:0] – – CURRENT_RANGE[1:0]
Reset – – 0x0 – – 0x0
Access
– – Write, Read – – Write, Read
Type
0x0: 100V/μs
SLOPE_CO
5:4 Slope Control Setting 0x1: 200V/μs
NTROL
0x2: 400V/μs
0x3: 800V/μs
This setting allows a basic adaptation of the
0x0: 1A
drivers RDSon current sensing to the motor
CURRENT_ 0x1: 2A
1:0 current range. Select the lowest fitting range
RANGE 0x2: 3A
for best current precision. The value is the
0x3: 3A
peak current setting.
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 15 14 13 12 11 10 9 8
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 7 6 5 4 3 2 1 0
Field GLOBALSCALER[7:0]
Reset 0x0
Access
Write, Read
Type
IHOLD_IRUN (0x10)
BIT 31 30 29 28 27 26 25 24
Field – – – – IRUNDELAY[3:0]
Reset – – – – 0x4
Access
– – – – Write, Read
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – IHOLDDELAY[3:0]
Reset – – – – 0x1
Access
– – – – Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field – – – IRUN[4:0]
Reset – – – 0b11111
Access
– – – Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field – – – IHOLD[4:0]
Reset – – – 0b01000
Access
– – – Write, Read
Type
TPOWERDOWN (0x11)
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 15 14 13 12 11 10 9 8
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 7 6 5 4 3 2 1 0
Field TPOWERDOWN[7:0]
Reset 0xA
Access
Write, Read
Type
Reset Default = 10
0…((2^8) - 1) x 2^18 tCLK
TSTEP (0x12)
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – TSTEP[19:16]
Reset – – – – 0x0
Access
– – – – Read Only
Type
BIT 15 14 13 12 11 10 9 8
Field TSTEP[15:8]
Reset 0x0
Access
Read Only
Type
BIT 7 6 5 4 3 2 1 0
Field TSTEP[7:0]
Reset 0x0
Access
Read Only
Type
All TSTEP related thresholds use a hysteresis of 1/16 of the compare value to
compensate for jitter in the clock or the step frequency. The flag
TSTEP 19:0
small_hysteresis modifies the hysteresis to a smaller value of 1/32.
(Txxx x 15/16) - 1 or
(Txxx x31/32) - 1 is used as a second compare value for each comparison
value.
This means, that the lower switching velocity equals the calculated setting,
but the upper switching velocity is higher as defined by the hysteresis setting.
TPWMTHRS (0x13)
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – TPWMTHRS[19:16]
Reset – – – – 0x0
Access
– – – – Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field TPWMTHRS[15:8]
Reset 0x0
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field TPWMTHRS[7:0]
Reset 0x0
Access
Write, Read
Type
TCOOLTHRS (0x14)
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – TCOOLTHRS[19:16]
Reset – – – – 0x0
Access
– – – – Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field TCOOLTHRS[15:8]
Reset 0x0
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field TCOOLTHRS[7:0]
Reset 0x0
Access
Write, Read
Type
Set this parameter to disable CoolStep at low speeds, where it cannot work
reliably. The stall output signal become enabled when exceeding this velocity.
It becomes disabled again once the velocity falls below this threshold.
TCOOLTHRS 19:0
TCOOLTHRS ≥ TSTEP ≥ THIGH:
● CoolStep is enabled, if configured
TCOOLTHRS ≥ TSTEP
● Stall output signal (DIAG0/1) is enabled, if configured
THIGH (0x15)
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – THIGH[19:16]
Reset – – – – 0x0
Access
– – – – Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field THIGH[15:8]
Reset 0x0
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field THIGH[7:0]
Reset 0x0
Access
Write, Read
Type
DIRECT_MODE (0x2D)
BIT 31 30 29 28 27 26 25 24
DIRECT_C
Field – – – – – – –
OIL_B[8]
Reset – – – – – – –
Access
– – – – – – – Write, Read
Type
BIT 23 22 21 20 19 18 17 16
Field DIRECT_COIL_B[7:0]
Reset
Access
Write, Read
Type
BIT 15 14 13 12 11 10 9 8
DIRECT_C
Field – – – – – – –
OIL_A[8]
Reset – – – – – – –
Access
– – – – – – – Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field DIRECT_COIL_A[7:0]
Reset
Access
Write, Read
Type
ENCMODE (0x38)
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 15 14 13 12 11 10 9 8
enc_sel_de
Field – – – – – – clr_enc_x
cimal
Reset – – – – – 0x0 – 0x0
Access
– – – – – Write, Read – Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field pos_neg_edge[1:0] clr_once clr_cont ignore_AB pol_N pol_B pol_A
Reset 0x0 0x0 0x0 0x0 0x0 0x0
Access
Write, Read Write, Read Write, Read Write, Read Write, Read Write, Read Write, Read
Type
X_ENC (0x39)
BIT 31 30 29 28 27 26 25 24
Field X_ENC[31:24]
Reset 0x0
Access
Write, Read
Type
BIT 23 22 21 20 19 18 17 16
Field X_ENC[23:16]
Reset 0x0
Access
Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field X_ENC[15:8]
Reset 0x0
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field X_ENC[7:0]
Reset 0x0
Access
Write, Read
Type
ENC_CONST (0x3A)
BIT 31 30 29 28 27 26 25 24
Field ENC_CONST[31:24]
Reset 0x10000
Access
Write, Read
Type
BIT 23 22 21 20 19 18 17 16
Field ENC_CONST[23:16]
Reset 0x10000
Access
Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field ENC_CONST[15:8]
Reset 0x10000
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field ENC_CONST[7:0]
Reset 0x10000
Access
Write, Read
Type
X_ENC accumulates
+/- ENC_CONST / (2^16 x X_ENC) (binary)
or
+/-ENC_CONST / (10^4 x X_ENC) (decimal)
binary:
± [µsteps/2^16]
±(0 …
32767.999847)
decimal:
±(0.0 … 32767.9999)
reset default = 1.0 (=65536)
ENC_STATUS (0x3B)
BIT 23 22 21 20 19 18 17 16
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 15 14 13 12 11 10 9 8
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 7 6 5 4 3 2 1 0
Field – – – – – – – n_event
Reset – – – – – – – 0x0
Access Write 1 to
– – – – – – –
Type Clear, Read
ENC_LATCH (0x3C)
BIT 31 30 29 28 27 26 25 24
Field ENC_LATCH[31:24]
Reset 0x0
Access
Read Only
Type
BIT 23 22 21 20 19 18 17 16
Field ENC_LATCH[23:16]
Reset 0x0
Access
Read Only
Type
BIT 15 14 13 12 11 10 9 8
Field ENC_LATCH[15:8]
Reset 0x0
Access
Read Only
Type
BIT 7 6 5 4 3 2 1 0
Field ENC_LATCH[7:0]
Reset 0x0
Access
Read Only
Type
ADC_VSUPPLY_AIN (0x50)
BIT 31 30 29 28 27 26 25 24
Field – – – ADC_AIN[12:8]
Reset – – –
Access
– – – Read Only
Type
BIT 23 22 21 20 19 18 17 16
Field ADC_AIN[7:0]
Reset
Access
Read Only
Type
BIT 15 14 13 12 11 10 9 8
Field – – – ADC_VSUPPLY[12:8]
Reset – – –
Access
– – – Read Only
Type
BIT 7 6 5 4 3 2 1 0
Field ADC_VSUPPLY[7:0]
Reset
Access
Read Only
Type
ADC_TEMP (0x51)
BIT 31 30 29 28 27 26 25 24
Field – – – RESERVED[12:8]
Reset – – –
Access
– – – Read Only
Type
BIT 23 22 21 20 19 18 17 16
Field RESERVED[7:0]
Reset
Access
Read Only
Type
BIT 15 14 13 12 11 10 9 8
Field – – – ADC_TEMP[12:8]
Reset – – –
Access
– – – Read Only
Type
BIT 7 6 5 4 3 2 1 0
Field ADC_TEMP[7:0]
Reset
Access
Read Only
Type
OTW_OV_VTH (0x52)
BIT 31 30 29 28 27 26 25 24
Field – – – OVERTEMPPREWARNING_VTH[12:8]
Reset – – – 0xB92
Access
– – – Write, Read
Type
BIT 23 22 21 20 19 18 17 16
Field OVERTEMPPREWARNING_VTH[7:0]
Reset 0xB92
Access
Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field – – – OVERVOLTAGE_VTH[12:8]
Reset – – – 0xF25
Access
– – – Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field OVERVOLTAGE_VTH[7:0]
Reset 0xF25
Access
Write, Read
Type
MSLUT_0 (0x60)
BIT 23 22 21 20 19 18 17 16
Field MSLUT_0[23:16]
Reset 0xAAAAB554
Access
Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field MSLUT_0[15:8]
Reset 0xAAAAB554
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field MSLUT_0[7:0]
Reset 0xAAAAB554
Access
Write, Read
Type
MSLUT_1 (0x61)
BIT 23 22 21 20 19 18 17 16
Field MSLUT_1[23:16]
Reset 0x4A9554AA
Access
Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field MSLUT_1[15:8]
Reset 0x4A9554AA
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field MSLUT_1[7:0]
Reset 0x4A9554AA
Access
Write, Read
Type
MSLUT_2 (0x62)
BIT 23 22 21 20 19 18 17 16
Field MSLUT_2[23:16]
Reset 0x24492929
Access
Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field MSLUT_2[15:8]
Reset 0x24492929
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field MSLUT_2[7:0]
Reset 0x24492929
Access
Write, Read
Type
MSLUT_3 (0x63)
BIT 23 22 21 20 19 18 17 16
Field MSLUT_3[23:16]
Reset 0x10104222
Access
Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field MSLUT_3[15:8]
Reset 0x10104222
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field MSLUT_3[7:0]
Reset 0x10104222
Access
Write, Read
Type
MSLUT_4 (0x64)
BIT 23 22 21 20 19 18 17 16
Field MSLUT_4[23:16]
Reset 0xFBFFFFFF
Access
Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field MSLUT_4[15:8]
Reset 0xFBFFFFFF
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field MSLUT_4[7:0]
Reset 0xFBFFFFFF
Access
Write, Read
Type
MSLUT_5 (0x65)
BIT 23 22 21 20 19 18 17 16
Field MSLUT_5[23:16]
Reset 0xB5BB777D
Access
Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field MSLUT_5[15:8]
Reset 0xB5BB777D
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field MSLUT_5[7:0]
Reset 0xB5BB777D
Access
Write, Read
Type
MSLUT_6 (0x66)
BIT 23 22 21 20 19 18 17 16
Field MSLUT_6[23:16]
Reset 0x49295556
Access
Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field MSLUT_6[15:8]
Reset 0x49295556
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field MSLUT_6[7:0]
Reset 0x49295556
Access
Write, Read
Type
MSLUT_7 (0x67)
BIT 23 22 21 20 19 18 17 16
Field MSLUT_7[23:16]
Reset 0x404222
Access
Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field MSLUT_7[15:8]
Reset 0x404222
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field MSLUT_7[7:0]
Reset 0x404222
Access
Write, Read
Type
MSLUTSEL (0x68)
BIT 31 30 29 28 27 26 25 24
Field X3[7:0]
Reset 0xFF
Access
Write, Read
Type
BIT 23 22 21 20 19 18 17 16
Field X2[7:0]
Reset 0xFF
Access
Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field X1[7:0]
Reset 0x80
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field W3[1:0] W2[1:0] W1[1:0] W0[1:0]
Reset 0x1 0x1 0x1 0x2
Access
Write, Read Write, Read Write, Read Write, Read
Type
The sine wave look up table can be divided into up to four segments using an
individual step width control entry Wx. The segment borders are selected by
X1, X2 and X3.
The sine wave look up table can be divided into up to four segments using an
individual step width control entry Wx. The segment borders are selected by
X1, X2 and X3.
The sine wave look up table can be divided into up to four segments using an
individual step width control entry Wx. The segment borders are selected by
X1, X2 and X3.
MSLUTSTART (0x69)
Start values are transferred to the microstep registers CUR_A and CUR_B, whenever the reference position MSCNT=0
is passed.
BIT 31 30 29 28 27 26 25 24
Field OFFSET_SIN90[7:0]
Reset 0x0
Access
Write, Read
Type
BIT 23 22 21 20 19 18 17 16
Field START_SIN90[7:0]
Reset 0d247
Access
Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 7 6 5 4 3 2 1 0
Field START_SIN[7:0]
Reset 0x0
Access
Write, Read
Type
MSCNT (0x6A)
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 15 14 13 12 11 10 9 8
Field – – – – – – MSCNT[9:8]
Reset – – – – – – 0x0
Access
– – – – – – Read Only
Type
BIT 7 6 5 4 3 2 1 0
Field MSCNT[7:0]
Reset 0x0
Access
Read Only
Type
MSCURACT (0x6B)
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – CUR_A[8]
Reset – – – – – – – 0xF7
Access
– – – – – – – Read Only
Type
BIT 23 22 21 20 19 18 17 16
Field CUR_A[7:0]
Reset 0xF7
Access
Read Only
Type
BIT 15 14 13 12 11 10 9 8
Field – – – – – – – CUR_B[8]
Reset – – – – – – – 0x0
Access
– – – – – – – Read Only
Type
BIT 7 6 5 4 3 2 1 0
Field CUR_B[7:0]
Reset 0x0
Access
Read Only
Type
CHOPCONF (0x6C)
BIT 31 30 29 28 27 26 25 24
Field diss2vs diss2g dedge intpol MRES[3:0]
Reset 0x0 0x0 0x0 0x1 0x0
Access
Write, Read Write, Read Write, Read Write, Read Write, Read
Type
BIT 23 22 21 20 19 18 17 16
Field TPFD[3:0] vhighchm vhighfs – TBL[1]
Reset 0x4 – 0b10
Access
Write, Read Write, Read Write, Read – Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field TBL[0] chm – disfdcc fd3 HEND_OFFSET[3:1]
Reset 0b10 – 0x0 0x2
Access
Write, Read Write, Read – Write, Read Write, Read Write, Read
Type
BIT 7 6 5 4 3 2 1 0
HEND_OFF
Field HSTRT_TFD210[2:0] TOFF[3:0]
SET[0]
Reset 0x2 0x5 0x0
Access
Write, Read Write, Read Write, Read
Type
%0000 … %1111:
Hysteresis is -3, -2, -1, 0, 1, …, 12
(1/512 of this setting adds to current setting)
This is the hysteresis value which becomes
used for the hysteresis chopper.
HEND_OFFS
10:7
ET
with chm=1: OFFSET sine wave offset
%0000 … %1111:
Offset is -3, -2, -1, 0, 1, …, 12
This is the sine wave offset and 1/512 of the
value becomes added to the absolute value
of each sine wave entry.
with chm=0: HSTRT hysteresis start value
added to HEND
%000 … %111:
Add 1, 2, …, 8 to hysteresis low value HEND
(1/512 of this setting adds to current setting)
COOLCONF (0x6D)
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – sfilt
Reset – – – – – – – 0x0
Access
– – – – – – – Write, Read
Type
BIT 23 22 21 20 19 18 17 16
Field – sgt[6:0]
Reset – 0x0
Access
– Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field seimin sedn[1:0] – semax[3:0]
Reset 0x0 0x0 – 0x0
Access
Write, Read Write, Read – Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field – seup[1:0] – semin[3:0]
Reset – 0x0 – 0x0
Access
– Write, Read – Write, Read
Type
DRV_STATUS (0x6F)
BIT 31 30 29 28 27 26 25 24
Field stst olb ola s2gb s2ga otpw ot stallguard
Reset
Access
Read Only Read Only Read Only Read Only Read Only Read Only Read Only Read Only
Type
BIT 23 22 21 20 19 18 17 16
Field – – – CS_ACTUAL[4:0]
Reset – – –
Access
– – – Read Only
Type
BIT 15 14 13 12 11 10 9 8
Field fsactive stealth s2vsb s2vsa – – SG_RESULT[9:8]
Reset – –
Access
Read Only Read Only Read Only Read Only – – Read Only
Type
BIT 7 6 5 4 3 2 1 0
Field SG_RESULT[7:0]
Reset
Access
Read Only
Type
PWMCONF (0x70)
BIT 31 30 29 28 27 26 25 24
Field PWM_LIM[3:0] PWM_REG[3:0]
Reset 0xC 0x4
Access
Write, Read Write, Read
Type
BIT 23 22 21 20 19 18 17 16
pwm_dis_re pwm_meas pwm_autogr pwm_autos
Field FREEWHEEL[1:0] PWM_FREQ[1:0]
g_stst _sd_enable ad cale
Reset 0x0 0x0 0x0 0x1 0x1 0x0
Access
Write, Read Write, Read Write, Read Write, Read Write, Read Write, Read
Type
BIT 15 14 13 12 11 10 9 8
Field PWM_GRAD[7:0]
Reset 0x0
Access
Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field PWM_OFS[7:0]
Reset 0x1D
Access
Write, Read
Type
Hint:
After initial tuning, the required initial value
can be read out from PWM_GRAD_AUTO.
PWM_SCALE (0x71)
Results of StealthChop2 amplitude regulator. These values can be used to monitor automatic PWM amplitude scaling
(255=max. voltage).
BIT 31 30 29 28 27 26 25 24
PWM_SCA
Field – – – – – – – LE_AUTO[8
]
Reset – – – – – – – 0x0
Access
– – – – – – – Read Only
Type
BIT 23 22 21 20 19 18 17 16
Field PWM_SCALE_AUTO[7:0]
Reset 0x0
Access
Read Only
Type
BIT 15 14 13 12 11 10 9 8
Field – – – – – – PWM_SCALE_SUM[9:8]
Reset – – – – – – 0x0
Access
– – – – – – Read Only
Type
BIT 7 6 5 4 3 2 1 0
Field PWM_SCALE_SUM[7:0]
Reset 0x0
Access
Read Only
Type
PWM_AUTO (0x72)
These automatically generated values can be read out in order to determine a default / power up setting for
PWM_GRAD and PWM_OFS.
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 23 22 21 20 19 18 17 16
Field PWM_GRAD_AUTO[7:0]
Reset 0x0
Access
Read Only
Type
BIT 15 14 13 12 11 10 9 8
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 7 6 5 4 3 2 1 0
Field PWM_OFS_AUTO[7:0]
Reset 0x0
Access
Read Only
Type
SG4_THRS (0x74)
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 15 14 13 12 11 10 9 8
sg_angle_of
Field – – – – – – sg4_filt_en
fset
Reset – – – – – – 0x1 0x0
Access
– – – – – – Write, Read Write, Read
Type
BIT 7 6 5 4 3 2 1 0
Field SG4_THRS[7:0]
Reset 0x0
Access
Write, Read
Type
SG4_RESULT (0x75)
BIT 31 30 29 28 27 26 25 24
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 23 22 21 20 19 18 17 16
Field – – – – – – – –
Reset – – – – – – – –
Access
– – – – – – – –
Type
BIT 15 14 13 12 11 10 9 8
Field – – – – – – SG4_RESULT[9:8]
Reset – – – – – – 0x0
Access
– – – – – – Read Only
Type
BIT 7 6 5 4 3 2 1 0
Field SG4_RESULT[7:0]
Reset 0x0
Access
Read Only
Type
SG4_IND (0x76)
BIT 31 30 29 28 27 26 25 24
Field SG4_IND_3[7:0]
Reset 0x0
Access
Read Only
Type
BIT 23 22 21 20 19 18 17 16
Field SG4_IND_2[7:0]
Reset 0x0
Access
Read Only
Type
BIT 15 14 13 12 11 10 9 8
Field SG4_IND_1[7:0]
Reset 0x0
Access
Read Only
Type
BIT 7 6 5 4 3 2 1 0
Field SG4_IND_0[7:0]
Reset 0x0
Access
Read Only
Type
+VS
VS
+VIO VCC_IO
100n 100µ
100n
OUT1A
2.2µ OUT2B
OUT1B
IREF
VS
12k
100n +VS
2-PHASE
STEPPER
OUT1A MOTOR
FULL BRIDGE A N
OUT2A S
470pF 470pF
DRIVER
OUT1B
FULL BRIDGE B
OUT2B
470pF 470pF
A more elaborate scheme uses LC filters to decouple the driver outputs from the motor connector. Varistors V1 and V2
in between of the coil terminals eliminate coil overvoltage caused by live plugging. Optionally protect all outputs by a
varistor (V1A, V1B, V2A, V2B) against the ESD voltage. Fit the varistors to the supply voltage rating. The SMD
inductivities conduct full motor coil current and need to be selected accordingly.
470pF
2-PHASE
50Ohm @ V1A STEPPER
100MHz MOTOR
OUT1A
FULL BRIDGE A V1 N
OUT2A S
50Ohm @
100MHz V1B
470pF
DRIVER
470pF
50Ohm @ V2A
100MHz
OUT1B
FULL BRIDGE B V2
OUT2B
50Ohm @
100MHz 470pF V2B
Ordering Information
PART NUMBER TEMPERATURE RANGE PIN-PACKAGE
TMC2240ATJ+ -40°C to +125°C 32 TQFN - 5mm x 5mm
TMC2240ATJ+T -40°C to +125°C 32 TQFN - 5mm x 5mm
TMC2240AUU+ -40°C to +125°C 38 TSSOP-EP 4.4mm x 9.7mm
TMC2240AUU+T -40°C to +125°C 38 TSSOP-EP 4.4mm x 9.7mm
+ Denotes a lead(Pb)-free/RoHS-compliant package.
T Denotes tape-and-reel.
Revision History
REVISION REVISION PAGES
DESCRIPTION
NUMBER DATE CHANGED
0 7/22 Release for Market Intro —
9-13, 15-17,
Changes in Electrical Characteristics; Pin Description; Register Map; Ordering
75-123, 126
Information.
Updated StealthChop2, Setting the Full-Scale Current Range, StallGuard4 Load 30-41, 47-48,
Measurement, CoolStep Load Adaptive Current Scaling, Overvoltage Protection and 52-57, 66, 124
OV Pin; changes in Typical Application Circuits.
New sections External Analog Input AIN Monitoring, Quick Configuration Guide added.
67-68, 68-73
Information furnished by Analog Devices is believed to be accurate and reliable. However, no responsibility is
assumed by Analog Devices for its use, nor for any infringements of patents or other rights of third parties that may
result from its use. Specifications subject to change without notice. No license is granted by implication or otherwise
under any patent or patent rights of Analog Devices. Trademarks and registered trademarks are the property of
their respective owners.
w w w . a n a l o g . c o m Analog Devices | 127