
Manual Number: 00650-004-5
Page 4-4
ADIO1600 Manual
All 16 bits are returned regardless of the data-word size of the card's
converter. Any extra bits returned by the A/D card are included, even if
garbage. For a definition of the returned bits, see the card manual or register
section of this manual.
SETCHANNEL (unsigned int BASE_ADDRESS, unsigned int CHANNEL):
This routine outputs the desired A/D and sub-multiplexer channel to the A/
D card. The A/D channel number is passed in the upper nibble of the lower
byte of the parameter CHANNEL, and the sub-multiplexer channel (if any)
is passed in the lower nibble.
Therefore, to set A/D channel 2 and multiplexer card channel 4, set
CHANNEL to 2*16+4. (Multiplying by 16 shifts the A/D channel number
into the upper nibble.) The upper byte of the parameter CHANNEL is
reserved for future expansion and must be set to zero in current programs.
SETGAIN (unsigned int BASE_ADDRESS, unsigned int GAIN, unsigned int MASK):
This routine outputs the desired A/D and sub-multiplexer gain. The A/D
gain is stored in the upper nibble of the low order byte and the sub-
multiplexer gain is stored in the lower nibble of the same byte. The high
order byte is reserved for future expansion and should be set to zero.
On some A/D cards, its not possible to set the gain without also setting the
channel. To avoid changing the channel when only the gain is meant to
change, the current channel is stored in an external variable CURCH. The
contents of this variable are combined (if required) with the desired gain to
produce the actual command byte(s). The contents of CURCH depend upon
SETCHANNEL being used to set the channel. Otherwise, your program
must set CURCH directly prior to calling SETGAIN.
unsigned integer CARDEXISTS (unsigned int BASE_ADDRESS):
Return non-zero (TRUE) if it detects the A/D card at BASE_ADDRESS.
unsigned integer TESTCARD (unsigned int BASE_ADDRESS):
Return non-zero if A/D card appears to perform A/D conversion properly.
integer COUNTERMODE (unsigned int BASE_ADDRESS, unsigned int COUNTER, unsigned
int MODE):
This routine programs the mode of a given counter without loading a value.
This has the effect of turning the counter OFF and the counter will no longer
count down, change output value, etc. This routine can be used to treat the
counter as a digital output bit by setting mode 0 or mode 1 to set the output
of the counter either low or high respectively. This can be highly useful for
debugging programs with otherwise complicated timing.
integer PROGRAMCOUNTER (unsigned int BASE_ADDRESS, unsigned int COUNTER,
unsigned int MODE, unsigned int LOADVALUE):
This routine programs the type 8253 or 8254 counter on the A/D card with
the mode and load value specified on the desired counter number. COUNTER
must be a valid counter number for the card in question, typically 0, 1, or
2. See the
Error List
for a description of errors.