Professional Documents
Culture Documents
The 8255A: Programmable Peripheral Interface: Ee309: Computer Organization, Architecture and Microprocessors
The 8255A: Programmable Peripheral Interface: Ee309: Computer Organization, Architecture and Microprocessors
The 8255A: Programmable Peripheral Interface: Ee309: Computer Organization, Architecture and Microprocessors
A1
A0
8−BIT PORT A
A0 and A1 select entities:
CONTROL REGISTER
A1 A0 Selection
4−BIT PORT CU 0 0 Port A
CS
4−BIT PORT CL 0 1 Port B
1 0 Port C
1 1 Control Register
8−BIT PORT B
RD
WR
(40−PIN DEVICE: SAME SIZE AS THE 8085!)
0 X X X S/R
0: BSR BIT NUMBER 1: SET
in Port C 0: RESET
BSR Mode
• To set / reset bits in Port C, the control word is written in the Control
Register
• BSR Control Word affects one bit at a time
• Does not affect the I/O mode
PC 3 INTRA PC 3 INTRA
PC 0 INTRB PC 0 INTRB
RD WR
PC 6,7 I/O PC 4,5 I/O
I/O I/O IBF A INTE A INTRA IBF B INTE B INTRB OBFA INTE A I/O I/O INTRA INTE B OBFB INTRB
(PORT C, WITH STB REPLACED BY INTE) (PORT C, WITH ACK REPLACED BY INTE)
I/O Mode
1. Mode 0
• Simple I/O for Ports A, B, C
• A port is either an input port, or an output port
• Inputs are not latched, outputs are
• Ports do not have interrupt or handshake capability
2. Mode 1
• Ports A and B: a port is either an input port, or an output port
• Each port uses 3 lines of Port C for handshaking, the remaining 2
bits can be used for simple I/O (Mode 0)
• Input and output data are latched
• Interrupt Logic is supported
3. Mode 2
• Port A used as a bidirectional port
• Port B can be used in either Mode 0 or Mode 1
• Port A uses 5 bits of Port C for handshaking: the remaining can be
used for simple I/O (Mode 0) for Port B in Mode 0, or as handshaking
lines for Port B in Mode 1
8255A MODE 2 & MODE 0(INPUT) 8255A MODE 2 & MODE 1(OUTPUT)
PC 4 STB A PC 4 STB A
PC 5 IBF A PC 5 IBF A
PC 6 ACKA PC 6 ACKA
PC 7 OBFA PC 7 OBFA
PC 3 INTRA PC 3 INTRA
PC 0 INTRB
RD RD
PC 0−2 I/O
A1
A0 CLK 0
COUNTER 0 GATE 0
CONTROL REGISTER
OUT 0 A0 and A1 select entities:
A1 A0 Selection
CLK 1 0 0 Counter 0
CS COUNTER 1 GATE 1
OUT 1 0 1 Counter 1
1 0 Counter 2
CLK 2 1 1 Control Register
COUNTER 2 GATE 2
RD OUT 2
WR
(24−PIN DEVICE)
• The current count can be read anytime, doesn’t affect one-shot pulse
• Rules for GATE
– Rising: Initiates counting, resets OUT on next clock
– Other cases: no effect
3. Mode 2: Interrupt on Terminal Count
• Rules for OUT
– Generate a pulse of width = clock period, at a given interval
– When a count is loaded, OUT goes high and remains high until
count = 1, then goes low for one clock period (at the count of 0)
– Count reloaded automatically, the pulse generated continuously
– count = 1 is not allowed !
• Auxiliary Rule: If count register reloaded while counting is on, then
– The current output pulse timing is not affected
– The next one is, according to the new value of the count
• Rules for GATE
– Low / going low: disables counting, OUT goes high immediately
Sumantra Dutta Roy, EE, IITB sumantra@ee.iitb.ac.in
CAMP:8085 Peripherals Summary-5