Appendix C
Application Notes
© National Instruments Corporation
C-5
AT-DIO-32F User Manual
Cabling
Use the following cable to connect the two AT-DIO-32F boards. Both connectors are 50-pin,
female, ribbon cable connectors. Any pins not listed are not used and should be left open. The
signal names PA, PB, PC, and PD refer to Port A, Port B, Port C, and Port D, respectively. Refer
to Chapter 2 of this manual for connector and cable specifications.
AT-DIO-32F(1)
AT-DIO-32F(2)
AT-DIO-32F(1)
AT-DIO-32F(2)
PA0
37
14
PC0
PC0
14
37
PA0
PA1
39
12
PC1
PC1
12
39
PA1
PA2
38
13
PC2
PC2
13
38
PA2
PA3
40
11
PC3
PC3
11
40
PA3
PA4
35
16
PC4
PC4
16
35
PA4
PA5
42
9
PC5
PC5
9
42
PA5
PA6
36
15
PC6
PC6
15
36
PA6
PA7
41
10
PC7
PC7
10
41
PA7
PB0
47
4
PD0
PD0
4
47
PB0
PB1
50
1
PD0
PD1
1
50
PB1
PB2
44
7
PD2
PD2
7
44
PB2
PB3
48
3
PD3
PD3
3
48
PB3
PB4
49
2
PD4
PD4
2
49
PB4
PB5
43
8
PD5
PD5
8
43
PB5
PB6
46
5
PD6
PD6
5
46
PB6
PB7
45
6
PD7
PD7
6
45
PB7
REQ1
33
18
ACK2
REQ2
24
27
ACK1
ACK1
27
24
REQ2
ACK2
18
33
REQ1
GND
17
17
GND
GND
28
28
GND
GND
19
19
GND
GND
30
30
GND
GND
21
17
GND
GND
32
32
GND
GND
23
23
GND
GND
34
34
GND
Sending and Receiving files with the AT-DIO-32F
The following program is divided into two functional parts, one for sending files from the
AT-DIO-32F and the other for receiving files. Both are structured similarly and check for the
EOF marker which marks the end of transmission. The handshaking between the AT-DIO-32F
boards is fully automatic and requires no software toggling of lines.
For 16-bit communications, the program compresses two 8-bit characters into one 16-bit word
using the functions getw() and putw() from the standard unix library. The function getw() is
modified to the new function getwd() to recognize and return both 8-bit and 16-bit EOF markers.
Both getwd() and putw() are included at the end of the program and either function can be
expanded to handle 32-bit words. Notice that Port A and Port B are declared 16-bit type int.
/*
This program allows the AT-DIO-32F to send and receive 16-bit data
to and from an AT-DIO-32F in another PC.
*/
include <stdio.h>
Содержание AT-DIO-32F
Страница 19: ......
Страница 101: ......
Страница 102: ......
Страница 123: ......
Страница 124: ......
Страница 125: ......
Страница 126: ......
Страница 127: ......
Страница 128: ......
Страница 129: ......
Страница 130: ......
Страница 131: ......
Страница 132: ......
Страница 133: ......
Страница 134: ......
Страница 135: ......
Страница 136: ......
Страница 137: ......
Страница 138: ......
Страница 139: ......
Страница 140: ......
Страница 141: ......
Страница 142: ......
Страница 143: ......