Programming
Chapter 5
AT-MIO-64F-5 User Manual
5-16
© National Instruments Corporation
Once the trigger is applied, Counter 3 generates pulses initiating A/D conversions once every
sample interval until the sample counter reaches zero. In the pretrigger mode, these conversions
are not counted by the sample counter. Counting begins only after the application of a second
hardware or software trigger condition and continues until the sample counter reaches zero. A/D
conversion data stored before receipt of the EXTTRIG* or DAQ Start signal are pretrigger
samples.
Servicing the Data Acquisition Operation
Once the data acquisition operation is initiated with the application of a trigger, the operation
must be serviced by reading the ADC FIFO. The ADC FIFO can be serviced in two different
ways. One method is to monitor the ADCFIFOEF* to read the A/D conversion result every time
one becomes available. Another method is to monitor the ADCFIFOHF* flag and read in values
only when the ADC FIFO is at least half-full. If the FIFO is half-full, a block of 256 values can
be consecutively read in. The advantage of this second method is that Status Register 1 needs to
be read only once for every 256 values, while the first method requires one status register to be
read per ADC FIFO read.
To service the data acquisition operation, perform the following sequence until the data
acquisition has completed:
1. Read Status Register 1 (16-bit read).
2. If the OVERRUN or OVERFLOW bits are set, the data acquisition sequence has been halted
because one of these error conditions has occurred. Clear the A/D circuitry by writing to
DAQ Clear Register and determine the cause of the error. OVERRUN and OVERFLOW are
explained in step 3 of the
Programming the Analog Input Circuitry
section earlier in this
chapter.
3. If the ADCFIFOEF* bit is set (or the ADCFIFOHF* bit), read the ADC FIFO Register to
obtain the result(s).
Interrupts or DMA can also be used to service the data acquisition operation. These topics are
discussed later in this chapter.
Resetting the Hardware after a Data Acquisition Operation
After a data acquisition operation terminates, if no errors occurred and the sample count was less
than or equal to 10000 hex, the AT-MIO-64F-5 is left in the same state as it was at the beginning
of the data acquisition operation. The counters do not need to be reprogrammed; another data
acquisition operation begins when a trigger is received. If the next data acquisition operation
requires the counters to be programmed differently, the Am9513A counters that were used must
be disarmed and reset.
Resetting a Single Am9513A Counter/Timer
To reset a particular counter in the Am9513A, use the following programming sequence. All
writes are 16-bit operations. All values given are hexadecimal. The equation {2 ^ (ctr - 1)}
means {2 Òraised toÓ (ctr - 1)}. If ctr is equal to 4, then 2 ^ (ctr - 1) results in 2 ^ 3, or 2 * 2 * 2,
or 8. This result can also be obtained by shifting
1
left three times.
Содержание AT-MIO-64F-5
Страница 13: ......
Страница 16: ......
Страница 200: ......
Страница 201: ......
Страница 202: ......
Страница 203: ......
Страница 204: ......
Страница 205: ......
Страница 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: ......