Chapter 4
Programming
© National Instruments Corporation
4-59
AT-MIO-16D User Manual
c. Write FF0B to the Am9513A Command Register to select the Counter 3 Load Register.
d. Write 2 to the Am9513A Data Register to store the Counter 3 load value.
e. Write FF44 to the Am9513A Command Register to load Counter 3.
f.
Write FFF3 to the Am9513A Command Register to step Counter 3 down to one.
g. Write the desired sample interval to the Am9513A Data Register to store the Counter 3 load
value:
•
If the sample interval is between 2 and FFFF (65,535 decimal), write the sample interval
to the Am9513A Data Register.
•
If the sample interval is 10000 (65,536 decimal), write 0 to the Am9513A Data Register.
h. Write FF24 to the Am9513A Command Register to arm Counter 3.
After you complete this programming sequence, Counter 3 is configured to generate A/D
conversion pulses as soon as application of a trigger causes it to be enabled.
3. Program the sample counter.
Use Counters 4 and 5 of the Am9513A Counter/Timer as the sample counter. The sample
counter tallies the number of A/D conversions initiated by Counter 3 and stops Counter 3 when
the desired sample count is reached. The sample count should be programmed as a multiple of
the number of entries in the mux-gain memory. If the desired sample count is 65,536 or less,
only Counter 4 needs to be used, making Counter 5 available for general-purpose timing
applications. If the desired sample count is greater than 65,536, both Counters 4 and 5 must be
used.
Sample Counts 2 through 65,536. To program the sample counter for sample counts up to
65,536, use the following programming sequence. The minimum permitted sample count is 2.
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 sample count value to the Am9513A Data Register to store the Counter 4 load
value:
•
If the sample count is between 2 and FFFF (65,535 decimal), write the sample count
minus 1 to the Am9513A Data Register.
•
If the sample count is 10000 (65,536 decimal), write 0 to the Am9513A Data Register.
e. Write FF48 to the Am9513A Command Register to load Counter 4.
f.
Write FFF4 to the Am9513A Command Register to decrement Counter 4.
g. Write FF28 to the Am9513A Command Register to arm Counter 4.
h. Clear the 16*/32 CNT bit in Command Register 1 to notify the hardware that only Counter 4
will be used as the sample counter.
Содержание 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: ......