Manual PCI-A12-16A
19
Offset 10, 11, and 12 8255 Digital I/O Ports
These registers are the ports of the 8255; offset 10 is port A, offset 11 is port B, and offset 12 is port C. Each
port is 8 bits, for a total of 24 bits. Each port’s direction can configured independently via the control register
at offset 13. All ports power up as input ports. Each bit has a weak pull-up, so that with no signal applied, all
inputs read high.
Writing to an output port will update the data on that port. Reading from an output port will read back the
output data. Reading from an input port will read the current data on that port. Writing to an input port is
ignored.
Port C can be treated as two 4-bit ports, C Hi (bits 4-7) and C Lo (bits 0-3), instead of a single 8-bit port.
Often, one is configured as an input port and the other as an output port, to provide a few control signals in
each direction. Since writes to inputs are ignored, one can be written to without affecting the inputs of the
other.
Offset 13
8255 Control
This register is normally used to control the direction of the 8255 digital I/O ports. Port modes can also be set
here, however the card is only designed for mode 0; contact the factory for a custom solution if modes 1 or 2
are desired. Bit assignments in this control byte are as follows:
Bit
Assignment
Function
D0
Port C Lo (C0-C3)
1 = Input, 0 = Output
D1
Port B
1 = Input, 0 = Output
D2
Mode Selection (B & C Lo)
Use 0
D3
Port C Hi (C4-C7)
1 = Input, 0 = Output
D4
Port A
1 = Input, 0 = Output
D5
Mode Selection (A & C Hi)
Use 0
D6
Mode Selection (Mode 2)
Use 0
D7
Mode Set Flag
Use 1
Three common control bytes (in hex):
80 - Set all ports to output.
9B - Set all ports to input. This is their power-on configuration.
83 - Set ports A and C Hi to output, set ports B and C Lo to input.