Write a program in ALP to establish Communication between two processors using 8251.

Aim:

Write a program in ALP to establish Communication between two processors using 8251.

Apparatus:

1. ADS-SDA-86-STA kit
2. 8255 Study card
3. Adapter, Keyboard, Cables, Connecting Wires Etc...

Procedure:

1. Connect 8086 kit PC using RS232 cable.
2. Connect Power supply to 8086 kit and 8255 interfacing kit(only blue( 5v) and black(0v) lines   Power cable to power supply)
3. Connect 8255 to CN4 of 8086 using 26  pin bus.
4. Keep the DIP switch in 1 & 7 on (8086kit), open TALK, and go to options select target device as 8086 and Connect.
5. Change dip switch into 1 & 5on, once reset 8086 kit.
6. Go to file →Download hex file
7. Keep the DIP switch in 1 & 7 on (8086kit)
8. G-5000(on kit keyboard), ‘ENTER CHANNEL NUMBER” displays on LCD display.
9. Type the channel number on kit keyboard and connect the connecting wire the particular channel and power supplies given to 8255 study card. Now observe the output on the 8086 kit

Program:

.OUTPUT 2500AD
CONTROL    EQU FFC6H    ;control port address for 8255
PORTA EQU FFC0H    ;porta address for 8255
PORTB EQU FFC2H    ;portb address for 8255
PORTC EQU FFC4H    ;portc address for 8255
KWAD EQU F800 : 4EEDH
DBDTA EQUF800 : 4F1FH
DSEG SEGMENT
     ORG 0000 : 4000H
MSG DB            'Enter channel No',0h
DSEG ENDS
CSEG SEGMENT
     ASSUME CS : CSEG, DS : DSEG
     ORG 0000 : 5000H
;displaying message on LCD
     Callfar f800 : 4bb1h    ;clear display
    movdi, 80h    ;display in upper line
    MOV SI, offset MSG    ;
    CALLFAR f800 : 4FC0h    ;display output routine
    MOV AX, 0000H
    MOV DS, AX    
;AD00: CALL FAR KWAD    ;get key for channel selection
    MOV CX, SI
    MOV AL, 90H    ;control word for PPI
    MOV DX, CONTROL
    OUT DX, AL    ;portA->i/p port,portB->o/p port
                ;portC->o/p port.
AD00: MOV AL, CL    ;output channel number
      MOV DX, PORTC
      OUT DX, AL          ;start conversion
      MOV AL, 0FH    ;PC7 (START/ALE) set
      MOV DX, CONTROL
      OUT DX, AL
      PUSH CX
      MOV CX, 3FFFH
DEL1: LOOP DEL1
      POP CX
      MOV AL, 0EH        ;PC7 reset
      MOV DX, CONTROL
      OUT DX, AL    ;look for EOC
      MOV AL, 0CH        ;reset PC6 to read EOC
      OUT DX, AL
AD01: MOV DX, PORTA
      IN AL, DX    ;poll the EOC line which
      AND AL, 80H    ;is connected to PA7 line
      CMP AL, 80H
      JNZ AD01                  ;if EOC (PA7) is high read the digital value otherwise      again check for EOC (PA7) line
      MOV AL, 0DH    ;set OE (PC6) to read value
      MOV DX, CONTROL
      OUT DX, AL  ;before reading data from ADC set PC6 line
      MOV DX, PORTA
      IN AL, DX    ;read digital value
      MOV AH, 00H
      MOV SI, AX
      PUSH CX
      CALL FAR DBDTA    ;display digital value
      POP CX
      JMP AD00
CSEG ENDS
END

Result:

Analog to Digital Conversion using 8255 is studied is Studied And The Output is Verified

Viva-voce questions:

1. What is the IC numbers of ADC and DAC?
2. How to interface ADC and DAC to 8086?
3. How does the 8086 microprocessor instruction set is classified?
4. Which operation is performed by the Negate instruction?
5. What is the difference between RET and IRET instruction?