National Instruments 320174B-01 Computer Hardware User Manual


 
Chapter 4 Register-Level Programming
© National Instruments Corporation 4-59 Lab-NB User Manual
Example 2. Configure port A for input, port B and port C for output:
Write 90 (hex) to the Digital Control Register.
Write 8-bit data to port B or port C. Read 8-bit data from port A as appropriate.
Example 3. Configure port A and port C for output, port B for input:
Write 82 (hex) to the Digital Control Register.
Example 4. Configure port A and port B for output, port C for input:
Write 89 (hex) to the Digital Control Register.
Mode 1 Strobed Input Control Words
In mode 1, the digital I/O bits are divided into two groups: group A and group B. Each of these
groups contains one 8-bit port and one 4-bit control/data port. The 8-bit port can be either an
input port or an output port, and the 4-bit port is used for control and status information for the
8-bit port. The transfer of data is synchronized by handshaking signals in the 4-bit port.
The control word written to the Digital Control Register to configure port A for input in mode 1
is shown here. Bits PC6 and PC7 of port C can be used as extra input or output lines.
Port C bits PC6 and PC7
1 = input
0 = output
10XXX1 1/01
765
43210
The control word written to the Digital Control Register to configure port B for input in mode 1
is shown here. Notice that port B is not provided with extra input or output lines from port C.
1X1XXX1X
765
43210
During a mode 1 data read transfer, the status of the handshaking lines and interrupt signals can
be obtained by reading port C. The port C status-word bit definitions for an input transfer are
shown next.