
Chapter 4
Programming
© National Instruments Corporation
4-41
AT-MIO-16D User Manual
MIO-16 Programming Considerations
This chapter contains programming instructions for operating the MIO-16 circuitry on the
AT-MIO-16D board. Programming the AT-MIO-16D involves writing to and reading from the
various registers on the board. The programming instructions list the sequence of steps to take.
The instructions are language independent; that is, they instruct you to write a value to a given
register, to set or clear a bit in a given register, or to detect whether a given bit is set or cleared
without presenting the actual code.
Register Programming Considerations
Several write-only registers on the AT-MIO-16D contain bits that control several independent
pieces of the onboard circuitry. In the instructions for setting or clearing bits, specific register
bits should be set or cleared without changing the current state of the remaining bits in the
register. However, writing to these registers simultaneously affects all register bits. You cannot
read these registers to determine which bits have been set or cleared in the past; therefore, you
should maintain a software copy of the write-only registers. This software copy can then be read
to determine the status of the write-only registers. To change the state of a single bit without
disturbing the remaining bits, set or clear the bit in the software copy and write the software copy
to the register.
Initializing the MIO-16 Circuitry of the AT-MIO-16D Board
The MIO-16 hardware must be initialized for the circuitry to operate properly. To initialize the
MIO-16 hardware, complete these steps:
1. Write 0 to Command Register 1 (16-bit write).
2. Write 0 to Command Register 2 (16-bit write).
3. Write 0 to the Mux-Gain Register.
4. Initialize the Am9513A (described below).
5. Write 0 to the A/D Clear Register.
6. Write 0 to the INT2CLR Register (16-bit write).
This sequence leaves the AT-MIO-16D circuitry in the following state:
•
DMA disabled.
•
All interrupts disabled.
•
Outputs of counter/timers in high-impedance state.
•
Analog input circuitry initialized.
•
A/D FIFO cleared.
•
Analog input channel 0 selected.
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: ......