User manual

TMCM-1640 TMCL Firmware V2.00 Manual (Rev. 2.00 / 2012-JUL-31) 26
www.trinamic.com
4.6.13 SIO (set output) and GIO (get input / output)
The TMCM-1640 provides two commands for dealing with inputs and outputs:
- SIO sets the status of the general digital output either to low (0) or to high (1).
- With GIO the status of the two available general purpose inputs of the module can be read out. The
command reads out a digital or analogue input port. Digital lines will read 0 and 1, while the ADC
channel delivers 12 bit in the range of 0… 4095.
CORRELATION BETWEEN I/OS AND BANKS
Inputs/ Outputs
Bank
Description
Digital inputs
Bank 0
Digital inputs are accessed in bank 0.
Analogue inputs
Bank 1
Analog inputs are accessed in bank 1.
Digital outputs
Bank 2
The states of the OUT lines (that have been set by SIO commands)
can be read back using bank 2.
4.6.13.1 SIO (set output)
Bank 2 is used for setting the status of the general digital output either to low (0) or to high (1).
Internal function: the passed value is transferred to the specified output line.
Related commands: GIO, WAIT
Mnemonic: SIO <port number>, <bank number>, <value>
Binary representation:
INSTRUCTION NO.
TYPE
MOT/BANK
VALUE
14
<port number>
<bank number>
2
<value>
0/1
Reply structure:
STATUS
VALUE
100 OK
don’t care
Binary:
Byte Index
0
1
2
3
4
5
6
7
Function
Target-
address
Instruction
Number
Type
Motor/
Bank
Operand
Byte3
Operand
Byte2
Operand
Byte1
Operand
Byte0
Value (hex)
$01
$0e
$07
$02
$00
$00
$00
$01
4.6.13.2 GIO (get input/output)
GIO can be used in direct mode or in standalone mode.
GIO IN STANDALONE MODE
In standalone mode the requested value is copied to the accumulator (accu) for further processing purposes
such as conditioned jumps.
GIO IN DIRECT MODE
In direct mode the value is output in the value field of the reply without affecting the accumulator. The
actual status of a digital output line can also be read.
Internal function: the specified line is read.
Related commands: SIO, WAIT