86
M3i.48xx / M3i.48xx-exp Manual
Trigger masks
Trigger modes and appendant registers
Trigger masks
Trigger OR mask
The purpose of this passage is to explain the trigger OR mask (see
left figure) and all the appendant software registers in detail.
The OR mask shown in the overview before as one object, is separat-
ed into two parts: a general OR mask for external trigger (external
analog and multi purpose TTL trigger) and software trigger and a
channel OR mask.
Every trigger source of the M3i series cards is wired to one of the above men-
tioned OR masks. The user then can program which trigger source will be rec-
ognized, and which one won’t.
This selection for the general mask is realized with the SPC_TRIG_ORMASK
register in combination with constants for every possible trigger source.
This selection for the channel mask is realized with the
SPC_TRIG_CH_ORMASK0 register in combination with constants for every
possible channel trigger source.
In either case the sources are coded as a bitfield, so that they can be combined
by one access to the driver with the help of a bitwise OR.
The table below shows the relating register for the general OR mask and the
possible constants that can be written to it.
The following example shows, how to setup the OR mask, for an external trigger. As an example a simple edge detection has been chosen.
The explanation and a detailed description of the different trigger modes for the external trigger inputs will be shown in the dedicated passage
within this chapter.
Register
Value
Direction
Description
SPC_TRIG_AVAILORMASK
40400
read
Bitmask, in which all bits of the below mentioned sources for the OR mask are set, if available.
SPC_TRIG_ORMASK
40410
read/write
Defines the events included within the trigger OR mask of the card.
SPC_TMASK_NONE
0
No trigger source selected
SPC_TMASK_SOFTWARE
1h
Enables the software trigger for the OR mask. The card will trigger immediately after start.
SPC_TMASK_EXT0
2h
Enables the external (analog) trigger 0 for the OR mask. The card will trigger when the programmed condition for this
input is valid.
SPC_TMASK_EXT1
4h
Enables the external (TTL) trigger 1 for the OR mask. Please note that the mode of the multi purpose connector X0 must
be programmed to trigger input if using the Ext1 trigger (SPCM_X0_MODE=SPCM_XMODE_TRIGIN). The card will
trigger when the programmed condition for this input is valid.
SPC_TMASK_EXT2
8h
Enables the external (TTL) trigger 2 for the OR mask. Please note that the mode of the multi purpose connector X1 must
be programmed to trigger input if using the Ext2 trigger (SPCM_X1_MODE=SPCM_XMODE_TRIGIN). The card will
trigger when the programmed condition for this input is valid.
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_ORMASK, SPC_TMASK_EXT0); // Enable external trigger within the OR mask
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_EXT0_LEVEL0, 1800); // Trigger level set to 1.8 V
spcm_dwSetParam_i32 (hDrv, SPC_TRIG_EXT0_MODE, SPC_TM_POS); // Setting up external trigger for rising edges