National Instruments 320174B-01 Computer Hardware User Manual


 
Register-Level Programming Chapter 4
Lab-NB User Manual 4-36 © National Instruments Corporation
4. Write 0000 (hex) to the A/D Configuration Register (16-bit write).
5. Write 00 (hex) to the A/D Clear Register (8-bit write).
6. Read the data from the A/D FIFO Register (16-bit read). Ignore the data.
7. Write 0000 (hex) to the DAC0 Data Register if DAC0 is configured for unipolar output.
Write 0800 (hex) to the DAC0 Data Register if DAC0 is configured for bipolar output.
8. Write 0000 (hex) to the DAC1 Data Register if DAC1 is configured for unipolar output.
Write 0800 (hex) to the DAC1 Data Register if DAC1 is configured for bipolar output.
This sequence leaves the Lab-NB circuitry in the following state:
Counter A0 output is high. Low-going pulses on counter 0 initiate conversions.
Counter A1 output is high. This disables EXTCONV*.
All interrupts are disabled.
EXTTRIG is disabled.
The timebase for counter A0 is the onboard 1-MHz source.
Analog input circuitry is initialized to a gain of 1 and channel 0 selected.
The A/D FIFO is cleared.
The D/A Configuration Register is initialized to 00 (hex) on power up. Thus, straight binary
coding is selected for both DACs.
The analog output circuitry is initialized to 0.0 V on both channels.
For additional details concerning the 8253 Counter/Timer, see Appendix C, AMD 8253 Data
Sheet. For information about the 82C55A PPI, see Appendix D, OKI 82C55A Data Sheet.
Programming the Analog Input Circuitry
This section describes the analog input circuitry programming sequence, how to program the
binary mode of the A/D conversion result, and how to clear the analog input circuitry.
Analog Input Circuitry Programming Sequence
Programming the analog input circuitry for a single A/D conversion involves the following
sequence of steps:
1. Select analog input channel and gain.
2. Initiate an A/D conversion.
3. Read the A/D conversion result.
Each of these steps is discussed in detail as follows.