ADC Interfacing with 8051 - Assembly Program Code - Proteus Stimulation - Keil


The program is stimulated in proteus, compiled in Keil for 8051 - AT89C51 in assembly language.

Program for ADC interfacing with 8051 in assembly language using proteus and uvision,

Flowchart:-



Proteus Stimulation:-



Program:-

ORG 00H
MOV DPTR,#COMMANDN
NE2: CLR A
MOVC A,@A+DPTR
ACALL COMMAND1
ACALL DELAY
INC DPTR
CJNE A,#00H,NE2
MOV DPTR,#DATAN
NE1 : CLR A
MOVC A,@A+DPTR
ACALL DATA1
ACALL DELAY
INC DPTR
CJNE A,#00H,NE1
REPEAT: CLR P3.0
SETB P3.1
SETB P3.2
ACALL DELAY
SETB P3.0
HERE1 : JB P3.2,HERE1
CLR P3.1
ACALL DISPLAY
SETB P3.1
SJMP REPEAT
DELAY:MOV R6,#0FFH
BAK1:MOV R7,#0FFH
BAK: DJNZ R7,BAK
DJNZ R6,BAK1
RET
COMMAND1: MOV P2,A
CLR P3.4
SETB P3.5
ACALL DELAY
CLR P3.5
RET
DATA1 : MOV P2,A
SETB P3.4
SETB P3.5
ACALL DELAY
CLR P3.5
RET
DISPLAY: MOV A,P1
MOV B,#0AH
DIV AB
MOV R2,B
MOV B,#0AH
DIV AB
MOV R3,B
MOV R4,A 
MOV A,#08CH
ACALL COMMAND1
MOV A,#48
ORL A,R4
ACALL DATA1
MOV A,#48
ADD A,R3
ACALL DATA1
MOV A,#48
ADD A,R2
ACALL DATA1
RET
COMMANDN:DB 38H,0EH,01H,06H,80H,00H
DATAN :DB "TEMPERATURE: ",00H
END


For more ASM programs - click here

Popular posts from this blog