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.

LCD Problem with Proteus ?

Status
Not open for further replies.

SphinX

Advanced Member level 3
Joined
Jan 25, 2002
Messages
822
Helped
58
Reputation
116
Reaction score
29
Trophy points
1,308
Location
EGYPT
Activity points
7,045
lm016l lcd

Salam,

I use LM016L LCD Module in proteus and this LCD driver code.

The code works fine for write something in the first row only.
The code works fine in row1 and row2 in the real test.

Why is the ROW2 is not work in Proteus?

Thanks
 

hd44780 proteus

This is because most od LCD modules are very sensitive to timing of initialization procedure. I guess, Proteus guys just tried to reflect it in their LCD model. I also had some problems like yours with real LCD modules - sometime after initialization by uC it turns on in 1-line mode, sometime - in 2-lines mode. From my experience, here is the best initialization procedure:
LCD RS = 0
Delay 15 ms
LCD DATA = 3
LCD Strobe
Delay 5 ms
LCD Strobe
Delay 100 us
LCD Strobe
Delay 5 ms
LCD Write Command 0x38
...

You can use HW timer or posted somewhere here in forum program to calculate 8051 delay with usual loops.

Good luck!

Ace-X.
 

lcd lm016l

Salam,

Here is the file contain the .DSN and Keil source code with hex file.

As i said before the code works fine in my test board.
But in proteus the Row 0 works only.

Thanks
 

lm016l command

SphinX

It is surprising to hear that your application works fine with your test board ! It shouldn't.

Into the function here below you did compute a character position by using row and column. That's fine.
But in LM016L the 2nd row starts to base offset 40h (hexadecimal) not to 40 (decimal) as you provided, and that's wrong !

void GotoXY(BYTE r, BYTE c) {

RS=0;
DATA_BUS=0x02; EnableLCD(255);
for(r=r*40+c, c=0; c<r; c++)
DATA_BUS = 0x14, EnableLCD(45);
RS=1;

}

Hence, you must replace the for statement with this :

for(r=r* 0x40 +c, c=0; c<r; c++)

or this one still works

for(r=r* 0xc0 +c, c=0; c<r; c++)

and 2nd row will be used as usual.

Then, don't under estimate what Ace-X says about LCD timing.
You make use of delay routine within LCD initializing (EnableLCD). That's fine again. But when LCD has been initialized, rather than use delay, I advise that you read the LCD's BUSY flag before send any valid character.
You may have to read HD44780 datasheet.

Only to help you.
Cu
 

proteus эмуляция lm016l

Salam copper,

THANKS VERY MUCH FOR YOUR IMPORTANT NOTICE !
I noticed you are beginner here so donated you with extra 20 points ! :)

But i don't use LM016L LCD Module.
I use LCD Compatible with HD44780.

I thought LM016L is the same.

I will test your modification tomrrow, and i'm sure it will work.

Finally, Why this code works fine with my LCD !

SphinX
 

lcd lm016l

Salam SphinX

You are very kind. Thank you. I will do good use with these. :)

There are many alphanumeric controllers which many manufactures claim to be fully compatible with Hitachi HD44780. Futaba, Samsung and many others have designed quite cheaps controllers to face with increasing LCD manufacturers demands when genuine HD44780s have been not available anymore.

I think the reason the code works fine with your LCD might be the controller is not fully compatible.

You may want to look at this link which reports some controllers datasheets.

**broken link removed**


Cu
 

Re: hd44780 proteus

Ace-X said:
This is because most od LCD modules are very sensitive to timing of initialization procedure. I guess, Proteus guys just tried to reflect it in their LCD model. I also had some problems like yours with real LCD modules - sometime after initialization by uC it turns on in 1-line mode, sometime - in 2-lines mode. From my experience, here is the best initialization procedure:
LCD RS = 0
Delay 15 ms
LCD DATA = 3
LCD Strobe
Delay 5 ms
LCD Strobe
Delay 100 us
LCD Strobe
Delay 5 ms
LCD Write Command 0x38
...

You can use HW timer or posted somewhere here in forum program to calculate 8051 delay with usual loops.

Good luck!

Ace-X.


Thanks.

Timing delays works fine for me, in the lcd writing routines..

Best regards
 

Salam,

I use LM016L LCD Module in proteus and this LCD driver code.

The code works fine for write something in the first row only.
The code works fine in row1 and row2 in the real test.

Why is the ROW2 is not work in Proteus?

Thanks



The rest of the answers was all wrong about row2 in the case of LM016L.
You can also jump to the 2nd line in Proteus, but the LCD-intialization's settings must be correct. Now, if everything is alright, you can switch on the display.
So,here are the instructions. Try this:

$3C (here RS=0, instruction mode), $F0 (here RS=0, instruction mode), $C0 (here RS=1, data set mode).

$3C-Sets interface data lengthk(DL), number of display lines(N), and character font (F) -see more in HD44780 datasheet.
$F0-Sets entire display (D) on/off, cursor on/off (C), and blinking of cursor position character (B) -see more in HD44780 datasheet.
$C0-jump to next line (address $80+$40=$C0) -see more in HD44780 datasheet.

Tested, and 100% works fine!
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top