Mode 2 Programming Example; Figure C-5. Port C Pin Assignments, Mode 2 - National Instruments PC-DIO-24/PnP User Manual

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

Advertisement

Main() {
#define BASE_ADDRESS
#define PORTAoffset
#define PORTBoffset
#define PORTCoffset
#define CNFGoffset
unsigned int porta, portb, portc, cnfg;
char valread;
/*
Calculate register addresses */
porta = BASE_ADDRESS + PORTAoffset;
portb = BASE_ADDRESS + PORTBoffset;
portc = BASE_ADDRESS + PORTCoffset;
© National Instruments Corporation
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.
Group A
Group B
#
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.

Figure C-5. 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.
0x180
0x00
0x01
0x02
0x03
/* Variable to store data read from a port */
Appendix C
PC7
OBFA*
PC6
ACKA*
PC5
PC4
STBA*
PC3
INTRA
PC2
PC1
PC0
/* Board located at address 180 */
/* Offset for port A */
/* Offset for port B */
/* Offset for port C */
/* Offset for CNFG */
C-19
Register-Level Programming
IBFA
#
#
#
PC-DIO-24/PnP User Manual

Advertisement

Table of Contents
loading

Table of Contents