adi,tmc2300 (on uart bus)

Description

Analog Devices TMC2300 low voltage stepper motor driver, UART controlled.

The TMC2300 is a STEP/DIR driver which is configured via its single wire
UART interface (PDN_UART). This binding requires the UART controlled
stepper mode, i.e. pin STEPPER tied to VIO and pin MODE tied to GND. The
UART node address is selected by the pins MS1_AD0 (LSB) and MS2_AD1 (MSB).

Connect PDN_UART to the MCU RX pin and, via a 1k resistor, to the MCU TX
pin. All transmitted bytes are echoed on RX.

Motion is generated by a separate STEP/DIR stepper controller, e.g.
zephyr,gpio-step-dir-stepper-ctrl, referencing this node via its
stepper-driver property.

Note: all registers are reset to their power-up defaults when VIO/NSTDBY
is pulled low. The driver detects this via GSTAT and restores the
configuration on the next enable.

Examples

&usart1 {
    current-speed = <115200>;
    status = "okay";

    tmc2300: tmc2300 {
        compatible = "adi,tmc2300";
        uart-device-addr = <0>;
        micro-step-res = <32>;
        en-gpios = <&gpioe 15 GPIO_ACTIVE_HIGH>;
        irun = <16>;
        ihold = <8>;
    };
};

/ {
    stepper_ctrl: stepper-ctrl {
        compatible = "zephyr,gpio-step-dir-stepper-ctrl";
        step-gpios = <&gpiof 8 GPIO_ACTIVE_HIGH>;
        dir-gpios = <&gpioi 1 GPIO_ACTIVE_HIGH>;
        stepper-driver = <&tmc2300>;
    };
};

Properties

Properties not inherited from the base binding file.

Name

Type

Details

uart-device-addr

int

UART node address as selected by the pins MS1_AD0 (bit 0) and MS2_AD1
(bit 1).

This property is required.

Legal values: 0, 1, 2, 3

step-width-ns

int

Minimum STEP high and low time (tSH, tSL) is 120 ns.

Default value: 120

dual-edge-step

boolean

Step on both edges of the STEP signal (CHOPCONF.dedge). The STEP
filter (GCONF.multistep_filt) is disabled in this mode, as both are
not compatible.

extcap

boolean

An external capacitor is attached between VCP and VS (GCONF.extcap).

ihold

int

Standstill current (0=1/32 ... 31=32/32). Reset default is 8.

Default value: 8

Value range: 0 to 31

irun

int

Motor run current (8=9/32 ... 31=32/32). Values below 8 are not
recommended. Full scale RMS current is
325 mV / (RSENSE + 30 mOhm) / sqrt(2). Reset default is 31.

Default value: 31

Value range: 0 to 31

iholddelay

int

Delay per current reduction step from IRUN to IHOLD in multiples of
2^18 clocks. 0: instant power down. Reset default is 1.

Default value: 1

Value range: 0 to 15

tpowerdown

int

Delay from standstill detection to motor current power down in
multiples of 2^18 clocks (about 0 to 5.6 s). A minimum of 2 is
required for automatic tuning of StealthChop PWM_OFS_AUTO. Reset
default is 20.

Default value: 20

Value range: 0 to 255

micro-step-res

int

micro-step resolution to be set while initializing the device driver.

Default value: 1

Legal values: 1, 2, 4, 8, 16, 32, 64, 128, 256

en-gpios

phandle-array

GPIO pins used to control the enable signal of the motor driver.