Microcontroller › 8051 › please help › @dagakshay: ya colon
@dagakshay: ya colon sign(‘:’) is appearing…..i m pasting the code…plz hav a look….
;OBJECTIVE: TO MAKE A TEMPERATURE INDICATOR AND DISPLAY THE TEMPERATURE ON LCD
;TEMP_INDIC
;MICROCONTROLLER USED: AT89S52
;OTHER ICs USED: ADC0804
;
HARDWARE
;HARDWARE DECLARATION
LCDPORT EQU P0
ADCPORT EQU P1
READ EQU P3.0
WRITE EQU P3.1
INTR EQU P3.2
LCDRS EQU P3.3
LCDEN EQU P3.4
;
START
;START
ORG 0000H
LJMP POWERON
;INTERRUPT VECTOR TABLE
ORG 0003H
RETI
ORG 000BH
RETI
ORG 0013H
RETI
ORG 001BH
RETI
ORG 0023H
RETI
ORG 002BH
RETI
;
POWERON
ORG 0033H
POWERON: MOV SP,#70H
MOV P0,#0FFH
MOV P1,#0FFH
MOV P2,#0FFH
MOV P3,#0FFH
MOV IE,#00H
MOV IP,#00H
SETB READ
SETB WRITE
SETB INTR
ACALL LONGDELAY
ACALL INITIALIZE
ACALL DELAY
ACALL SENDMSG1
;
MAINLOOP
MAINLOOP:
CLR WRITE
ACALL SHORTDELAY
SETB WRITE
LB1: JB INTR,LB1
ACALL SHORTDELAY
CLR READ
MOV 30H,ADCPORT
SETB INTR
MOV A,30H
ACALL SENDDATA
SETB READ
ACALL SHORTDELAY
LJMP MAINLOOP
;
LCD INITIALIZATION
INITIALIZE:
MOV A,#01H ;CLEAR DISPLAY
ACALL SENDCMD
ACALL DELAY
MOV A,#02H ;CURSOR AT HOME POSITION
ACALL SENDCMD
ACALL DELAY
MOV A,#38H ;FUNCTION MODE SET
ACALL SENDCMD
ACALL DELAY
MOV A,#38H ;FUNCTION MODE SET
ACALL SENDCMD
ACALL DELAY
MOV A,#38H ;FUNCTION MODE SET
ACALL SENDCMD
ACALL DELAY
MOV A,#06H ;ENTRY MODE SET
ACALL SENDCMD
ACALL DELAY
MOV A,#0EH ;DISPLAY ON/OFF
ACALL SENDCMD
ACALL DELAY
MOV A,#01H ;CLEAR DISPLAY
ACALL SENDCMD
ACALL DELAY
MOV A,#02H ;CURSOR AT HOME POSITION
ACALL SENDCMD
ACALL DELAY
RET
;
MESSAGE 1
CODE: DB ‘TEMPERATURE:’
SENDMSG1:
MOV DPTR,#CODE
MOV R0,#12D
MOV R1,#0D
LB2: MOV A,R1
MOVC A,@A+DPTR
ACALL SENDDATA
ACALL DELAY
INC R1
DJNZ R0,LB2
RET
;
CODE FOR SENDING COMMAND TO LCD
SENDCMD:
CLR LCDRS
MOV LCDPORT,A
SETB LCDEN ;A HIGH->LOW PULSE AT LCDEN
ACALL DELAY
CLR LCDEN
ACALL DELAY
SETB LCDRS
RET
;
CODE FOR SENDIND DATA TO LCD
SENDDATA:
SETB LCDRS
MOV LCDPORT,A
SETB LCDEN
ACALL DELAY
CLR LCDEN
ACALL DELAY
CLR LCDRS
RET
;
TIME DELAYS
DELAY:
MOV R2,#20D
LB3: MOV R3,#250D
LB4: DJNZ R3,LB4
DJNZ R2,LB3
RET
SHORTDELAY:
MOV R4,#50D
LB5: DJNZ R4,LB5
RET
LONGDELAY:
MOV R5,#10D
LB6: MOV R6,#100D
LB7: MOV R7,#150D
LB8: DJNZ R7,LB8
DJNZ R6,LB7
DJNZ R5,LB6
RET
END