8255 is not functioning properly

Thread Starter

omaer faruq

Joined Sep 25, 2016
2
I have interfaced 8255A with 8086. PortA (Mode 0) is defined as input and PortB (Mode 0) and PortC are defined as output. PC0 and and PC1 are set by BSR command. As well as, I have read PortA and send it to PortB using a loop. But it is not working. I have attached the Proteus file. The assembly code is provided with the internal assembler. I have also added the code below.
Code:
DATA SEGMENT                       
 PORTA          EQU 00H;0000 0000
 PORTB          EQU 02H;0000 0010
 PORTC          EQU 04H;0000 0100
 CWR            EQU 06H;0000 0110
DATA ENDS

CODE SEGMENT
        ASSUME CS:CODE,DS:DATA
        MOV     AX,DATA
        MOV     DS, AX
 
START:
        MOV     AL, 90H     ;1001 1000-->I/0,MA1,MA2,PA I/O,PCUp I/O, MB, PB I/0, PCl I/O
        OUT     CWR, AL
      
        MOV     AL, 01H     ;0000 0001 BSR command PC0
        OUT     CWR, AL
 
        MOV     AL, 03H     ;0000 0011 BSR command PC1
        OUT     CWR, AL
 
XX:           
        IN      AL,PORTA
        OUT     PORTB,AL
        JMP     XX

CODE ENDS
END START
 

Attachments

sagor

Joined Mar 10, 2019
1,049
Without some diagram on how the 8255 is wired, hard for anyone to help. If there is incorrect wiring for the RD or WR or CS signals on that chip, nothing may work as expected. Not everyone has Proteus either. Just not enough information given here.
 

Thread Starter

omaer faruq

Joined Sep 25, 2016
2
Thanks for your suggestions. Here is the diagram.Picture2.pngPicture2.pngPicture2.png
Without some diagram on how the 8255 is wired, hard for anyone to help. If there is incorrect wiring for the RD or WR or CS signals on that chip, nothing may work as expected. Not everyone has Proteus either. Just not enough information given here.
 
Top