TMC7300 Example Script

Trinamic recently launched a new series of battery-powered motor driver chips, including the TMC7300. The TMC7300 can drive one DC motor up to 2 A or two DC motors up to 2.4 A (peak). This article shows a small example script for driving a DC motor using the TMC7300-EVAL-KIT.
First, assemble the evaluation kit by connecting the TMC7300-EVAL board to the Landungsbrücke interface board using the Eselsbrücke connector board. Second, connect the motor to the evaluation board. Finally, plug in a USB-C cable to connect to a computer and use TMCL-IDE for direct access.
Once setup is complete, you can adjust the TMC7300 DC driver IC and immediately view the motor operating status in real time in the graphical user interface.

Using TMCL-IDE, a short example script was created that moves the DC motor, as shown in the figure. The motor PWM duty cycle changes from 0% to 30%, then to 50%, and then back to zero. After that, it shows the same values in the negative direction.
The script used is as follows:
#module 1 COM16/USB/id1/Landungsbruecke [Landungsbruecke]
CALC ADD, 1 // Add 1 to accu
STOA 0, 0 // Store local variable to accumulator
SAP 7, 0, 0, 1 // Deactivate Standby of TMC7300
Loop:
SAP 0, 0, 30, 1 // Set duty cycle for Motor 1 to 30%
WAIT TICKS, 0, 1000 // Wait 1 second
SAP 0, 0, 50, 1 // Set duty cycle for Motor 1 to 50%
WAIT TICKS, 0, 1000 // Wait 1 second
SAP 0, 0, 30, 1 // Set duty cycle for Motor 1 to 30%
WAIT TICKS, 0, 1000 // Wait 1 second
SAP 0, 0, 0, 1 // Set duty cycle for Motor 1 to 0%
WAIT TICKS, 0, 1000 // Wait 1 second
SAP 0, 0, -30, 1 // Set duty cycle for Motor 1 to -30%
WAIT TICKS, 0, 1000 // Wait 1 second
SAP 0, 0, -50, 1 // Set duty cycle for Motor 1 to -50%
WAIT TICKS, 0, 1000 // Wait 1 second
SAP 0, 0, -30, 1 // Set duty cycle for Motor 1 to -30%
WAIT TICKS, 0, 1000 // Wait 1 second
SAP 0, 0, 0, 1 // Set duty cycle for Motor 1 to 0%
WAIT TICKS, 0, 1000 // Wait 1 second
CALC ADD, 1 // Add 1 to accu
STOA 0, 0 // Store value to accumulator
COMP 100 // <----- Amount of loops set here
JC LE, Loop // Jump to label Loop
SAP 7, 0, 1, 1 // Activate Standby of TMC7300
STOP