
Chapter 5: Programming
Manual Number: 00650-004-5
Page 5-7
Control Register
Before the 8255 can be used, it must be configured. Each of the 8-bit ports A, B, and C can be
selected as input or output ports (port C can also be selected as a control port if the buffers have
been replaced with wire jumpers). Remember, the 8255 power-up default mode is with all ports
configured for inputs and the CONTROL REGISTER should be configured even if this is the mode
you require.
8255 Mode Definition Format
(fig3-1.wmf)
BBBBBB
0RGH 3RUW $
' ' ' ' ' ' ' '
0RGH 6HW $FWLYH )ODJ 868$/ 9$/8(
%LW 6HW5HVHW $FWLYH )ODJ
&RQWURO :RUG
,QSXW 2XWSXW 3RUW & /
,QSXW 2XWSXW 3RUW %
0RGH 0RGH 3RUW %
,QSXW 2XWSXW 3RUW & 8
,QSXW 2XWSXW 3RUW $
; ; GRQW FDUH
Modes of Operation
The 8255 offers 3 MODES of operation as set by bits 3, 6 and 7. Bit 3 sets the mode for port B and
bits 6 & 7 for port A. Port C has no independent modes. The 8255 has several input/output modes
and the user is directed to the 8255 data sheet (refer to Appendix D) for complete programming
details. The following information will provide sufficient information for the majority of users.
MODE 0 - Basic Input/Output - This is the standard PCDIO mode
MODE 1 - Strobed Input/Output
MODE 2 - Bi-directional Bus
Note:
If you choose to remove the buffers from the board, your warranty will not be voided as long
as proper care is taken in removing the ICs. If the board is physically damaged in the process, the
warranty will be voided.