Manual PCI-DA12-8/16
15
Chapter 5: Programming
The
cards’ DACs, Timers, and Digital I/O use 40 consecutive I/O addresses. Programming these cards is
very straightforward as there are only three operating modes, three range-selection switches per channel,
and one unique addition. The basic operation of a Digital-to-Analog card is to write a 12-bit value to a
Digital to Analog Converter (DAC) pre-load (outer) register where it is buffered and loaded by an update
command to a DAC (inner) register. Outputs of that register control a "ladder" network which produces the
analog output. The output voltage range is defined by settings of the range-selection switches for that
channel. In C:
outport(BASE+(CH*2), (Volts*4096/10)+2048);
would output "Volts" volts to channel "ch", assuming a bipolar 5V range. For other bipolar ranges,
substitute the appropriate voltage span in place of "10" in the equation. For unipolar ranges, also remove
the "-2048".
Upon power-up, or hardware reset, the DAC registers are restricted to a safe value and the card is set in
Simultaneous Update mode. Since the pre-load register is not cleared upon power-up, but left at an
undefined value, a known value must be written to the preload registers before using a "Clear Restrict-
Output-Voltage" command.
Simultaneous Update Mode
is the power-up or default mode of operation for the DAC card. When a
value is written to a DAC address the output does not change until an output update is commanded via a
read from Base 8. (Alternatively, a read of Base A will update the DAC registers and
switch the board to Automatic Update Mode.) While in Simultaneous Update Mode, a single read will load
all DAC registers with the value waiting in the pre-load registers, causing all outputs to be updated and
changed simultaneously.
Automatic Update Mode
is the configuration that changes a DAC output immediately after the high-byte
of the new value is written to the DAC address. If the card is in Simultaneous Update Mode a read of
Base 2 will change the card back to Automatic Update Mode without updating the outputs. A
read of Base A will update all outputs simultaneously and then place the card in Automatic
Update Mode.
Timer Update Mode
is similar to Simultaneous Update Mode, except that updates are issued by the
counter/timer (programmed in mode 2 or mode 4 per Chapter 6, Programming 8254). A read from Base
5 will change the card from Simultaneous Update Mode to Timer Update Mode, and a read from
Base 6 will change it back. The counter-generated update pulse is also available at the 40-pin
header connector(OUT2) to synchronize external devices, and can generate interrupts for synchronized
loading if enabled by a read from Base 3. (Interrupts are disabled by a read from Base
4.)