Professional Documents
Culture Documents
Fig 4.3 Control Word Register Bit Format of 8255 for I/O
mode and BSR mode
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
PA[7:0] PA[7:0]
PC4 STBA PC7 OBFA
PC5 IBFA PC6 ACKA
PC3 INTRA PC3 INTRA
8255 PB[7:0] 8255 PB[7:0]
PC2 STBB PC2 OBFB
PC1 IBFB PC1 ACKB
PC0 INTRB PC0 INTRB
PC6, 7 PC4, 5
PA[7:0]
PC7 OBFA
PC6 ACKA
PC4 STBA
8255 PC5 IBFA
PC3 INTRA
PC0 In Out STBB OBFB
PC0 In Out IBFB ACKB
PC0 In Out INTRB INTRB
PB[7:0]
Mode 0 Mode 1
8255 Printer
PB0
PB7
ACK
PC2 ACK
PC4 DS
Problem:-
Interface ADC 0808 with 8086 using 8255 ports. Use Port A
of 8255 for transferring digital data output of ADC to the
CPU & Port C for control signals. Assume that an analog
input is present at I/P2 of the ADC and a clock input of
suitable frequency is available for ADC. Draw the
schematic & timing diagram of different signals of
ADC0808.
Solution:-
2 1 0 0 1 0 0 1 0 92
3 1 0 0 0 0 1 1 0 86
4 1 1 0 0 1 1 0 0 CC
5 1 0 1 0 0 1 0 0 A4
Anticlockwise 1 1 0 0 0
2 0 0 0 1
3 0 0 1 0
4 0 1 0 0
5 1 0 0 0
ALP:
Assume cs:Code
Code segment
Start: MOV AL, 80H
OUT CWR, AL
MOV AL, 88H; Bit pattern 10001000
MOV CX, 1000
Again1: OUT Port A, AL
CALL DELAY
ROL AL, 01
DEC CX
JNZ Again1
MOV AL, 88H
MOV CX, 1000
Again2: OUT Port A, AL
CALL DELAY
ROR AL, 01
DEC CX
JNZ Again2
MOV AH, 4CH
INT 21H
Code ends
End start