We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello EveryBody, I am working on LCD (16x2) and i have built some of my ideas about LCD programming but i am using Assembly language for my LCD, well as all things was going sweet so as every programmer is having something wrong ... (in starting) my problem specification is that i am using that LCD in 8-bit mode and i have connected my AT89C2051 (with some pull-ups) P1 DB P3.7 RS P3.5 RW P3.4 E and i have interfaced my LCD with my MCu but my problem is that i am getting the LCD not working ... (i dont know why) .... i have interfaced my LCD but there only little bit of contrast....i mean to say that there nothing visible... even i move my 10K-ohm-POT to the ground.....
and i have done some programming, so could any one please help me .... (i am really stucked) any help will be appritiatable.....
<code> ORG 0000H LJMP MAIN ORG 0030H RS EQU P3.7 RW EQU P3.5 EN EQU P3.4 MAIN: LCALL DELAY CLR EN MOV DPTR,#MYCOM LCALL LCD_INI MOV DPTR,#MYDATA LCALL LOOP MOV A,#0C9h LCALL COM LCALL DELAY MOV DPTR,#MYDAT2 LCALL LOOP AGAIN: SJMP AGAIN ;======================================== COM: MOV P1,A CLR RS CLR RW SETB EN LCALL DELAY CLR EN RET ;======================================== DATAW: MOV P1,A SETB RS CLR RW SETB EN LCALL DELAY CLR EN RET ;======================================== DELAY: MOV R6,#100 HERE2: MOV R7,#250 HERE: DJNZ R7,HERE DJNZ R6,HERE2 RET ;======================================== LCD_INI: CLR A MOVC A,@A+DPTR LCALL COM LCALL DELAY JZ GO_B1 INC DPTR SJMP LCD_INI GO_B1: RET ;======================================== LOOP: CLR A MOVC A,@A+DPTR LCALL DATAW LCALL DELAY INC DPTR JZ GO_B2 SJMP LOOP GO_B2: RET ;======================================== MYCOM: DB 38H,0EH,06,01,84H,0 MYDATA: DB "DAREDEVIL",0 MYDAT2: DB "GUNS AND ROSES",0 ;======================================== END </code>
Asif Ali "DareDevil"
Hello EveryBody and specially to sir Erik who have given me courage to complete my task, well sir Erik i have finally shown the String on my LCD (HD44780 16x4) and sir i am really thank full for your critisice type talkings (because it was really very helpfull for me) and for all of the members who have contributed in my post.
Well sir i was facing only hardware problem and it was that i was using P1.0 AND P1.1 (IN AT89C2051) with 10k pull up resistor so i was not gainig the much voltages so i have simple changed them with 1k and the matter was solved just like it was nothing...
Warning: That changing of resistor worked for me but i have heard that we can only use pull-ups between 1k-10k but if we decrease the resistance then its most likely that our pins or even our MCu will be hurt BADLY. so do pricise changing.
Well at the End i would like to show you my Code which actually worked. (atleast for me)
that is pure BALONEY. you can not discuss "pull-ups" without specifying the derivative.
This is simple math, you CAN (I am definiteley not saying you should) "decrease the resistance" till the chip draws Iol(max). Why use a lower resistance? simple: high capacity requires lower resistance. The much better solution is to reduce the capacitance and stay with a highre value resistor.
t changing of resistor worked for me makes me suspect that you have the LED on long wires. Do you?
Erik