TMC5130¶
What changes when the driver talks to a TMC5130 instead of a TMC5160, and what to watch for.
The TMC5130 is the TMC5160's sibling with integrated MOSFETs: the same motion controller, the same SPI and UART interfaces and, for the registers both have, the same register map. The TMC5160 datasheet describes it as the software-compatible part for designs up to 1.4 A of motor current.
Detection¶
Initialize() reads the version field of IOIN (bits 31..24) before its first chip-specific write and stores it:
| Chip | IOIN.VERSION |
Constant |
|---|---|---|
| TMC5130 | 0x11 |
tmc51x0::ChipVersion::TMC5130 |
| TMC5160 | 0x30 |
tmc51x0::ChipVersion::TMC5160 |
status.GetChipVersion() returns it afterwards. An unreadable version is treated as a TMC5160.
What differs¶
| Feature | TMC5160 | TMC5130 | What the driver does |
|---|---|---|---|
| Power stage | External MOSFETs, DRV_CONF, SHORT_CONF |
Integrated MOSFETs, no DRV_CONF / SHORT_CONF |
Writes DRV_CONF and SHORT_CONF on the TMC5160 only |
| Current scaling | GLOBAL_SCALER (0x0B) |
No GLOBAL_SCALER |
Never writes GLOBAL_SCALER to a TMC5130 |
| Motor current | 1 A to several 10 A, set by RSENSE | Up to about 1.4 A | Calculates IRUN / IHOLD with each chip's own formula |
| Supply, pinout | This site's Hardware page | TMC5130 datasheet | n/a |
Everything else (ramps, units, StallGuard2, CoolStep, StealthChop, encoder, reference switches, daisy chains and UART nodes) works the same way.
Current on the TMC5130¶
Without GLOBAL_SCALER the TMC5130 sets the current with IRUN / IHOLD (CS) alone. For a TMC5130 the
automatic calculation uses the TMC5130 datasheet's formula
IRMS = ((CS + 1) / 32) × VFS / (RSENSE + 20 mΩ) / √2, VFS = 0.32 V
(vsense = 0)
and rounds CS down, so the coil current never exceeds run_current_ma / hold_current_ma. With 50 mΩ the full
scale is about 3.2 A; 1 A gives IRUN = 8. The current steps are coarse at low currents: choose RSENSE
so the motor current sits near the top of the range. CalculateMotorCurrent() takes the chip version as its last
argument (default TMC5160) if you call it yourself.
Log tags¶
status.VerifySetup() accepts both versions. Log tags read TMC5160 on both chips; that does not change
behaviour.
Next: API guide.