Programming
Chapter 4
AT-MIO-16D User Manual
4-86
© National Instruments Corporation
At the digital I/O connector, Port C has the following pin assignments when in Mode 1 output.
Notice that the status of ACKA* and ACKB* is not included when Port C is read.
OBFA*
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
I/O
INTRA
ACKB*
OBFB*
INTRB
I/O
Group A
Group B
ACKA*
Mode 1 Output Programming Example
Main() {
#define BASE_ADDRESS
0x210
/* Board located at address 210. */
#define PORTAoffset
0x00
/* Offset for Port A */
#define PORTBoffset
0x01
/* Offset for Port B */
#define PORTCoffset
0x02
/* Offset for Port C */
#define CNFGoffset
0x03
/* Offset for CNFG */
register unsigned int porta, portb, portc, cnfg;
char valread;
/* Variable to store data read from a
port */
/* Calculate register addresses. */
porta = BASE_A PORTAoffset;
portb = BASE_A PORTBoffset;
portc = BASE_A PORTCoffset;
cnfg = BASE_A CNFGoffset;
/* EXAMPLE 1–Port A output */
outp(cnfg,0xA0);
/* Port A is an output in Mode 1.*/
while (!(inp(portc) & 0x80));
/* Wait until OBFA* is set, indicating
that the data last written to Port A
has been read.*/
outp(porta,0x12);
/* Write data to Port A. */
/* EXAMPLE 2–Port B output */
outp(cnfg,0x84);
/* Port B is an output in Mode 1.*/
while (!(inp(portc) & 0x02));
/* Wait until OBFB* is set, indicating
that the data last written to Port B
has been read.*/
outp(portb,0x34);
/* Write the data to Port B. */
}
Содержание AT-MIO-16D
Страница 16: ......
Страница 23: ......
Страница 185: ......
Страница 206: ......
Страница 207: ......
Страница 208: ......
Страница 209: ......
Страница 210: ......
Страница 211: ......
Страница 212: ......
Страница 213: ......
Страница 214: ......
Страница 215: ......
Страница 216: ......
Страница 217: ......
Страница 218: ......
Страница 219: ......
Страница 220: ......
Страница 221: ......
Страница 222: ......
Страница 223: ......
Страница 224: ......
Страница 225: ......
Страница 226: ......
Страница 227: ......
Страница 228: ......
Страница 229: ......
Страница 230: ......
Страница 231: ......
Страница 232: ......
Страница 233: ......
Страница 234: ......
Страница 235: ......
Страница 236: ......
Страница 237: ......
Страница 238: ......
Страница 239: ......
Страница 240: ......
Страница 241: ......
Страница 242: ......
Страница 243: ......
Страница 244: ......
Страница 246: ......
Страница 247: ......
Страница 248: ......
Страница 249: ......
Страница 250: ......
Страница 251: ......
Страница 252: ......
Страница 253: ......
Страница 254: ......
Страница 255: ......
Страница 256: ......
Страница 257: ......
Страница 258: ......
Страница 259: ......
Страница 260: ......
Страница 261: ......