Chapter 4
Programming
© National Instruments Corporation
4-49
AT-MIO-16D User Manual
Sample Counts Greater Than 65,536
To program the sample counter for sample counts greater than 65,536, use the following
programming sequence. The lower 16 bits of the sample count are stored in Counter 4, and the
upper 16 bits of the sample count are stored in Counter 5. All writes are 16-bit operations. All
values given are hexadecimal.
a.
Write FF04 to the Am9513A Command Register to select the Counter 4 Mode Register.
b.
Write 1025 to the Am9513A Data Register to store the Counter 4 mode value.
c.
Write FF0C to the Am9513A Command Register to select the Counter 4 Load Register.
d.
Write the least significant 16 bits of the sample count value minus 1 to the Am9513A Data
Register to store the Counter 4 load value.
¥
If the 16 LSBs are all 0, write FFFF.
e.
Write FF48 to the Am9513A Command Register to load Counter 4.
f.
Write 0 to the Am9513A Data Register to store 0 into the Load Register for Counter 4
reloading.
g.
Write FF28 to the Am9513A Command Register to arm Counter 4.
h.
Write FF05 to the Am9513A Command Register to select the Counter 5 Mode Register.
i.
Write 25 to the Am9513A Data Register to store the Counter 5 mode value.
j.
Write FF0D to the Am9513A Command Register to select the Counter 5 Load Register.
k.
Take the most significant 16 bits of the sample count and do the following:
¥
If the least significant 16 bits of the sample count are all 0 or all 0 except for a 1 in the
least significant bit, write the most significant 16 bits to the Am9513A Data Register to
store the Counter 5 load value.
¥
Otherwise, add 1 to the most significant 16 bits of the sample count and write that value
to the Am9513A Data Register to store the Counter 5 load value.
l.
Write FF70 to the Am9513A Command Register to load and arm Counter 5.
m. Set the 16*/32 CNT bit in Command Register 1 to notify the hardware that both Counters 4
and 5 will be used as the sample counter.
After you complete this programming sequence, Counter 4 is configured to count A/D
conversion pulses generated by Counter 3, and Counter 5 decrements every time Counter 4
reaches zero. The data acquisition operation is terminated when both Counters 4 and 5 reach
zero.
4. Clear the A/D circuitry.
Before you start the data acquisition operation, you must empty the A/D FIFO to clear out any
old A/D conversion results. This emptying must be done after the counters are programmed in
Содержание 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: ......