Appendix D Register-Level Programming
National Instruments Corporation D-35 PC-LPM-16/PnP User Manual
UP/DOWN bit in Command Register 2 is cleared—the software uses
the following scan sequence:
channel 3, channel 2, channel 1, channel 0, channel 3, channel 2,
channel 1, channel 0, channel 3, and so on.
Perform the following steps to select the analog input channel:
1. Program the UP/DOWN bit in Command Register 2 if the bit is not
already set to the desired value. Common Register 2 must always
be programmed before Command Register 1.
Note: The UP function is not yet supported by NI-DAQ. NI-DAQ will support the
UP function in a future release.
2. Write the configuration value indicating the highest channel
number in the scan sequence to Command Register 1. You must set
the SCANEN* bit during this first write to Command Register 1.
3. Write the same configuration value again to Command Register 1.
The SCANEN* bit, however, must be cleared during the second
write to Command Register 1.
Use either counter 0 or EXTCONV* to control the scanning interval.
A/D Interrupt Programming
You can use an interrupt to service the data acquisition operation. To
use the conversion interrupt, set the FIFOINTEN bit in Command
Register 1. If this bit is set, an interrupt is generated whenever the
DAVAIL bit in the Status Register is set. Clear this interrupt condition
by reading the FIFO, which empties its contents.
Programming the Digital I/O Circuitry
DIN0 through DIN7 (pins 22 through 29) of the I/O connector are
dedicated digital input lines. They are monitored by the Digital Input
Register. An 8-bit reading of the Digital Input Register returns the
current state of these digital input lines. DOUT0 through DOUT7
(pins 30 through 37) of the I/O connector are dedicated digital output
lines. These lines are always driven by the Digital Output Register. An
8-bit writing to the Digital Output Register drives the new digital value
to these lines. At startup, all of the digital output lines are initiated to
zero state.
a.Book : l.Appendix D Page 35 Wednesday, November 20, 1996 6:36 PM