Acces PCI-DA12-2 User Manual - Chapter 5: Programming
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 Address+8. (Alternatively, a read of Base Address+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 Address+2 will change the card back to Automatic Update Mode without updating the outputs. A
read of Base Address+A 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. This is done by
reading Base Address+E. The previous outputs will be restored when a "Clear Restrict-Output-Voltage"
command is issued by a read of Base Address+F.
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 Address+5 will enable this mode, a read of Base Address+6 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 Address+4.
The interrupt is enabled by a read of Base Address+3 and powers up disabled. After being cleared the
interrupt must be re-enabled.