Appendix D Register-Level Programming
©
National Instruments Corporation
D-23
PC-DIO-96/PnP User Manual
At the digital I/O connector, port C has the following pin assignments
when in mode 2. Notice that the status of STBA* and the status of
ACKA* are not included in the port C status word.
Figure D-6. Port C Pin Assignments, Mode 2
Mode 2 Programming Example
The following example shows how to configure PPI A for mode 2 input
and output and how to use the handshaking signals to control data flow.
This code is strictly an example and is not intended to be used without
modification in a practical situation.
Main() {
#define BASE_ADDRESS
0x180
/* Board located at address 180 */
#define APORTAoffset
0x00
/* Offset for PPI A, port A */
#define APORTBoffset
0x01
/* Offset for PPI A, port B */
#define APORTCoffset
0x02
/* Offset for PPI A, port C */
#define ACNFGoffset
0x03
/* Offset for PPI A, CNFG */
unsigned int porta, portb, portc, cnfg;
char valread;
/* Variable to store data read from a port */
#
The three port C lines associated with group B function are based on the
mode selected for group B; that is, if group B is configured for mode 0,
PC2-PC0 function as general-purpose input/output, but if group B is
configured for mode 1 input or output, PC2-PC0 function as handshaking
lines as shown in the preceding mode 1 sections.
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
OBFA*
ACKA*
IBFA
STBA*
INTRA
#
#
#
Group A
Group B
Summary of Contents for PC-DIO-96/PnP
Page 46: ......
Page 47: ......
Page 48: ......
Page 49: ......
Page 50: ......
Page 51: ......
Page 52: ......
Page 53: ......
Page 54: ......
Page 55: ......
Page 56: ......
Page 57: ......
Page 58: ......
Page 59: ......
Page 60: ......
Page 61: ......
Page 63: ......
Page 64: ......
Page 65: ......
Page 66: ......
Page 67: ......
Page 68: ......
Page 69: ......
Page 70: ......
Page 71: ......
Page 72: ......
Page 73: ......