
Programming
Chapter 4
AT-MIO-16D User Manual
4-82
© National Instruments Corporation
/* 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
Mode 1 transfers data that is synchronized by handshaking signals. Ports A and B use the eight
lines of Port C to generate or receive the handshake signals. This mode divides the ports into
two groups (Group A and Group B):
•
Each group contains one 8-bit data port (Port A or Port B) and one 4-bit control/data port
(upper or lower nibble of Port C).
•
The 8-bit data ports can be either input or output, both of which are latched.
•
The 4-bit ports are used for control and status of the 8-bit data ports.
•
The transfer of data is synchronized by handshaking signals in the 4-bit port.
•
Interrupt generation and enable and/or disable functions are available.
The control word written to the DIO-24 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.
Port C bits PC6 and PC7
1 = input
0 = output
7
6
5
4
3
2
1
0
1
0
X
X
X
1
1/0
1
Summary of Contents for AT-MIO-16D
Page 16: ......
Page 23: ......
Page 185: ......
Page 206: ......
Page 207: ......
Page 208: ......
Page 209: ......
Page 210: ......
Page 211: ......
Page 212: ......
Page 213: ......
Page 214: ......
Page 215: ......
Page 216: ......
Page 217: ......
Page 218: ......
Page 219: ......
Page 220: ......
Page 221: ......
Page 222: ......
Page 223: ......
Page 224: ......
Page 225: ......
Page 226: ......
Page 227: ......
Page 228: ......
Page 229: ......
Page 230: ......
Page 231: ......
Page 232: ......
Page 233: ......
Page 234: ......
Page 235: ......
Page 236: ......
Page 237: ......
Page 238: ......
Page 239: ......
Page 240: ......
Page 241: ......
Page 242: ......
Page 243: ......
Page 244: ......
Page 246: ......
Page 247: ......
Page 248: ......
Page 249: ......
Page 250: ......
Page 251: ......
Page 252: ......
Page 253: ......
Page 254: ......
Page 255: ......
Page 256: ......
Page 257: ......
Page 258: ......
Page 259: ......
Page 260: ......
Page 261: ......