Manual PCI-DA12-2/4/6
15
Chapter 5: Programming
These cards
’ DACs and Digital I/O use 40(hex) consecutive I/O addresses. Programming the cards is
very straightforward as there are only two 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, remove the "-
2048" and use the appropriate voltage span in place of the "10".
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 A8. (Alternatively, a read of Base AA 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 AA will update all outputs simultaneously and then place the card in Automatic
Update Mode.
Restrict-Output-Voltage
limits the output of all DAC channels and is active at power-up. Since the pre-
load register is not cleared upon power-up, but left at an undefined value, known values must be written
to the preload registers before using a "Clear Restrict-Output-Voltage" command. Those written values
will then be output to the connector when a "Clear Restrict-Output-Voltage" command is issued by a read
of Base AF.
External Trigger Update Mode
allows a negative level at pin 25 of the I/O connector to cause the DACs
to be updated. A read of Base A5 will enable this mode, a read of Base A6 will disable
it. Note that this pin is shared with the External Interrupt signal.
External Interrupt
is a negative edge at pin 25 and is latched until cleared by a read of Base A4.
The interrupt is enabled by a read of Base 3 and powers up disabled. After being cleared the
interrupt must be re-enabled.