![National Instruments AT-MIO-64F-5 User Manual Download Page 160](http://html1.mh-extra.com/html/national-instruments/at-mio-64f-5/at-mio-64f-5_user-manual_3417320160.webp)
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.
Summary of Contents for AT-MIO-64F-5
Page 13: ......
Page 16: ......
Page 200: ......
Page 201: ......
Page 202: ......
Page 203: ......
Page 204: ......
Page 205: ......
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: ......