;8086 Microprocessor interfaced with 8255 PPI and ADC
;Read Analog input at Channel 0 of ADC0809 IC and display the digital value in the Segment Display
OUTPUT 2500AD
.ORG 2000H
DATA SEGMENT
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
MOV AL,98H
MOV DX,FFE6H
OUT DX,AL
L2:
MOV AL,00H
MOV DX,FFE4H
OUT DX,AL
MOV AL,00H
MOV DX,FFE2H
OUT DX,AL
MOV AL,02H
MOV DX,FFE4H
OUT DX,AL
MOV AL,03H
MOV DX,FFE4H
OUT DX,AL
MOV AL,01H
MOV DX,FFE4H
OUT DX,AL
MOV AL,00H
MOV DX,FFE4H
OUT DX,AL
L1:
MOV DX,FFE4H
IN AL,DX
RCL AL,01H
JNC L1
MOV AL,04H
MOV DX,FFE4H
OUT DX,AL
MOV DX,FFE0H
IN AL,DX
MOV BL,00H
MOV BH,00H
DB 9AH,12H,0BH,00H,0FFH
JMP L2
CODE ENDS
END
;Read Analog input at Channel 0 of ADC0809 IC and display the digital value in the Segment Display
OUTPUT 2500AD
.ORG 2000H
DATA SEGMENT
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
MOV AL,98H
MOV DX,FFE6H
OUT DX,AL
L2:
MOV AL,00H
MOV DX,FFE4H
OUT DX,AL
MOV AL,00H
MOV DX,FFE2H
OUT DX,AL
MOV AL,02H
MOV DX,FFE4H
OUT DX,AL
MOV AL,03H
MOV DX,FFE4H
OUT DX,AL
MOV AL,01H
MOV DX,FFE4H
OUT DX,AL
MOV AL,00H
MOV DX,FFE4H
OUT DX,AL
L1:
MOV DX,FFE4H
IN AL,DX
RCL AL,01H
JNC L1
MOV AL,04H
MOV DX,FFE4H
OUT DX,AL
MOV DX,FFE0H
IN AL,DX
MOV BL,00H
MOV BH,00H
DB 9AH,12H,0BH,00H,0FFH
JMP L2
CODE ENDS
END
Thank for the code! its really helpful. very clean and neat explanation
ReplyDelete