Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Temperature display on LCD

Status
Not open for further replies.

chaudhary

Newbie level 6
Joined
Jul 16, 2010
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
pakistan
Activity points
1,341
yar please help me im doin project on displaying real time temperater on LCD

components are:
LM35
ADC0804
89C51 (code must be in assembly)
LCD
[/b]
 

a file has been attach.. i have made the circuit and has the assembly code but the temperture has not been display on LCD.. any1 please check and help me... sorry for my poor english...
 

here is my code.

Code:
$NOMOD51
$INCLUDE (89S52.MCU)

;	(C) 	[url]www.free8051projects.blogspot.com[/url]
;		welove8051.com

RS 			EQU 	P1.0
RW 			EQU 	P1.1
EN 			EQU 	P1.2
BUSY 			BIT 	P0.7
DAT			EQU	P0
ADCSTART		EQU	P3.7
ADCDATA			EQU	P2

ORG 0H


MAIN:
	CALL INIT
	CALL LINIT
	MOV DPTR,#MES1
	CALL MESSDISP
	CALL SLINE
	MOV DPTR,#MES2
	CALL MESSDISP
	CALL DELAY
	CALL DELAY
AGAIN:	CALL CLEARS
	MOV DPTR,#MES3
	CALL MESSDISP
	MOV A,P2
	MOV B,#100
	DIV AB
	CALL ASCII
	MOV A,B
	MOV B,#10
	DIV AB
	CALL ASCII
	MOV A,B
	CALL ASCII
	CALL DELAY
	JMP AGAIN


INIT:
	CLR ADCSTART
	CALL DEL
	SETB ADCSTART
RET

ASCII:
	ADD A,#30H
	CALL DATAWRT
RET

LINIT:	
	CLR RW
	MOV A,#38H      ;LCD 2 LINES
	CALL COMNWRT
	
        CALL CLEARS
	CALL SLINE
        
        MOV A,#0CH 	;DISPLAY ON CURSOR ON
	CALL COMNWRT
	
        MOV A,#6H 	;SHIFT CURSOR RIGHT
	CALL COMNWRT
FLINE:	
	MOV A,#80H      ;SEND FIRST LINE ADDRESS
        CALL COMNWRT
RET

SLINE:
	MOV A,#0C0H      ;SEND FIRST LINE ADDRESS
        CALL COMNWRT
RET
CLEARS:
	MOV A,#01H 	;CLEAR DISPLAY
	CALL COMNWRT
RET
	
COMNWRT:
	CALL READY
       	MOV  DAT,A
       	CLR  RS
       	SETB EN
       	CLR  EN
RET

DATAWRT:
	CALL READY
       	MOV  DAT,A
       	SETB RS
       	SETB EN
       	CLR  EN
RET
       
READY:
	SETB BUSY
	SETB RW
	CLR RS
C1:
	CLR EN
	NOP
	NOP
	SETB EN
	JB BUSY,C1
	CLR RW
RET

MESSDISP:
	D1:CLR A
	MOVC A,@A+DPTR
	CJNE A,#0FFH,CONT
RET
CONT:
	CALL DATAWRT
	INC DPTR
SJMP D1

DELAY:
        MOV R7,#10D
	L2: MOV R6,#100D
L1:
	CALL DEL
	DJNZ R6,L1
	DJNZ R7,L2
RET
 
DEL:
	CLR CPRL2
	CLR CT2
	MOV TL2,#7CH
	MOV TH2,#0FCH	
	SETB TR2
	JNB TF2,$
	CLR TR2
	CLR TF2
RET;

MES1:	DB	"   DIGITAL ",255
MES2:	DB	"THERMOMETER",255
MES3:	DB	"TEMPERATURE:",255

END
 

the code u have post dosnt work either.. plz help me, im pasing from severe time
 

this is 100% working code. did u get any display in ur lcd. check for the right connection for rs, rw and en pin. use 89s52 or c52
 

soryy buddy it is not working.. i hav check my pins which u have told me.. will u please dowload my attach file and check it & tell me soon..
 

Dude...the very 1st thing u should do is to initialise the LCD properly...It might happen that the rest of the code is perfect but the result is just not getting displayed...so 1st try priting simple text over the LCD without any other functions being performed...And if it works...implement LCD routines in ur main program...Regards..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top