Академический Документы
Профессиональный Документы
Культура Документы
Peripheral Interface
8085
A7
A6
A5
A4
A3
A2
IO/M
D[7:0]
PA[7:0]
PB[7:0]
Control port
PC[7:0]
CS
A1
A0
0
0
1
1
0
1
0
1
Port
PA
PB
PC
Control
Programming 8255
8255 has three operation modes: mode 0, mode 1, and mode 2
Mode 0
Basic I/O
Mode 1
Strobe I/O
Mode 2
Bi-Dir Bus
2. BSR MODE:
The BSR mode is concerned only with the 8 bit of port C,
which can be set or reset by writing an appropriate
control word in the control register.
A control word with bit d7=0 is recognized as a BSR
control word. It does not alter any previously transmitted
control word with bit d7=1 :
thus the I/O operations of ports A & B are not affected by
the BSR control word.
In the BSR mode individual bits of port C can be used for
applications such as an on/off switch.
Programming 8255
Mode 0:
Ports A, B, and C can be individually programmed as input or output ports
Port C is divided into two 4-bit ports which are independent from each other
Mode 1:
Ports A and B are programmed as input or output ports
Port C is used for handshaking
PC4
PC5
PC3
8255
PA[7:0]
STBA
IBFA
INTRA
PB[7:0]
PC2
PC1
PC0
PC6, 7
STBB
IBFB
INTRB
PC7
PC6
PC3
8255
PA[7:0]
OBFA
ACKA
INTRA
PB[7:0]
PC2
PC1
PC0
PC4, 5
OBFB
ACKB
INTRB
Programming 8255
Mode 2:
Port A is programmed to be bi-directional
Port C is for handshaking
Port B can be either input or output in mode 0 or mode 1
PA[7:0]
8255
PC7
PC6
PC4
PC5
PC3
PC0
PC0
PC0
OBFA
ACKA
STBA
IBFA
INTRA
In
In
In
PB[7:0]
1.
2.
Out
Out
Out
STBB
IBFB
INTRB
OBFB
ACKB
INTRB
Mode 1
Mode 0
Can you design a decoder for an 8255 chip such that its base address is 40H?
Write the instructions that set 8255 into mode 0, port A as input, port B as output,
PC0-PC3 as input, PC4-PC7 as output ?