Datasheet map¶
The driver follows the TMC5160 datasheet. This page says which revision, where to get it, and where each part of the driver is described in it, so you can check any behaviour against the source. Section names and page numbers are the datasheet's own (the printed page numbers).
- Datasheet: TMC5160 / TMC5160A Datasheet, Analog Devices (Trinamic) TMC5160A-DS, revision 1.18 (2023-03-01). Get it
from the vendor
page.
SHA-256 of the file used:
3c3edc4fbd694f3afd95ff8f5922a777fdc56d91660c3c0fbdccc016f1bd0be1.
| Topic | Datasheet section | Page | In the driver | Explained on |
|---|---|---|---|---|
| Features, control interfaces and key concepts | 1 Principles of Operation | p. 5 | TMC5160, Mode |
TMC5160 Driver, Architecture |
| Package, pins and signal descriptions | 2 Pin Assignments | p. 11 | CtrlPin, InputPin, Config::mode |
Hardware, Quickstart |
| Sample circuits and gate drive | 3 Sample Circuits | p. 15 | Bridge, SetBridge() |
Hardware, Guards and acknowledgements |
| SPI datagram, status byte and timing | 4 SPI Interface | p. 23 | SpiInterface, Transfer(), Verify::Echo, kSpiMode |
SPI protocol, Porting |
| SPI daisy chain | 4.1 SPI Datagram Structure | p. 23 | SpiOptions::chain_length, chain_index |
SPI protocol |
| UART datagram, node address and SENDDELAY | 5.1 Datagram Structure | p. 26 | UartInterface, Exchange(), UartOptions |
UART protocol, Porting |
| UART CRC-8 | 5.2 CRC Calculation | p. 28 | detail::Crc8(), Error::Crc |
UART protocol, Testing and CI |
| Addressing multiple UART nodes | 5.4 Addressing Multiple Nodes | p. 29 | ProgramNode() |
UART protocol, Examples |
| Register map and reset values | 6 Register Mapping | p. 31 | inc/tmc5160_registers.hpp, ReadRegister() |
Registers, Configuration |
| General configuration registers | 6.1 General Configuration Registers | p. 32 | SetFlags(), SetDiag(), Config::flags |
Registers, Configuration |
| Global status and interface counter | 6.1 General Configuration Registers | p. 33 | ReadGlobalStatus(), ClearGlobalStatus(), Error::UnexpectedReset |
DIAG and status, Troubleshooting |
| Standstill current and power-down | 6.1 General Configuration Registers | p. 36 | SetStandstill(), Standstill |
Current and limits |
| Velocity dependent control | 6.2 Velocity Dependent Driver Feature Control Register Set | p. 38 | SetThresholds(), Thresholds |
Motion, StealthChop and SpreadCycle |
| Ramp generator registers | 6.3 Ramp Generator Registers | p. 40 | SetRamp(), RampProfile, MoveTo(), RunVelocity() |
Motion |
| Reference switches and SW_MODE | 6.3 Ramp Generator Registers | p. 43 | SetSwitches(), Switches, SetStopOnStall() |
Motion, StallGuard2 and CoolStep |
| Ramp status and events | 6.3 Ramp Generator Registers | p. 44 | ReadRampStatus(), ClearRampEvents(), ReleaseStall() |
DIAG and status, Motion |
| Encoder registers | 6.4 Encoder Registers | p. 45 | SetEncoder(), Encoder, ReadEncoderPosition() |
DcStep, encoder and direct mode |
| Motor driver registers | 6.5 Motor Driver Registers | p. 47 | SetChopper(), ReadMicrostepCounter(), ReadDriverStatus() |
Registers, StealthChop and SpreadCycle |
| Chopper configuration | 6.5 Motor Driver Registers | p. 51 | SetChopper(), Chopper |
StealthChop and SpreadCycle |
| CoolStep and StallGuard2 registers | 6.5 Motor Driver Registers | p. 53 | SetCoolStep(), SetStallGuard() |
StallGuard2 and CoolStep |
| Driver status | 6.5 Motor Driver Registers | p. 55 | ReadDriverStatus(), DriverStatus |
DIAG and status |
| StealthChop2 and automatic tuning | 7 StealthChop | p. 57 | SetStealthChop(), StealthChop, ReadStealthChopState() |
StealthChop and SpreadCycle |
| StealthChop and SpreadCycle combined | 7.5 Combine StealthChop and SpreadCycle | p. 64 | SetThresholds(), Thresholds::pwm |
StealthChop and SpreadCycle |
| Freewheeling and passive braking | 7.7 Freewheeling and Passive Braking | p. 66 | Freewheel, StealthChop::freewheel |
StealthChop and SpreadCycle |
| SpreadCycle and classic chopper | 8 SpreadCycle and Classic Chopper | p. 68 | Chopper, ChopperMode |
StealthChop and SpreadCycle |
| Selecting sense resistors and the current scale | 9 Selecting Sense Resistors | p. 74 | MakeConfig(), units::PlanCurrent(), SetCurrent() |
Current and limits, Guards and acknowledgements |
| Velocity based mode control | 10 Velocity Based Mode Control | p. 76 | Thresholds |
StealthChop and SpreadCycle |
| Temperature sensors and short protection | 11 Diagnostics and Protection | p. 78 | SetProtection(), Protection, Ack::ShortProtectionOff, Ack::LowOtLevel |
Guards and acknowledgements, DIAG and status |
| Open load diagnostics | 11.3 Open Load Diagnostics | p. 80 | DriverStatus::open_load_a |
DIAG and status |
| Real world unit conversion | 12.1 Real World Unit Conversion | p. 81 | units::VelocityRegFromHz(), units::AccelRegFromHzPerS() |
Motion |
| Motion profiles and early ramp termination | 12.2 Motion Profiles | p. 82 | MoveTo(), Stop(), Hold(), StopKind |
Motion |
| Velocity thresholds | 12.3 Velocity Thresholds | p. 84 | Thresholds |
Motion |
| Reference switches | 12.4 Reference Switches | p. 85 | Switches, ReadInputs() |
Motion |
| StallGuard2 | 13 StallGuard2 Load Measurement | p. 87 | SetStallGuard(), ReadStallGuard() |
StallGuard2 and CoolStep |
| Homing with StallGuard | 13.4 Homing with StallGuard | p. 90 | SetStopOnStall(), ReleaseStall(), examples/host/homing_stall.cpp |
StallGuard2 and CoolStep, Examples |
| CoolStep | 14 CoolStep Operation | p. 91 | SetCoolStep(), CoolStep |
StallGuard2 and CoolStep |
| STEP/DIR interface and MicroPlyer | 15 STEP/DIR Interface | p. 94 | Mode::StepDir, Config::mode |
Motion, DcStep, encoder and direct mode |
| DIAG outputs | 16 DIAG Outputs | p. 97 | SetDiag(), Diag, Diag0Active(), Diag1Active() |
DIAG and status |
| DcStep | 17 DcStep | p. 99 | SetDcStep(), DcStep, ReadLostSteps() |
DcStep, encoder and direct mode |
| Sine-wave look-up table | 18 Sine-Wave Look-up Table | p. 105 | SetMicrostepTable(), MicrostepTable |
Microstep table |
| Emergency stop | 19 Emergency Stop | p. 106 | Stop(), StopKind::Emergency |
Motion |
| ABN incremental encoder interface | 20 ABN Incremental Encoder Interface | p. 107 | SetEncoder(), units::EncoderScaleFor() |
DcStep, encoder and direct mode |
| DC motor and direct mode | 21 DC Motor or Solenoid | p. 110 | EnterDirectMode(), SetDirectCurrents(), Ack::DirectMode |
DcStep, encoder and direct mode, Guards and acknowledgements |
| Quick configuration guide | 22 Quick Configuration Guide | p. 111 | MakeConfig(), Config |
Configuration, Quickstart |
| Initialization examples | 23.1 Initialization Examples | p. 116 | EnsureInitialized() |
Quickstart, Architecture |
| Power-up reset | 25 Power-Up Reset | p. 119 | EnsureInitialized(), Error::UnexpectedReset |
Contract, Troubleshooting |
| Clock oscillator and input | 26 Clock Oscillator and Input | p. 119 | Clock, kInternalClockHz |
Configuration, Motion |
| Absolute maximum ratings and operational range | 28.1 Operational Range | p. 120 | Board::supply_mv, kVsMinMv, kVsMaxMv |
Hardware, Guards and acknowledgements |
| DC and timing characteristics | 28.2 DC and Timing Characteristics | p. 121 | kVfsMv, kCurrentTolerancePercent |
Current and limits, Hardware |
| Thermal characteristics | 28.3 Thermal Characteristics | p. 124 | Ack::LowOtLevel |
Hardware |
| Package mechanical data and codes | 30 Package Mechanical Data | p. 128 | - | Hardware |
When the datasheet and the driver differ¶
The driver is written against the revision above. If you have a newer revision, compare its revision history with the topics above; a change to a pin, a register, a timing or a value the driver uses is a bug report for this repository. Where the driver deliberately goes beyond the datasheet, the Contract says so.
The repository never contains the PDF itself: vendors own their documents. Download it from the vendor, and compare its SHA-256 with the one above to confirm you have the same file.