PDA

View Full Version : LCD 2x40 NOT Writing !!!!!!



ager
- 6th August 2004, 14:45
Please Heelp!!
My dead time almost reached! please.
I am using 16f877 and 2x40 lcd. I send lcdout $fe,$1, "......"
and later using again lcdout $fe,$c0, "......". It is not writing my place. writes after first lcdout . mean first line. I want to use second line. I could not identified problem. Please help Me


please please sample code or help heeelp!!

Ager
[email protected]

NavMicroSystems
- 6th August 2004, 14:58
Ager,

try this:

LCDOUT $FE,1
LCDOUT "---------- This is Line 1 ----------"
LCDOUT $FE,40
LCDOUT "---------- This is Line 2 ----------"

on many 40xs Displays the start address of line 2 is $40
(see your LCDs DataSheet)

regards

ager
- 6th August 2004, 15:03
Hello my dear friend.
Last night I tried everything. did not help.
I tried lcdout $fe,$80,".......line 1....." and second line is
lcdout $fe,$C0,".......line 2....." or lcdout $fe,$40,".......line 2....." or lcdout $fe,40,".......line 2....." did not help.

Thanks
Ager

Dwayne
- 6th August 2004, 15:07
Hello Ager,

Ager>>lcdout $fe,$c0,"fdfsd"

Looks, good, Make SURE you are correct on your example...

LCDout $fe,$0c,"3434" Turns the cursor off!!!!! and if you write the exact same data on line to as line one, you will totally miss your error!


Use
LCDout $fe,$Co,"3434"

Notice the $co and the $oc !!!!!!


can you send us some "short" code that simulates the problem?

Can you use another program and get the same results?

Are you sure that your program is hitting this line of code?
(blink a LCD just before you impliment it.)
Are you sure you have defined your LCD as 2 lines?


Your LCD setup should look something like the following...(wiht different ports).

DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTA
DEFINE LCD_RSBIT 7
DEFINE LCD_EREG PORTA
DEFINE LCD_EBIT 0
DEFINE LCD_BITS 8
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50

Dwayne

ager
- 6th August 2004, 15:15
Hello Dwayne

No it was not my mistake. It was $co. But i am really try to short examples. I am sure will not help. I wish !

Regards

Ager

Dwayne
- 6th August 2004, 17:22
Hello Ager,

Then try the unobvious...Do you have another LCD to try?
and/or is the LCD compatible to PBP commands?

Dwayne

Dwayne

ager
- 8th August 2004, 16:03
Hello Dwayne
As i said I tried. not help. I send some part of my program for an example. Didnot work as i want.



Best regards
Ager

Melanie
- 8th August 2004, 16:17
1. It might help if you tell us the MAKE and MODEL number of the LCD you are using... or even better, give us a url link to it's Datasheet.

2. What PIC are you using?

3. What version of PICBasic are you using?

As a tip, if you have a LCD problem, it's best to strip out all other code and concentrate solely on the problem with the LCD. It saves confusion with lots of additional irrelevant code distracting you.

NavMicroSystems
- 8th August 2004, 16:42
Ager,

as Melanie said:

reduce your code to the absolute minimum you need for the test.

' Make sure the following DEFINEs match your hardware setup

' -- START OF CODE

DEFINE LOADER_USED 1
DEFINE OSC 10

DEFINE LCD_DREG PORTD
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTD
DEFINE LCD_RSBIT 1
DEFINE LCD_EREG PORTD
DEFINE LCD_EBIT 0

' The following code example is tested and works just fine on my Display

PAUSE 500
LCDOUT $FE,1
PAUSE 500
LCDOUT "------ This is Line 1 -----"

'** $C0 is ROW 2 COLUMN 1 on the LCD model I'm using
LCDOUT $FE,$C0
PAUSE 500
LCDOUT "------ This is Line 2 -----"

END

' -- END OF CODE


Just cut and paste this example into your Code Editor and give it a try.
If this doesn't help we would need the specs of your LCD

regards

Dwayne
- 9th August 2004, 16:51
Hello Ager,

Ager>>No it was not my mistake. It was $co. But i am really try to short examples. I am sure will not help. I wish !<<

Then do what Melanie says...Write *ONLY* a program that displays "Hello Line1" and "World Line 2".

It should be TOTALLy stripped down... NO other code. No AD's, no extra variables, no nothing... absolutely nothing but output to the LCD. (This is assuming your LCD *is* compatible to PBP).

Dwayne

ager
- 23rd August 2004, 11:28
Hello All

Sorry for late answering. Problem was me. I do not put any wait command to the program. I added more pause and worked.
Also LCD is INTECH 2x40.

Many thanks to all who interested with my problem.

Ager.