Chapter 4
Programming
© National Instruments Corporation
4-55
AT-MIO-16D User Manual
6. 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 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.
An overrun condition occurs if an A/D conversion is initiated before the previous conversion is
finished. This condition may result in one or more missing A/D conversions. This condition
occurs if the sample interval is too small (sample rate is too high). An overrun condition has
occurred if the OVERRUN bit in the Status Register is set. The maximum recommended single-
channel data acquisition rate for the AT-MIO-16D is 100 ksamples/sec.
Both the OVERFLOW and OVERRUN bits in the Status Register are cleared by writing to the
A/D Clear Register.
Once steps 1 through 5 of this sequence are completed, Counter 3 is armed and begins generating
pulses. The sample counter does not begin counting samples until a rising edge signal is detected
on the STOP TRIG input. When the sample count decrements to zero, the data acquisition
operation is halted. The STOP TRIG signal specifications are given in Chapter 2, Configuration
and Installation.
Controlling Multiple A/D Conversions with the EXTCONV* Signal
When you use EXTCONV* to control multiple A/D conversions, none of the onboard counters
are used. Pulses applied to the EXTCONV* input initiate the A/D conversions. To perform this
operation, complete these steps:
1. Select analog input channel and gain.
2. Clear the A/D circuitry.
3. Service the data acquisition operation.
Summary of Contents for AT-MIO-16D
Page 16: ......
Page 23: ......
Page 185: ......
Page 206: ......
Page 207: ......
Page 208: ......
Page 209: ......
Page 210: ......
Page 211: ......
Page 212: ......
Page 213: ......
Page 214: ......
Page 215: ......
Page 216: ......
Page 217: ......
Page 218: ......
Page 219: ......
Page 220: ......
Page 221: ......
Page 222: ......
Page 223: ......
Page 224: ......
Page 225: ......
Page 226: ......
Page 227: ......
Page 228: ......
Page 229: ......
Page 230: ......
Page 231: ......
Page 232: ......
Page 233: ......
Page 234: ......
Page 235: ......
Page 236: ......
Page 237: ......
Page 238: ......
Page 239: ......
Page 240: ......
Page 241: ......
Page 242: ......
Page 243: ......
Page 244: ......
Page 246: ......
Page 247: ......
Page 248: ......
Page 249: ......
Page 250: ......
Page 251: ......
Page 252: ......
Page 253: ......
Page 254: ......
Page 255: ......
Page 256: ......
Page 257: ......
Page 258: ......
Page 259: ......
Page 260: ......
Page 261: ......