Programming
Chapter 4
AT-MIO-16D User Manual
4-50
© National Instruments Corporation
case any spurious edges were caused while programming the counters. Write 0 to the A/D Clear
Register to empty the FIFO.
5. Enable the data acquisition operation.
To enable the data acquisition operation such that A/D conversions begin when a trigger is
received, set the DAQEN bit in Command Register 1.
6. Apply a trigger.
Once set up by the preceding steps, the data acquisition operation is initiated when a trigger is
received. A trigger can be provided in one of two waysÐthrough software or through hardware.
To initiate the data acquisition operation through software, write 0 to the Start DAQ Register
(16-bit write).
To initiate the data acquisition operation through hardware, apply an active low pulse to the
START TRIG* pin on the AT-MIO-16D I/O connector. See the
Data Acquisition Timing
Connections
section in Chapter 2,
Configuration and Installation
, for START TRIG* signal
specifications.
Once the trigger is applied, Counter 3 generates pulses initiating A/D conversions once every
sample interval until the sample counter reaches zero.
7. Service the data acquisition operation.
Once the data acquisition operation is started by application of a trigger, the operation must be
serviced by reading the A/D FIFO Register every time an A/D conversion result becomes
available. To do this, perform the following sequence until the desired number of conversion
results have been read:
a. Read the Status Register (16-bit read).
b. If the CONVAVAIL bit is set (bit 13), read the A/D FIFO Register to obtain the result.
You can also use interrupts or DMA to service the data acquisition operation. These topics are
discussed later in this chapter.
Two error conditions may occur during a data acquisition operationÐan overflow error or an
overrun error. These error conditions are reported through the Status Register and should be
checked every time the Status Register is read to check the CONVAVAIL bit. If either of these
error conditions occurs, the data acquisition operation stops.
An overflow condition occurs if more than 512 A/D conversions have been stored in the A/D
FIFO without the A/D FIFO being read; that is, the A/D FIFO is full and cannot accept any more
data. This condition occurs if the software loop reading the A/D FIFO Register is not fast
enough to keep up with the A/D conversion rate. When an overflow occurs, at least one A/D
conversion result is lost. An overflow condition has occurred if the OVERFLOW bit in the
Status Register is set.
Содержание AT-MIO-16D
Страница 16: ......
Страница 23: ......
Страница 185: ......
Страница 206: ......
Страница 207: ......
Страница 208: ......
Страница 209: ......
Страница 210: ......
Страница 211: ......
Страница 212: ......
Страница 213: ......
Страница 214: ......
Страница 215: ......
Страница 216: ......
Страница 217: ......
Страница 218: ......
Страница 219: ......
Страница 220: ......
Страница 221: ......
Страница 222: ......
Страница 223: ......
Страница 224: ......
Страница 225: ......
Страница 226: ......
Страница 227: ......
Страница 228: ......
Страница 229: ......
Страница 230: ......
Страница 231: ......
Страница 232: ......
Страница 233: ......
Страница 234: ......
Страница 235: ......
Страница 236: ......
Страница 237: ......
Страница 238: ......
Страница 239: ......
Страница 240: ......
Страница 241: ......
Страница 242: ......
Страница 243: ......
Страница 244: ......
Страница 246: ......
Страница 247: ......
Страница 248: ......
Страница 249: ......
Страница 250: ......
Страница 251: ......
Страница 252: ......
Страница 253: ......
Страница 254: ......
Страница 255: ......
Страница 256: ......
Страница 257: ......
Страница 258: ......
Страница 259: ......
Страница 260: ......
Страница 261: ......