Programming
Chapter 4
AT-MIO-16D User Manual
4-42
© National Instruments Corporation
•
Gain of 1 selected.
•
All pins on the RTSI switch configured as input pins.
Initializing the Am9513A
Follow the sequence below to initialize the Am9513A Counter/Timer. All writes are 16-bit
operations. All values are given in hexadecimal.
1. Issue a master reset by writing FFFF to the Am9513A Command Register.
2. Set up Am9513A 16-bit mode by writing FFEF to the Am9513A Command Register.
3. Point to the Am9513A Master Mode Register by writing FF17 to the Am9513A Command
Register.
4. Load the master mode value into the Am9513A Master Mode Register by writing F000 to the
Am9513A Data Register.
5. To initialize all five counters – for ctr = 1 to 5, follow these steps:
a. Write FF00 + ctr to the Am9513A Command Register to select the Counter Mode
Register.
b. Write 0004 to the Am9513A Data Register to store the counter mode value.
c. Write FF08 + ctr to the Am9513A Command Register to select the Counter Load
Register.
d. Write 3 to the Am9513A Data Register to store an inactive count value in the Counter
Load Register.
6. Load all counters with their Counter Load Register values by writing FF5F to the Am9513A
Command Register.
After this sequence of writes, the Am9513A Counter/Timer is in the following state:
•
16-bit mode is enabled.
•
BCD scalar division is selected.
•
The FOUT signal is turned off.
•
All counter OUT output pins are set to high-impedance output state.
•
All counters are loaded with a non-terminal count value.
For additional details concerning the Am9513A Counter/Timer, see Appendix E, Am9513A Data
Sheet.
Note: If a data acquisition operation is to be executed and Counter 4 of Am9513A is not to be
used, then write 0000 to the Am9513A Data Register (instead of 0004) when ctr = 4.
Writing 0000 to the Am9513A Data Register causes the output of Counter 4 to be low
and therefore prevents improper termination of the data acquisition operation.
Содержание 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: ......