LCDInfo.com

http://www.lcdinfo.com
It is currently Sat Dec 14, 2024 6:29

All times are UTC + 2 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Jan 12, 2012 10:54 
Offline

Joined: Thu Jan 12, 2012 9:34
Posts: 1
hi;
i want to display the following data on my lcd screen.

volts(V) Amps()
9.0 3.0

it is displaying on the proteous simulator well but when i tried it to disply practically on hardware it just displayd first line with second line blank :-(

i am using 89c52 microcontroller and JHD 162A LCD 16x2 display. i am using assembly to program it. Following is my code:

;..................program for LCD Display............................................................................................................
RS BIT P2.0
RW BIT P2.1
E BIT P2.2

ORG 00H

MAIN: MOV DPTR, #MYCOM

C1: CLR A
MOVC A,@A+DPTR
ACALL COMNWRT ; call command subroutien
ACALL DELAY ; GIVE LCD some time to process
INC DPTR
JZ SEND_DATA
SJMP C1

SEND_DATA: MOV DPTR,#MYDATA_1
D1: CLR A
MOVC A,@A+DPTR
ACALL DATAWRT ; Call data subroutien
ACALL DELAY
INC DPTR
JZ NEXT
SJMP D1


NEXT: MOV A,#06H ; i think problem is in this routine
CALL COMNWRT
CALL DELAY

MOV A,#0C2H
CALL COMNWRT
CALL DELAY


MOV A,#10011001B ;4,,,12V
CALL FORM_DATA


MOV A,#0C9H
CALL COMNWRT
CALL DELAY

MOV A,#01100110B; 1,,, 3A
CALL FORM_DATA


SJMP $


FORM_DATA: ; im skiping mathamatical manipulations here for simplicity.

DISPLAY: ADD A,#48 ; Convert data to ASCII codes and sent to lcd for display
MOV P0,A
CALL DATAWRT
CALL DELAY
RET


COMNWRT: MOV P0,A ;Send command to lcd
CLR RS ; RS=0 for command register
CLR RW ; R/W=0 for write
SETB E ; E=1 for high pulse
ACALL DELAY
CLR E ;E=0 FOR low pulse

RET


DATAWRT: MOV P0,A ;Copy data to port 1
SETB RS ; RS=1 For data register
CLR RW
SETB E
ACALL DELAY
CLR E
RET


MYCOM: DB 38H,0CH,01H,06H,80H,0 ; COMMANDS


MYDATA_1: DB "VOLTS(V) AMPS(A)"


DELAY: MOV R3,#50
HERE2: MOV R4,#255
HERE: DJNZ R4, HERE
DJNZ R3, HERE2

RET

i will be very thankfull to you for your help.

Regards
Qaisar Azeemi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group