
124
(c) Spectrum Instrumentation GmbH
On-board I/O lines (X0, X1, X2, X3)
Multi Purpose I/O Lines
Please note that a change to the SPCM_X0_MODE, SPCM_X1_MODE, SPCM_X2_MODE or SPCM_X3_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.
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.
Example of asynchronous write and read. We write a high pulse on output X2 and wait for a high level answer on input X1:
Special behavior of trigger output
As the driver of the M2p series is the same as the driver for the M2i series and some old software may rely on register structure of the M2i
card series, there is a special compatible trigger output register that will work according to the M2i series style. It is not recommended to use
this register unless you’re converting M2i software to the M2p card series:
The SPC_TRIG_OUTPUT register overrides the multi purpose I/O settings done by SPCM_X1_MODE, SPCM_X
-
2_MODE and SPCM_X3_MODE and vice versa. Do not use both methods together from within one program.
SPCM_XMODE_CLKOUT
00008000h
A/D and D/A cards only:
Connector reflects the internally generated sampling clock. In case that oversampling is active, the clock present here
is by SPC_OVERSAMPLINGFACTOR higher than the programmed sample rate. See „Oversampling“ passage in clock
chapter for further details.
SPCM_XMODE_SYNCARMSTATE
00010000h
Connector shows the current ARM state of all cards currently connected Star-Hub and enabled for synchronization. If
all cards are armed and ready to receive a trigger the signal is HIGH. If all cards are ready or one running card is
still acquiring pretrigger data or the trigger has been detected the signal is LOW. A card that has reached the end of
it’s acquisition will remove itself from the equation and not contribute to this signal until all cards are finished.
Register
Value
Direction
Description
SPCM_XX_ASYNCIO
47220
read/write
Connector X1 is linked to bit 1 of the register, connector X2 is linked to bit 2 while connector X3 is
linked to bit 3 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. Connector X0 is not available as an input, hence bit 0 of the register is
only used as an output.
spcm_dwSetParam_i32 (hDrv, SPCM_X0_MODE, SPCM_XMODE_CLKOUT); // X0 set to clock output
spcm_dwSetParam_i32 (hDrv, SPCM_X1_MODE, SPCM_XMODE_ASYNCIN); // X1 set to asynchronous input
spcm_dwSetParam_i32 (hDrv, SPCM_X2_MODE, SPCM_XMODE_ASYNCOUT); // X2 set to asynchronous output
spcm_dwSetParam_i32 (hDrv, SPCM_X3_MODE, SPCM_XMODE_TRIGOUT); // X3 set to trigger output
spcm_dwSetParam_i32 (hDrv, SPCM_XX_ASYNCIO, 0); // programming a high pulse on output X2
spcm_dwSetParam_i32 (hDrv, SPCM_XX_ASYNCIO, 4);
spcm_dwSetParam_i32 (hDrv, SPCM_XX_ASYNCIO, 0);
do {
spcm_dwGetParam_i32 (hDrv, SPCM_XX_ASYNCIO, &lAsyncIn); // read input in a loop
} while ((lAsyncIn & 2) == 0); // until X1 is going to high level
Register
Value
Direction
Description
SPC_TRIG_OUTPUT
40100
read/write
M2i style trigger output programming. Write a „1“ to enable:
- X3 trigger output (SPCM_X3_MODE = SPCM_XMODE_TRIGOUT )
- X2 arm state (SPCM_X2_MODE = SPCM_XMODE_ARMSTATE)
- X1 run state (SPCM_X1_MODE = SPCM_XMODE_RUNSTATE)
Write a „0“ to disable all three outputs:
- SPCM_X1_MODE = SPCM_X2_MODE = SPCM_X3_MODE = SPCM_XMODE_DISABLE
Summary of Contents for M2p.59 Series
Page 190: ......