
TMCM-078 Manual (V1.03 / September 10th, 2008)
24
Copyright © 2008, TRINAMIC Motion Control GmbH & Co. KG
5.4.10
Command ‘O’: set the general purpose output
The ‘O’ command sets the state of the general purpose output.
Value Description
0
0: GPO inactive (LED off)
1
1: GPO active (LED on)
Table 5.7: Output adjustment
5.4.11
Command ‘P’ and ‘p’: set and read position counter
The position value of the motor can be changed without actually moving the motor by the command
“P”.
The position counter can be read out by the command ‘p’. Depending on the direction signal (or the
actual velocity when using velocity mode) the position counter will be incremented or decremented
with every microstep.
5.4.12
Command ‘Q’ or ‘q’: read the state of the I/O lines
The ‘Q’ command and also the ‘q’ command output the state of the I/O lines of the module. The
number output by these commands has to be interpreted as follows:
Bit
7
6
5
4
3
2
1
0
Port
0
0
0
GPI
REF_A
REF_B
GPO
0
Table 5.8: I/Os Readout
5.4.13
Command ‘R’ and ‘r’: configure automatic reference search
The ‘R’ command is used to configure the automatic power-on reference search feature. The command
takes four parameters: the reference search mode, the reference search velocity, the reference search
acceleration and (optional) the reference search StallGuard value.
The first parameter may have one of the following values:
Ref. Search
Mode
Function
0
No reference search (default)
1
Reference search ends when REF_A input
becomes high
2
Reference search ends when REF_A input
becomes low
3
Reference search ends when REF_B input
becomes high
4
Reference search ends when REF_B input
becomes low
5
Reference search ends when GP input becomes
high
6
Reference search ends when GP input becomes
low
7
Reference search ends when StallGuard value
reaches the level set by the DIP switches
8
Reference search ends when StallGuard value
reaches the level given by the optional parameter
To make the GPO turn low at the end of the reference search add 32 to this value. To make the GPO
turn high at the end of the reference search add 64 to this value.
To make the reference search start automatically at power-on, add 128 to this value (and do not
forget to store the values using the W command then!).