![Trinamic TMCM-351 Firmware Manual Download Page 16](http://html1.mh-extra.com/html/trinamic/tmcm-351/tmcm-351_firmware-manual_1163054016.webp)
TMCM-351 TMCL Firmware V4.45 Manual (Rev. 1.06 / 2014-MAY-16)
16
www.trinamic.com
4.4.2.5
Control Commands
These commands are used to control the program flow (loops, conditions, jumps etc.).
It does not make
sense to use them in direct mode. They are intended for standalone mode only.
Mnemonic
Command
number
Meaning
JA
22
Jump always
JC
21
Jump conditional
COMP
20
Compare accumulator with constant value
CLE
36
Clear error flags
CSUB
23
Call subroutine
RSUB
24
Return from subroutine
WAIT
27
Wait for a specified event
STOP
28
End of a TMCL program
4.4.2.6
Calculation Commands
These commands are intended to be used for calculations within TMCL applications.
Although they could
also be used in direct mode it does not make much sense to do so.
Mnemonic Command
number
Meaning
CALC
19
Calculate using the accumulator and a constant
value
CALCX
33
Calculate using the accumulator and the X register
AAP
34
Copy accumulator to an axis parameter
AGP
35
Copy accumulator to a global parameter
ACO
39
Copy accu to coordinate
For calculating purposes there is an accumulator (or accu or A register) and an X register. When executed in
a TMCL program (in stand-alone mode), all TMCL commands that read a value store the result in the
accumulator. The X register can be used as an additional memory when doing calculations. It can be loaded
from the accumulator.
When a command that reads a value is executed in direct mode the accumulator will not be affected. This
means that while a TMCL program is running on the module (stand-alone mode), a host can still send
commands like GAP, GGP or GIO to the module (e.g. to query the actual position of the motor) without
affecting the flow of the TMCL program running on the module.
4.4.2.7
Interrupt Commands
Due to some customer requests, interrupt processing has been introduced in the TMCL firmware for ARM
based modules.
Mnemonic Command number
Meaning
EI
25
Enable interrupt
DI
26
Disable interrupt
VECT
37
Set interrupt vector
RETI
38
Return from interrupt
4.4.2.7.1
Interrupt Types:
There are many different interrupts in TMCL, like timer interrupts, stop switch interrupts, position reached
interrupts, and input pin change interrupts. Each of these interrupts has its own interrupt vector. Each
interrupt vector is identified by its interrupt number. Please use the TMCL included file
Interrupts.inc
for
symbolic constants of the interrupt numbers.