Chapter 4
Programming
© National Instruments Corporation
4-37
AT-DIO-32F User Manual
Programming Considerations
The AT-DIO-32F has four 8-bit digital I/O ports. These ports are organized into two groups:
Group 1 contains Ports A and B, and Group 2 contains Ports C and D. The AT-DIO-32F can
also operate in two modes: Mode 0 and Mode 1. Mode 0 is basic I/O where each port can be
configured as a read or write port. Mode 1 is strobed I/O. Two handshaking lines are used to
synchronize the sending and receiving of data for each port. Mode 1 can also act as a pattern
generator by using the onboard counters or by using a signal routed across the RTSI bus interface
from another AT Series board. The following paragraphs discuss Mode 0, Mode 1, and pattern
generation.
Initializing the AT-DIO-32F Board
The AT-DIO-32F hardware must be initialized in order for the AT-DIO-32F circuitry to operate
properly. To initialize the AT-DIO-32F hardware, complete the following steps:
1. Write hex 0100 to the CFG1 Register.
2. Write hex 0100 to the CFG2 Register.
3. Write 0000 to the CFG3 Register.
4. Write 0000 to the CFG1 Register.
5. Write 0000 to the CFG2 Register.
6. Write 0001 to the CFG4 Register (only for Revision D and newer versions of the board).
7. Write hex 14 to the CNTRCMD Register.
8. Write hex 54 to the CNTRCMD Register.
9. Write 0 to the DMACLR1 Register.
10. Write 0 to the DMACLR2 Register.
11. Write 0 to the CNTINTCLR Register.
This sequence leaves the AT-DIO-32F circuitry in the following state:
• All digital I/O ports are in input mode.
• All interrupts are cleared and disabled.
• The outputs of Counter 0 and Counter 1 are high.
• The handshaking circuitry are cleared.
Содержание 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: ......