Chapter 4 Register-Level Programming
© National Instruments Corporation 4-61 Lab-NB User Manual
Mode 1 Input Programming Example
Example 1. Configure port A as an input port in mode 1:
• Write B0 (hex) to the Digital Control Register.
• Wait for bit 5 of port C (IBFA) to be set, indicating that data has been latched into port A.
• Read data from port A.
Example 2. Configure port B as an input port in mode 1:
• Write 86 (hex) to the Digital Control Register.
• Wait for bit 1 of port C (IBFB) to be set, indicating that data has been latched into port A.
• Read data from port B.
Mode 1 Strobed Output Control Words
The control word written to the Digital Control Register to configure port A for output in mode 1
is shown here. Bits PC4 and PC5 of port C can be used as extra input or output lines when port
A uses mode 1 output.
Port C bits PC4 and PC5
1 = input
0 = output
10XXX0 1/01
765
43210
The control word written to the Digital Control Register to configure port B for output in mode 1
is shown here. Notice that port B is not provided with extra input or output lines from port C.
1X0XXX1X
765
43210
During a mode 1 data write transfer, the status of the handshaking lines and interrupt signals can
be obtained by reading port C. Notice that the bit definitions are different for a write and a read
transfer.