-
Notifications
You must be signed in to change notification settings - Fork 29
Multiple Drivers
To be able to communicate with multiple drivers over UART there are several possibilities. See in the datasheet 4.3 UART Signals on page 20 and 21.

For up to 4 drivers, addressing each one over one UART connecting can be used. With each UART Package an address is beeing send and only the correct TMC driver reacts and answers that package. The addressing of the drivers is beeing done by pulling the MS1_ADDR0 and MS2_ADDR1 pins to LOW or HIGH. Addressing the Drivers is already builtin the library by setting the driver_address when creating the TMC_2209 obbject. See demo_script_06_multiple_drivers.py

With analog switches more than 4 drivers can be addressed with UART

You can connect all drivers with the same connection to the TX Pin of the Raspberry Pi, but the only write access is possible
by setting VACTUAL via UART all motors can be moved simultaneous without blocking the code and without using resources on the raspberry pi, but no accurate movement is possible with VACTUAL.
You can move several motor with the STEP/DIR interface with velocity ramping via threads simultaneously. see demo_script_07_threads.py
This function can be used to move a motor x steps in a thread:
run_to_position_steps_threaded(steps)
To wait for a motor to finish its movement use this function
wait_for_movement_finished_threaded()
you can also use this function to stop the threaded movement immediatly:
stop()