National Instruments Low-Cost Multifunction I/O Board for ISA Lab-PC+ Switch User Manual


 
Register-Level Programming Appendix E
Lab-PC+ User Manual E-26 © National Instruments Corporation
Table E-5. Mode 0 I/O Configurations
Control Word Group A Group B
Bit Port A Port C
1
Port B Port C
2
76543210
10000000 Output Output Output Output
10000001 Output Output Output Input
10000010 Output Output Input Output
10000011 Output Output Input Input
10001000 Output Input Output Output
10001001 Output Input Output Input
10001010 Output Input Input Output
10001011 Output Input Input Input
10010000 Input Output Output Output
10010001 Input Output Output Input
10010010 Input Output Input Output
10010011 Input Output Input Input
10011000 Input Input Output Output
10011001 Input Input Output Input
10011010 Input Input Input Output
10011011 Input Input Input Input
1
Upper nibble of Port C
2
Lower nibble of Port C
Programming Examples
Example 1. Configure all three ports (A, B, and C) as output ports in Mode 0:
Write 80 (hex) to the Digital Control Register.
Write 8-bit data to the Port A, Port B, or Port C Register as appropriate.
Example 2. Configure Port A for input, Port B and Port C for output:
Write 90 (hex) to the Digital Control Register.
Write 8-bit data to Port B or Port C. Read 8-bit data from Port A as appropriate.
Example 3. Configure Port A and Port C for output, Port B for input:
Write 82 (hex) to the Digital Control Register.
Example 4. Configure Port A and B for output, Port C for input:
Write 89 (hex) to the Digital Control Register.