Mode 1-Strobed Output - National Instruments PC-DIO-24/PnP User Manual

24-bit digital i/o board for isa computers
Table of Contents

Advertisement

Appendix C
Register-Level Programming
/* EXAMPLE 1–port A input */
outp(cnfg,0xB0);
while (!(inp(portc) & 0x20));
valread = inp(porta);
/* EXAMPLE 2–Port B input */
outp(cnfg,0x86);
while (!(inp(portc) & 0x02));
valread = inp(portb);
}
Mode 1—Strobed Output
PC-DIO-24/PnP User Manual
The control word written to the CNFG Register to configure port A for
output in mode 1 is shown as follows. Bits PC4 and PC5 of port C can
be used as extra input or output lines.
D7
D6
1
0
The control word written to the CNFG Register to configure port B for
output in mode 1 is shown as follows. Notice that port B does not have
extra input or output lines left from port C when ports A and B are both
enabled for handshaking.
D6
D7
1
X
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.
/* Port A is an input in mode 1. */
/* Wait until IBFA is set,
indicating that data has been
loaded in port A. */
/* Read the data from port A. */
/* Port B is an input in mode 1. */
/* Wait until IBFB is set,
indicating that data has been
loaded in port B. */
D5
D3
D2
D4
1
0
1/0
D5
D3
D4
X
X
X
C-14
D1
D0
X
X
X
Port C bits PC4 and PC5
1 = input
0 = output
D2
D1
D0
1
1
X
© National Instruments Corporation

Advertisement

Table of Contents
loading

Table of Contents