6-10
Programming Options
Control Word Register
Before using your board, you must set the Control Word for each group to
configure the ports as inputs or outputs. The Control Word for each group
is contained in an 8-bit, write-only, Control Word register for that group.
Table 6-4 shows the bit assignments of a Control Word register.
Note that you can set Port A, Port B, and the upper and lower four bits of
Port C independently. As an example, the following register bits show a
Control Word of 93h. This Control Word sets Ports A, B, and C-Lower as
inputs while setting Port C-Upper as an output.
Table 6-4. Bit Assignments for a Control Word Register
Bit #
Value
7
1
6
0
5
0
4
Port A: 1 = input; 0 = output
3
Port C (upper four bits): 1 = input; 0 = output
2
0
1
Port B: 1 = input; 0 = output
0
Port C (lower four bits): 1 = input; 0 = output
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
1
0
0
1
0
0
1
1
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com