©
National Instruments Corporation 5-1 AT-MIO-16X User Manual
Chapter
5
Programming
This chapter contains programming instructions for operating the
circuitry on the AT-MIO-16X.
Programming the AT-MIO-16X 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.
Note:
If you plan to use a programming software package such as NI-DAQ
or LabWindows/CVI with your AT-MIO-16X board, you need not read this
chapter.
Register Programming Considerations
Several write-only registers on the AT-MIO-16X contain bits that
control a number of 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.
Resource Allocation Considerations
Counters 1, 2, and 5 of the Am9513A Counter/Timer are available at the
I/O connector for general-purpose use. These counters can only be used
so long as this does not conflict with an internal operation in progress
on the board that is already using the desired counter. Table 5-1 lists the
five counters in the Am9513A Counter/Timer and enumerates what
they are used for in each operation.