Programming
Chapter 4
AT-MIO-16D User Manual
4-58
© National Instruments Corporation
1. Set up the analog channel and gain selection sequence.
During a scanning data acquisition operation, a selected number of locations in the mux-gain
memory are clocked through. A new mux-gain memory location is selected after each A/D
conversion. The first conversion is performed on the first channel and gain setting in the
memory. The second conversion is performed on the second channel and gain setting, and so on.
The last entry written to the mux-gain memory must have the LASTONE bit set. This bit marks
the end of the scan sequence. After the last conversion is performed, the scan sequence starts
over. If there are X entries in the mux-gain memory, every Xth conversion in the data collected is
performed on the same channel and gain setting.
Multiple conversions can be performed on each entry in the mux-gain memory before
incrementing to the next entry in the scan sequence. If the SCANDIV bit in Command Register
1 is set, the mux-gain memory increments to the next entry when an active low pulse is detected
on the Am9513A Counter/Timer OUT1 signal. If the SCANDIV bit is cleared, the mux-gain
memory is incremented to the next entry after every conversion.
The mux-gain memory must be loaded with the desired scan sequence before data acquisition
begins. To load the mux-gain memory, perform the following write operations where X is the
number of entries in the scan sequence:
For i = 0 to X-1, do the following:
a. Write i to the Mux-Counter Register to select the mux-gain memory location.
b. Write the desired analog channel selection and gain setting to the Mux-Gain Register to load
the mux-gain memory at location i .
c. If i = X-1, also set the LASTONE bit when writing to the Mux-Gain Register.
2. Program the sample-interval counter.
Use Counter 3 of the Am9513A Counter/Timer as the sample-interval counter. Counter 3 can be
programmed to generate a pulse once every N counts. N is referred to as the sample interval, that
is, the time between successive A/D conversions. N can be between 2 and 65,536. One count is
equal to the period of the timebase clock used by the counter. The following clocks are available
internal to the Am9513A: 1 MHz, 100 kHz, 10 kHz, 1 kHz, and 100 Hz. In addition, the
sample-interval timer can use signals connected to any of the Am9513A SOURCE input pins.
To program the sample-interval counter, use the following programming sequence. All writes
are 16-bit operations. All values given are hexadecimal.
a. Write FF03 to the Am9513A Command Register to select the Counter 3 Mode Register.
b. Write the mode value to the Am9513A Data Register to store the Counter 3 mode value. Use
one of the following mode values:
8B25 – Selects 1-MHz clock
8C25 – Selects 100-kHz clock
8D25
–
Selects 10-kHz clock
8E25 – Selects 1-kHz clock
8F25 – Selects 100-Hz clock
8525 – Selects signal at SOURCE5 input as clock (counts the rising edge of the signal,
6 MHz maximum)
Содержание 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: ......