adi,tmc51xx (on uart bus)

Description

Analog Devices TMC51XX Stepper Motor Controller (UART single-wire mode)

This binding supports the single-wire UART mode where:
- SWIOP is connected to the MCU's UART TX/RX pin
- SWION should be connected to half the IO level voltage (1.65V for 3.3V systems)
- SW_SEL must be HIGH (either via GPIO control or hardwired)

Example:

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

      tmc51xx: tmc51xx {
          compatible = "adi,tmc51xx";
          sw-sel-gpios = <&gpiob 0x01 GPIO_ACTIVE_HIGH>;

          /* Common settings from base binding */
          clock-frequency = <DT_FREQ_M(12)>;
          en-pwm-mode;
          invert-direction;

          tmc51xx_stepper_driver: stepper_driver {
              compatible = "adi,tmc51xx-stepper-drv";
              micro-step-res = <256>;

              /* ADI TMC stallguard settings specific to TMC51XX */
              stallguard2-threshold=<9>;
          };

          /* common stepper controller settings */
          tmc51xx_motion_controller: motion_controller {
            compatible = "adi,tmc51xx-stepper";

            /* ADI TMC stallguard settings specific to TMC5160 */
            activate-stallguard2;
            stallguard-velocity-check-interval-ms = <100>;
            stallguard-threshold-velocity = <50000>;

            /* ADI TMC ramp generator as well as current settings */
            vstart = <10>;
            a1 = <20>;
            v1 = <30>;
            d1 = <40>;
            vmax = <50>;
            amax = <60>;
            dmax = <70>;
            tzerowait = <80>;
            thigh = <90>;
            tcoolthrs = <100>;
            tpwmthrs = <110>;
            tpowerdown = <120>;
            ihold = <1>;
            irun = <2>;
            iholddelay = <3>;
          };
      };
  };

Properties

Properties not inherited from the base binding file.

Name

Type

Details

sw-sel-gpios

phandle-array

GPIO connected to the SW_SEL pin of TMC51XX.
Must be set HIGH for UART mode operation.
If not provided, it's assumed SW_SEL is hardwired to VCC/HIGH.

uart-device-addr

int

UART device address for TMC51XX in UART mode.
Valid range: 0 - 253

shaft

boolean

Inverse motor direction

clock-frequency

int

The frequency of the clock signal provided to the TMC51XX.
This is used for real world conversion.

Hint: µstep velocity v[Hz] µsteps / s v[Hz] = v[51xx] * ( fCLK[Hz]/2 / 2^23 )
      where v[51xx] is the value written to the TMC51XX.

This property is required.

test-mode

boolean

Enable test mode
0: Normal operation
1: Enable analog test output on pin REFR2
TEST_SEL selects the function of REFR2: 0…4: T120, DAC1, VDDH1, DAC2, VDDH2

Attention: Not for user, set to 0 for normal operation!

en-pwm-mode

boolean

1: StealthChop voltage PWM mode enabled
   (depending on velocity thresholds). Switch from
   off to on state while in stand-still and at IHOLD=
   nominal IRUN current, only.