National Instruments PC-LPM-16/PnP Switch User Manual


 
Appendix D Register-Level Programming
PC-LPM-16/PnP User Manual D-26
National Instruments Corporation
Programming Considerations
Following are programming instructions for operating the circuitry on
the PC-LPM-16/PnP. To program the PC-LPM-16/PnP, you must write
to and read from the various registers on the board. The following
programming instructions are language-independent; that is, they tell
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
The PC-LPM-16/PnP can only be used for 8-bit I/O transfers, so all the
I/O read-and-write operations are 8-bit operations.
Several write-only registers on the PC-LPM-16/PnP contain bits that
control several independent pieces of the onboard circuitry. In the set or
clear instructions provided, you should set or clear specific register bits
without changing the current state of the remaining bits in the register.
However, writing to these registers affects all register bits
simultaneously. 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. You can then read this
software copy 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 then write the software copy to
the register.
Initializing the PC-LPM-16/PnP
You must initialize the PC-LPM-16/PnP hardware for the circuitry to
operate properly. To initialize the PC-LPM-16/PnP hardware, complete
the following steps:
1. Write 00 (hex) to the Command Register 2.
2. Write 80 (hex) to the Command Register 1.
3. Write 34 (hex) to the Counter Mode Register.
4. Write 00 (hex) to the Timer Interrupt Clear Register.
5. Write 00 (hex) to the A/D Clear Register.
6. Read from A/D FIFO High-Byte and Low-Byte Registers and
ignore the data.
a.Book : l.Appendix D Page 26 Wednesday, November 20, 1996 6:36 PM