LCDInfo.com http://forum.lcdinfo.com/ |
|
data not displaying in second line of 16X2 lcd http://forum.lcdinfo.com/viewtopic.php?f=9&t=10010 |
Page 1 of 1 |
Author: | Qaisar Azeemi [ Thu Jan 12, 2012 10:54 ] |
Post subject: | data not displaying in second line of 16X2 lcd |
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 |
Page 1 of 1 | All times are UTC + 2 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |