Mode 2 Programming Example - National Instruments PC-DIO-24 User Manual

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

Advertisement

Chapter 4
Bit
Name
4
INTE2
3
INTRA
2–0
I/O
At the digital I/O connector, port C has the following pin assignments when in mode 2.

Mode 2 Programming Example

Main() {
#define BASE_ADDRESS
#define PORTAoffset
#define PORTBoffset
#define PORTCoffset
#define CNFGoffset
register unsigned int porta, portb, portc, cnfg;
char valread;
/*
Calculate register addresses. */
porta = BASE_ADDRESS + PORTAoffset;
portb = BASE_ADDRESS + PORTBoffset;
portc = BASE_ADDRESS + PORTCoffset;
cnfg
= BASE_ADDRESS + CNFGoffset;
© National Instruments Corporation
Description (continued)
Interrupt Enable Bit for Input—If this bit is set, interrupts are
enabled from the 82C55A for IBFA. Controlled by bit set/reset of
PC4.
Interrupt Request Status—If INTE1 is high and IBFA is high, this
bit is high, indicating that an interrupt request is asserted for input
transfers. If INTE2 is high and OBFA* is high, this bit is high,
indicating that an interrupt request is asserted for output transfers.
Input/Output—Extra I/O status lines available if port B is not
configured for mode 1.
PC7
PC6
PC5
PC4
Group A
PC3
PC2
Group B
PC1
PC0
0x210
/* Board located at address 210. */
0x00
/* Offset for port A */
0x01
/* Offset for port B */
0x02
/* Offset for port C */
0x03
/* Offset for CNFG */
/* Variable to store data read from a
port */
4-13
Register-Level Programming
OBFA*
ACKA*
IBFA
STBA*
INTRA
I/O
or
Hand-
shaking
PC-DIO-24 User Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents