84
M3i.48xx / M3i.48xx-exp Manual
Multi Purpose I/O Lines
Trigger modes and appendant registers
Multi Purpose I/O Lines
The M3i series has two multi purpose I/O lines that can be used for a wide variety of functions to help the interconnection
with external equipment. The functionality of these multi purpose I/O lines can be software programmed and each of these
lines can either be used for input or output.
The multi purpose I/O lines may be used for additional trigger inputs allowing to combine and gate external triggers, for
trigger output, for internal arm/run signals output, for asynchronous I/O to control external equipment or as additional
digital input lines that are sampled synchronously with the analog data.
The multi purpose I/O lines are available on the front plate and labelled with X0 (line 0 = X0 = Ext1) and X1 (line 1 = X1 = Ext2). As default
these lines are switched off.
Please be careful when programming these lines as an output signal being connected with an external signal
source may damage components either on the external equipment or on the card itself.
Programming the behaviour
Each multi purpose I/O line can be individually programmed. Please check the available modes by reading the SPCM_X0_AVAILMODES
and SPCM_X1_AVAILMODES register first. The available modes may differ from card to card and may be enhanced with new driver/firm-
ware versions to come.
Please note that a change to the SPCM_X0_MODE or SPCM_X1_MODE will only be updated with the next call
to either the M2CMD_CARD_START or M2CMD_CARD_WRITESETUP register. For further details please see the
relating chapter on the M2CMD_CARD registers.
Using asynchronous I/O
To use asynchronous I/O on the multi purpose I/O lines it is first necessary to switch these lines to the desired asynchronous mode by pro-
gramming the above explained mode registers. As a special feature asynchronous input can also be read if the mode is set to trigger input
or digital input.
Register
Value
Direction
Description
SPCM_X0_AVAILMODES
47210
read
Bitmask with all bits of the below mentioned modes showing the available modes for (X0 = Ext1)
SPCM_X1_AVAILMODES
47211
read
Bitmask with all bits of the below mentioned modes showing the available modes for (X1 = Ext2)
SPCM_X0_MODE
47200
read/write
Defines the mode for (X0 = Ext1). Only one mode selection is possible to be set at a time
SPCM_X1_MODE
47201
read/write
Defines the mode for (X1 = Ext2). Only one mode selection is possible to be set at a time
SPCM_XMODE_DISABLE
00000000h
No mode selected. Output is tristate (default setup)
SPCM_XMODE_ASYNCIN
00000001h
Connector is programmed for asynchronous input. Use SPCM_XX_ASYNCIO to read data asynchronous as shown in
next chapter.
SPCM_XMODE_ASYNCOUT
00000002h
Connector is programmed for asynchronous output. Use SPCM_XX_ASYNCIO to write data asynchronous as shown
in next chapter.
SPCM_XMODE_DIGIN
00000004h
Connector is programmed for digital input. Digital channel X0/X1 is written as D14/D15 of data stream during
acquisition (12 and 14 bit analog input cards only). Please check the data format chapter to see more details. Please
note that automatic sign extension of analog data is switched off as soon as one digital input line is activated.
SPCM_XMODE_TRIGIN
00000010h
Connector is programmed as additional TTL trigger input. X0/X1 is available as Ext1/Ext2 trigger input. Please be
sure to also set the corresponding trigger OR/AND masks to use this trigger input for trigger detection.
SPCM_XMODE_TRIGOUT
00000020h
Connector is programmed as trigger output and shows the trigger detection. The trigger output is HIGH as long as
postcounter is running. After reaching postcounter zero it will become LOW again. In standard FIFO mode the trigger
output is HIGH until FIFO mode is stopped.
SPCM_XMODE_OVROUT
00000040h
Shows the overrange status of the channels at the output. If the analog data of one channel exceeds the input range
the overrange signal is set to high level for that time. The overrange status of channel 0 is output on X0 and the over-
range status of channel 1 is output on X1.
SPCM_XMODE_RUNSTATE
00000100h
Connector shows the current run state of the card. If acquisition/output is running the signal is HIGH. If card has
stopped the signal is LOW.
SPCM_XMODE_ARMSTATE
00000200h
Connector shows the current ARM state of the card. If the card is armed and ready to receive a trigger the signal is
HIGH. If the card isn’t running or the card is still acquiring pretrigger data or the trigger has been detected the signal
is LOW.
SPCM_XMODE_DIRECTTRIGOUT
00000400h
Connector is programmed as direct trigger output and shows the trigger recognition of an fed in trigger event which
will lead to a card trigger event. This mode shows the upcoming detection even before the card itself will have trig-
gered. The trigger output is HIGH as long as postcounter is running. After reaching postcounter zero it will become
LOW again. This mode ensures that the card is armed and therefor the signaled event trigger event will lead to a card
trigger. Please see below for a usage example for this mode.
SPCM_XMODE_DIRECTTRIGOUT_LR
00000800h
Nearly identical to SPCM_XMODE_DIRECTTRIGOUT, but in contrast the above mode, this mode does not make sure
that the card is armed. The user has to take care that the repetition time of the fed in trigger event is longer than the
recording and re-arm time, otherwise the direct trigger might be generated although this event cannot be a properly
detected card trigger. Please see below for a usage example for this mode.
Register
Value
Direction
Description
SPCM_XX_ASYNCIO
47220
read/write
Connector X0 is linked to bit 0 of the register while connector X1 is linked to bit 1 of this register.
Data is written/read immediately without any relation to the currently used sampling rate or mode. If
a line is programmed to output, reading this line asynchronously will return the current output level.