
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.
Summary of Contents for AT-MIO-16D
Page 16: ......
Page 23: ......
Page 185: ......
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: ......
Page 239: ......
Page 240: ......
Page 241: ......
Page 242: ......
Page 243: ......
Page 244: ......
Page 246: ......
Page 247: ......
Page 248: ......
Page 249: ......
Page 250: ......
Page 251: ......
Page 252: ......
Page 253: ......
Page 254: ......
Page 255: ......
Page 256: ......
Page 257: ......
Page 258: ......
Page 259: ......
Page 260: ......
Page 261: ......