
128
(c) Spectrum Instrumentation GmbH
Additional I/O lines with Option -DigSMB and -DigFX2
Multi Purpose I/O Lines
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 X4 and wait for a high level answer on input X19:
Synchronous digital inputs
The cards of the M2p series allow a very detailed setup on how to optionally record synchronous digital channels along with analog acqui
-
sition. The SPC_DIGMODEx register allows the setup separately for every analog channel. The table below shows the related registers and
the values that correspond with the different possibilities. The mask and mode and mode values have to properly be combined. This is shown
in the example below the tables:
Register
Value
Direction
Description
SPCM_XX_ASYNCIO
47220
read/write
Connector X4 is linked to bit 4 of the register, connector X5 is linked to bit 5 and so on until X19 on
bit 19. 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 out
-
put level.
spcm_dwSetParam_i32 (hDrv, SPCM_X19_MODE, SPCM_XMODE_ASYNCIN); // X1 set to asynchronous input
spcm_dwSetParam_i32 (hDrv, SPCM_X4_MODE, SPCM_XMODE_ASYNCOUT); // X2 set to asynchronous output
spcm_dwSetParam_i32 (hDrv, SPCM_XX_ASYNCIO, 0x00); // programming a high pulse on output X4
spcm_dwSetParam_i32 (hDrv, SPCM_XX_ASYNCIO, 0x10);
spcm_dwSetParam_i32 (hDrv, SPCM_XX_ASYNCIO, 0x00);
do {
spcm_dwGetParam_i32 (hDrv, SPCM_XX_ASYNCIO, &lAsyncIn); // read input in a loop
} while ((lAsyncIn & 0x10000) == 0); // until X19 is going to high level
Table 76: Spectrum API: registers for synchronous digital inputs
Register
Value
Direction
Description
SPC_DIGMODE0
47250
read/write
Set the digital input sources for channel 0.
SPC_DIGMODE1
47251
read/write
Set the digital input sources for channel 1.
SPC_DIGMODE2
47252
read/write
Set the digital input sources for channel 2.
SPC_DIGMODE3
47253
read/write
Set the digital input sources for channel 3.
SPC_DIGMODE4
47254
read/write
Set the digital input sources for channel 4.
SPC_DIGMODE5
47255
read/write
Set the digital input sources for channel 5.
SPC_DIGMODE6
47256
read/write
Set the digital input sources for channel 6.
SPC_DIGMODE7
47257
read/write
Set the digital input sources for channel 7.
SPCM_DIGMODE_OFF
00000000h
Disable acquisition of digital data for the masked analog bit (see masks below).
SPCM_DIGMODE_CHREPLACE
FFBBCFFFh
Convenient AND/OR combination of all the below SPCM_DIGMODEx and DIGMODEMASK_BITx bits to completely
replace all the Bits of an analog channel with the sixteen bits (X19...X4) provided by the -DigDMB or -DigFX2 option.
SPCM_DIGMODE_X4
84210001h
Enable acquisition of multi-purpose input X4 for the masked analog bit (see masks below).
SPCM_DIGMODE_X5
8C631002h
Enable acquisition of multi-purpose input X5 for the masked analog bit (see masks below).
SPCM_DIGMODE_X6
94A52004h
Enable acquisition of multi-purpose input X6 for the masked analog bit (see masks below).
SPCM_DIGMODE_X7
9CE73008h
Enable acquisition of multi-purpose input X7 for the masked analog bit (see masks below).
SPCM_DIGMODE_X8
A5294010h
Enable acquisition of multi-purpose input X8 for the masked analog bit (see masks below).
SPCM_DIGMODE_X9
AD6B5020h
Enable acquisition of multi-purpose input X9 for the masked analog bit (see masks below).
SPCM_DIGMODE_X10
B5AD6040h
Enable acquisition of multi-purpose input X10 for the masked analog bit (see masks below).
SPCM_DIGMODE_X11
BDEF7080h
Enable acquisition of multi-purpose input X11 for the masked analog bit (see masks below).
SPCM_DIGMODE_X12
C6318100h
Enable acquisition of multi-purpose input X12 for the masked analog bit (see masks below).
SPCM_DIGMODE_X13
CE739200h
Enable acquisition of multi-purpose input X13 for the masked analog bit (see masks below).
SPCM_DIGMODE_X14
D6B5A400h
Enable acquisition of multi-purpose input X14 for the masked analog bit (see masks below).
SPCM_DIGMODE_X15
DEF7B800h
Enable acquisition of multi-purpose input X15 for the masked analog bit (see masks below).
SPCM_DIGMODE_X16
E739C000h
Enable acquisition of multi-purpose input X16 for the masked analog bit (see masks below).
SPCM_DIGMODE_X17
EF7BD000h
Enable acquisition of multi-purpose input X17 for the masked analog bit (see masks below).
SPCM_DIGMODE_X18
F7BDE000h
Enable acquisition of multi-purpose input X18 for the masked analog bit (see masks below).
SPCM_DIGMODE_X19
FFFFF000h
Enable acquisition of multi-purpose input X19 for the masked analog bit (see masks below).
DIGMODEMASK_BIT15
F8000000h
Enable acquisition of a digital source (sources see above) into bit15 of the analog sample. Any X-Input allowed.
DIGMODEMASK_BIT14
07C00000h
Enable acquisition of a digital source (sources see above) into bit14 of the analog sample. Any X-Input allowed.
DIGMODEMASK_BIT13
003E0000h
Enable acquisition of a digital source (sources see above) into bit13 of the analog sample. Any X-Input allowed.
DIGMODEMASK_BIT12
0001F000h
Enable acquisition of a digital source (sources see above) into bit12 of the analog sample. Any X-Input allowed.
DIGMODEMASK_BIT11
00000800h
Enable acquisition of X15 into bit11 of the analog sample.
DIGMODEMASK_BIT10
00000400h
Enable acquisition of X14 into bit10 of the analog sample.
Summary of Contents for M2p.59 Series
Page 190: ......