Appendix C
Register-Level Programming
©
National Instruments Corporation
C-9
PC-DIO-24/PnP User Manual
Mode 2
Use this mode for communication over a bidirectional 8-bit bus.
Handshaking signals are used in a manner similar to mode 1. Mode 2 is
available for use in group A only (port A and the upper portion of
port C). Other features of this mode include the following:
•
One 8-bit bidirectional port (port A) and a 5-bit control/status port
(port C).
•
Latched inputs and outputs.
•
Interrupt generation and enable/disable functions.
Single Bit Set/Reset Feature
You can set or reset any of the eight bits of port C with one control
word. This feature generates control signals for port A and port B when
these ports are operating in mode 1 or mode 2.
Mode 0—Basic I/O
Use mode 0 for simple I/O functions (no handshaking) for each of the
three ports. You can assign each port as an input or an output port. The
16 possible I/O configurations are shown in Table C-3. Notice that bit 7
of the control word is set when programming the mode of operation for
each port.
Table C-3.
Mode 0 I/O Configurations
Number
Control Word
Group A
Group B
Bit
76543210
Port A
Port C
1
Port B
Port C
2
0
10000000
Output
Output
Output
Output
1
10000001
Output
Output
Output
Input
2
10000010
Output
Output
Input
Output
3
10000011
Output
Output
Input
Input
4
10001000
Output
Input
Output
Output
5
10001001
Output
Input
Output
Input
6
10001010
Output
Input
Input
Output
7
10001011
Output
Input
Input
Input
8
10010000
Input
Output
Output
Output