
130
(c) Spectrum Instrumentation GmbH
Additional I/O lines with Option -DigSMB and -DigFX2
Multi Purpose I/O Lines
Sample format (with more than 3 digital channels)
In combination with the additional digital I/O lines offered by the -DigSMB or -DigFX2 any additional reduction of the ADC resolution is
possible, including the complete replacement of the analog data:
* Any X-input can be used as a source for that digital channel, except X0, which is output only.
Please note that automatic sign extension of analog data is ineffective as soon as one digital input line is
activated and the software must properly mask out all the digital bits from the samples.
The digital source has to be properly set to input direction to be a valid digital source. Also the analog channel
into that the digital signals shall be routed to must be activated properly for acquisition as described in the
„Channel Selection“ passage.
The following example shows how to enable all sixteen channels of the digital input option and completely replace analog channel 2:
The following example shows how to enable four digital channels provided via the multi-purpose lines X2, X3, X8 and X13 to channel 0 only
and hence reduce the resolution of this channel to 12 bit:
Table 78: Sample format of analog samples in combination with digital input channels
Standard Mode
4 digital inputs enabled
5 digital inputs enabled
8 digital inputs enabled
16 digital inputs ena
-
bled
Data bit
16 bit
ADC resolution
12 bit
ADC resolution
11 bit
ADC resolution
...
8 bit
ADC resolution
...
ADC sample completely
replaced
D15
ADx Bit 15 (MSB)
Digital bit 0 (any X input)*
Digital bit 0 (any X input)*
...
Digital bit 0 (any X input)*
...
Digital bit 0 (any X input)*
D14
ADx Bit 14
Digital bit 1 (any X input)*
Digital bit 1 (any X input)*
...
Digital bit 1 (any X input)*
...
Digital bit 1 (any X input)*
D13
ADx Bit 13
Digital bit 2 (any X input)*
Digital bit 2 (any X input)*
...
Digital bit 2 (any X input)*
...
Digital bit 2 (any X input)*
D12
ADx Bit 12
Digital bit 3 (any X input)*
Digital bit 3 (any X input)*
...
Digital bit 3 (any X input)*
...
Digital bit 3 (any X input)*
D11
ADx Bit 11
ADx Bit 15 (MSB)
Digital bit 4 (X15)
...
Digital bit 4 (X15)
...
Digital bit 4 (X15)
D10
ADx Bit 10
ADx Bit 14
ADx Bit 15 (MSB)
...
Digital bit 5 (X14)
...
Digital bit 5 (X14)
D9
ADx Bit 9
ADx Bit 13
ADx Bit 14
...
Digital bit 6 (X13)
...
Digital bit 6 (X13)
D8
ADx Bit 8
ADx Bit 12
ADx Bit 13
...
Digital bit 7 (X12)
...
Digital bit 7 (X12)
D7
ADx Bit 7
ADx Bit 11
ADx Bit 12
...
ADx Bit 15 (MSB)
...
Digital bit 8 (X11)
D6
ADx Bit 6
ADx Bit 10
ADx Bit 11
...
ADx Bit 14
...
Digital bit 9 (X10)
D5
ADx Bit 5
ADx Bit 9
ADx Bit 10
...
ADx Bit 13
...
Digital bit 10 (X9)
D4
ADx Bit 4
ADx Bit 8
ADx Bit 9
...
ADx Bit 12
...
Digital bit 11 (X8)
D3
ADx Bit 3
ADx Bit 7
ADx Bit 8
...
ADx Bit 11
...
Digital bit 12 (X7)
D2
ADx Bit 2
ADx Bit 6
ADx Bit 7
...
ADx Bit 10
...
Digital bit 13 (X6)
D1
ADx Bit 1
ADx Bit 5
ADx Bit 6
...
ADx Bit 9
...
Digital bit 14 (X5)
D0
ADx Bit 0 (LSB)
ADx Bit 4 (LSB)
ADx Bit 5 (LSB)
...
ADx Bit 8 (LSB)
...
Digital bit 15 (X4)
for (int i = 0; i < 15; i++)
spcm_dwSetParam_i32 (hDrv, (SPCM_X i), SPCM_XMODE_DIGIN); // X4..X19 set to synchronous input
// Enable acquisition of X19..X4 inputs to completely replace analog samples of channel 2
spcm_dwSetParam_i32 (hDrv, SPCM_DIGMODE2, SPCM_DIGMODE_CHREPLACE);
spcm_dwSetParam_i32 (hDrv, SPCM_X2_MODE, SPCM_XMODE_DIGIN); // X2 set to synchronous input
spcm_dwSetParam_i32 (hDrv, SPCM_X3_MODE, SPCM_XMODE_DIGIN); // X3 set to synchronous input
spcm_dwSetParam_i32 (hDrv, SPCM_X8_MODE, SPCM_XMODE_DIGIN); // X8 set to synchronous input
spcm_dwSetParam_i32 (hDrv, SPCM_X13_MODE, SPCM_XMODE_DIGIN); // X13 set to synchronous input
// define and clear a temporary variable
uint32 dwValue = 0;
// add four sources (X2, X3, X8 and X13) at four different positions (bit15, bit14, bit13 and bit12)
dwValue |= (DIGMODEMASK_BIT15 & SPCM_DIGMODE_X2); // store X2 in Sample Bit15
dwValue |= (DIGMODEMASK_BIT14 & SPCM_DIGMODE_X3); // store X3 in Sample Bit14
dwValue |= (DIGMODEMASK_BIT13 & SPCM_DIGMODE_X8); // store X8 in Sample Bit13
dwValue |= (DIGMODEMASK_BIT12 & SPCM_DIGMODE_X13); // store X13 in Sample Bit12
// and write value to channel 0 digmode register. Resulting Ch0 A/D samples will be 12bit.
spcm_dwSetParam_i32 (hDrv, SPCM_DIGMODE0, dwValue);
Summary of Contents for M2p.59 Series
Page 190: ......