8255 Programmable Peripheral Interface
(Dated: pre-2000)Features:
- 3 8-bit IO ports PA, PB, PC
- PA can be set for Modes 0, 1, 2. PB for 0,1 and PC for mode 0 and for BSR. Modes 1 and 2 are interrupt driven.
- PC has 2 4-bit parts: PC upper (PCU) and PC lower (PCL), each can be set independently for I or O. Each PC bit can be set/reset individually in BSR mode.
- PA and PCU are Group A (GA) and PB and PCL are Group B (GB)
- Address/data bus must be externally demux'd.
- TTL compatible.
- Improved dc driving capability
Pinout
|
Block diagram
BSR mode
Bit set/reset, applicable to PC only. One bit is S/R at a time. Control word:
D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
0 (0=BSR) | X | X | X | B2 | B1 | B0 | S/R (1=S,0=R) |
Bit select: (Taking Don't care's as 0)
B2 | B1 | B0 | PC bit | Control word (Set) | Control word (reset) |
0 | 0 | 0 | 0 | 0000 0001 = 01h | 0000 0000 = 00h |
0 | 0 | 1 | 1 | 0000 0011 = 03h | 0000 0010 = 02h |
0 | 1 | 0 | 2 | 0000 0101 = 05h | 0000 0100 = 04h |
0 | 1 | 1 | 3 | 0000 0111 = 07h | 0000 0110 = 06h |
1 | 0 | 0 | 4 | 0000 1001 = 09h | 0000 1000 = 08h |
1 | 0 | 1 | 5 | 0000 1011 = 0Bh | 0000 1010 = 0Ah |
1 | 1 | 0 | 6 | 0000 1101 = 0Dh | 0000 1100 = 0Ch |
1 | 1 | 1 | 7 | 0000 1111 = 0Fh | 0000 1110 = 0Eh |
I/O mode
D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
1 (1=I/O) | GA mode select | PA | PCU | GB mode select | PB | PCL |
- D6, D5: GA mode select:
- 00 = mode0
- 01 = mode1
- 1X = mode2
- D4(PA), D3(PCU): 1=input 0=output
- D2: GB mode select: 0=mode0, 1=mode1
- D1(PB), D0(PCL): 1=input 0=output
Mode 0: No interrupts. Plain I/O. Two 8 bit ports PA, PB. Two 4 bit ports PCU and PCL. Outputs latched, inputs buffered.
Mode 1
(Input and output data are latched)
PC bits in input mode: | |||||||
D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
PC7 | PC6 | IBF-A | INTE-A / STB-A-bar | INTR-A | INTE-B / STB-B-bar | IBF-B | INTR-B |
PC bits in output mode: | |||||||
D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
OBF-A-bar | INTE-A / ACK-A-bar | PC5 | PC4 | INTR-A | INTE-B / ACK-B-bar | OBF-B-bar | INTR-B |
Input mode:
- D4, D2: Set/Reset INTE using BSR. STB-bar input is connected to external peripheral's strobe output (i.e. PC2, PC4 pin to external strobe).
- INTE is internal connection. STB-bar is external connection.
Output mode:
- D6, D2: Set/Reset INTE using BSR. ACK-bar input is connected to external peripheral's acknowledge output (i.e. PC2, PC6 pin to external ack).
- INTE is internal connection. ACK-bar is external connection.
Mode 2
Only for PA
Status:D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
OBF-A-bar | INTE1(O/P) / ACK-A-BAR | IBF-A | INTE2(I/P) / STB-A-bAR | INTR-A | X | X | X |