Table 8–5
I/O port byte
Bit
7
Bit
6
Bit
5
Bit
4
Bit
3
Bit
2
Bit
1
Bit
0
Port I/O
Line
X
7
X
6
X
5
X
4
X
3
X
2
X
1
X
0
For example, writing 00011100 to port C (base a 2) will configure port C
I/O lines 0, 1, 5, 6, and 7 to be inputs and lines 2, 3, and 4 to be outputs:
OUT 1052h, 1Ch (00011100 binary = 1C hexadecimal)
3. Write a “1” to the control register (base re 3). This places the I/O chip
into “preset” mode:
OUT 1053h, 1 (control register, preset mode)
4. Write a bit pattern to appear at the outputs of the desired I/O port when the
I/O chip is put in “operation” mode; all input bits are unaffected.
5. Write a “3” to the control register (base re 3). This places the I/O chip
back into “operation” mode:
OUT 1053h, 3 (control register)
Writing and reading from I/O
Writing to or reading from the desired I/O port is accomplished with single
program statements:
1. To write a bit pattern to the desired I/O port:
OUT 1052h, FFh
All output bits of port C go high; all input bits are unaffected.
2. To read a bit pattern from the desired I/O port:
PORTC = INP(1052h)
The byte read from port C is assigned to variable PORTC.
68
Содержание 5266
Страница 18: ...Figure 2 1 5266 component diagram top 18 ...
Страница 19: ...Figure 2 2 5266 component diagram bottom 19 ...
Страница 20: ...Figure 2 3 5266 dimensions inches 20 ...
Страница 21: ...Figure 2 4 5266 dimensions mm 21 ...