
Programming
Chapter 4
AT-MIO-16D User Manual
4-44
© National Instruments Corporation
3. Read the A/D conversion result.
A/D conversion results are obtained by reading the A/D FIFO Register. Before reading the A/D
FIFO, however, the Status Register must be read to determine whether the A/D FIFO contains
any results.
To read the A/D conversion result, do the following:
a. Read the Status Register (16-bit read).
b. If the CONVAVAIL bit is set (bit 13), then read the A/D FIFO Register to obtain the result.
Reading the A/D FIFO Register removes the A/D conversion result from the A/D FIFO. The
binary modes of the A/D FIFO output are explained below.
The CONVAVAIL bit indicates whether one or more A/D conversion results are stored in the
A/D FIFO. If the CONVAVAIL bit is not set, the A/D FIFO is empty and reading the A/D FIFO
Register returns meaningless data. Once an A/D conversion is initiated, the CONVAVAIL bit is
set within 10
µ
sec, indicating that the data conversion result can be read from the FIFO.
An A/D FIFO overflow condition occurs if more than 512 conversions are initiated and stored in
the A/D FIFO before the A/D FIFO Register is read. If this condition occurs, the OVERFLOW
bit is set in the Status Register to alert you that one or more A/D conversion results have been
lost because of FIFO overflow. Writing to the A/D Clear Register clears this error flag and
empties the A/D FIFO.
A/D FIFO Output Binary Formats
The A/D conversion result can be returned from the A/D FIFO as a two's complement or straight
binary value by setting or clearing the 2SCADC* bit in Command Register 1. If the analog input
circuitry is configured for the input range 0 to +10 V, straight binary format is recommended (set
the 2SCADC* bit). Straight binary format returns numbers between 0 and 4,095 (decimal) when
the A/D FIFO Register is read. If the analog input circuitry is configured for the input ranges
-5 to +5 V or -10 to +10 V, two's complement format is recommended (clear the 2SCADC* bit).
Two's complement format returns numbers between -2,048 and +2,047 (decimal) when the A/D
FIFO Register is read.
The factory default setting is the input range -10 to +10 V. Table 4-2 shows input voltage versus
A/D conversion value for straight binary format and 0 to +10 V input range. Table 4-3 shows
input voltage versus A/D conversion value for two's complement format for both -5 to +5 V and
-10 to +10 V input ranges.
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: ......