Post Go back to editing

HOW to drive TMC2240 with Step/Dir Interface standalone. without SPI.

Category: Hardware
Product Number: TMC2240

Hi,
TMC2240 Stepper motor controller didnot work with STEP/DIR interface. is it possible to drive this module standalone?

i want to drive without SPI bus

Thnaks.

  • Hi Redoy!

    I've got the same problem here, I am try to get a Nema motor turning using a TMC2240-EVAL board with an STM32L432 microcontroller using just STEP, DIR and /SLEEP. 

    Hardware connection is

    pin 01 VM -> 24V

    pin 02 GND -> GND

    pin 03 +5V_USB -> 5V

    pin 08 /EN -> GND

    pin 17 SP -> controller_step (PWM output)

    pin 18 DIR -> controller_direction

    pin 19 /SLEEP -> controller_sleep

    Software start-up sequence is

    1. generating a reset at /sleep

    /SLEEP HIGH for 100ms 

    /SLEEP LOW for 50ms 

    /SLEEP HIGH (stays HIGH for the rest of program)

    2. step

    DIR stays LOW

    STEP frequency is 1MHz, rectangle impulse, 0V to 3.3V, 50% duty cycle

    3. diag

    DIAG_0 and DIAG_1 are always HIGH -> OK

    VCC_IO is 3V3 -> OK

    Thanks for any help or pointing to a code example of a related TMC22xx product.

    Cheers!

    ctyx

  • You need to set the TOFF parameter in the CHOPCONF register to a value greater than 0. The reset value of TOFF is 0, and according to the data sheet, p. 112, this means "Driver disable, all bridges off".

    Therefore, it is necessary to establish SPI communication with the TMC2240 in order to get it moving. But I have done this, and still I can't get the motor to move. So I wonder if there are other registers that also must be written. 

  • Hi all!

      you are right, I've set the TOFF to '2' and validated it by re-reading the register, but no movement of the motor and no hold in position current at the motor.

    @ADIstaff:

    It might be easier to use when minimal start up sequence is provided.

    Thanks and Cheers!

    ctyx

  • Hi all!

      it might be a good idea to check the IHOLD_IRUN regisert at 0x10 and check/alter the Motor run current IRUN and the Standstill current IHOLD. Make sure to cross check those settings with your selected current sense resistor at driver pin 1 IREF.

    Cheers!

    ctyx 

  • My problem was that I used such a low step frequency that I did not notice the motor moving. I used 100 Hz, and with 256 microsteps the motor takes 2.5 s to move 1.8 degrees. 

    Conclusion: One must write a value greater than 0 to the TOFF field in the CHOPCONF register. All other registers can have their default (reset) values if your only goal is to see that the motor moves. But you really should set the motor's run and hold current to values that will not burn out the motor, and there's a lot of possibilities to fine tune the driver. You should read the data sheet several times.