Mode 1-Strobed Input - National Instruments PC-DIO-24 User Manual

Digital i/o board for the ibm pc/xt/at
Table of Contents

Advertisement

Chapter 4
/* EXAMPLE 1*/
outp(cnfg,0x80);
outp(porta,0x12);
outp(portb,0x34);
outp(portc,0x56);
/* EXAMPLE 2*/
outp(cnfg,0x90);
outp(portb,0x22);
outp(portc,0x55);
valread = inp(porta);
/* EXAMPLE 3 */
outp(cnfg,0x82);
/* EXAMPLE 4 */
outp(cnfg,0x89);
}
Mode 1–Strobed Input
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 or an output, 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 CNFG Register to configure port A for input in mode 1 is shown
as follows. Bits PC6 and PC7 of port C can be used as extra input or output lines.
7
1
The control word written to the CNFG Register to configure port B for input in mode 1 is shown
as follows. Notice that port B does not have extra input or output lines from port C.
© National Instruments Corporation
/* Ports A, B, and C are outputs. */
/* Write data to port A. */
/* Write data to port B. */
/* Write data to port C. */
/* Port A is input; ports B and C are
/* Write data to port B. */
/* Write data to port C. */
/* Read data from port A. */
/* Ports A and C are outputs; port B
/* Ports A and B are outputs; port C
6
5
4
3
0
1
1
1/0
7
6
5
4
1
X
X
X
4-7
outputs. */
is an input. */
is an input. */
2
1
0
X
X
X
Port C bits PC6 and PC7
1 = input
0 = output
3
2
1
0
X
1
1
X
Register-Level Programming
PC-DIO-24 User Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents