![background image](http://html1.mh-extra.com/html/national-instruments/pc-dio-24/pc-dio-24_user-manual_3505829037.webp)
Chapter 4
Register-Level Programming
© National Instruments Corporation
4-7
PC-DIO-24 User Manual
/* EXAMPLE 1*/
outp(cnfg,0x80);
/* Ports A, B, and C are outputs. */
outp(porta,0x12);
/* Write data to port A. */
outp(portb,0x34);
/* Write data to port B. */
outp(portc,0x56);
/* Write data to port C. */
/* EXAMPLE 2*/
outp(cnfg,0x90);
/* Port A is input; ports B and C are
outputs. */
outp(portb,0x22);
/* Write data to port B. */
outp(portc,0x55);
/* Write data to port C. */
valread = inp(porta);
/* Read data from port A. */
/* EXAMPLE 3 */
outp(cnfg,0x82);
/* Ports A and C are outputs; port B
is an input. */
/* EXAMPLE 4 */
outp(cnfg,0x89);
/* Ports A and B are outputs; port C
is an input. */
}
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.
1
0
1
1
1/0
X
X
X
7
6
5
4
3
2
1
0
1 = input
0 = output
Port C bits PC6 and PC7
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.
1
X
X
X
X
1
1
X
7
6
5
4
3
2
1
0
Summary of Contents for PC-DIO-24
Page 51: ...Appendix C OKI 82C55A Data Sheet PC DIO 24 User Manual C 2 National Instruments Corporation...
Page 52: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 3 PC DIO 24 User Manual...
Page 53: ...Appendix C OKI 82C55A Data Sheet PC DIO 24 User Manual C 4 National Instruments Corporation...
Page 54: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 5 PC DIO 24 User Manual...
Page 55: ...Appendix C OKI 82C55A Data Sheet PC DIO 24 User Manual C 6 National Instruments Corporation...
Page 56: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 7 PC DIO 24 User Manual...
Page 57: ...Appendix C OKI 82C55A Data Sheet PC DIO 24 User Manual C 8 National Instruments Corporation...
Page 58: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 9 PC DIO 24 User Manual...
Page 59: ...Appendix C OKI 82C55A Data Sheet PC DIO 24 User Manual C 10 National Instruments Corporation...
Page 60: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 11 PC DIO 24 User Manual...
Page 61: ...Appendix C OKI 82C55A Data Sheet PC DIO 24 User Manual C 12 National Instruments Corporation...
Page 62: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 13 PC DIO 24 User Manual...
Page 63: ...Appendix C OKI 82C55A Data Sheet PC DIO 24 User Manual C 14 National Instruments Corporation...
Page 64: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 15 PC DIO 24 User Manual...
Page 65: ...Appendix C OKI 82C55A Data Sheet PC DIO 24 User Manual C 16 National Instruments Corporation...
Page 66: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 17 PC DIO 24 User Manual...