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.
Содержание 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: ......