LCD and 16F877

Started by madajimmy May 29, 2002
Hi,

I need help.
I'm working in LCD display with PIC 16F877.
My project is displaying messages on 16x2 LCD (Hitachi HD44780) with
4 bit interface.
To make easy, I create a macro subroutine to send to the LCD.
It's no problem when I only send little message.
But...
I have 21 message to display.
Each message have 3 languages, and
Each message contains 16 characters long.
So. totaly I have 63 different messages.

Now I'm using a Table Read mothode, but still have some problem.
Not all the messages can be sent to the LCD. After message 27th can
not be sent.
I'm trying to change the code but still the same.

May be someone have the good ideas ?????

Thank you.



Hi!
When you are writing your source code you should take care of messages'
positions in program memory, since you have a jump instruction in table
read method. If you do not take care of it, program may jump some
unwanted addresses.
If you exceed one page to another you must load the proper page number
to PCLATH before calling to jump instruction. (I mean Out_String
function)
If you are familiar with MPLAB use it to find program memory locations
of your messages. If not see the list file which the assembler produces,
in 1st column you may find the program memory addresses.

As a second offer you wrote;
+
+ To make easy, I create a macro subroutine to send to the LCD.
+
Are you calling that macro after each message if so the thing you are
doing can be called waste of program memory. Use a subroutine instead of
macro, since macro repeats all of its body whenever you call it. And that
will occupy an important amount of program memory.

Finally follow this link.

http://technology.niagarac.on.ca/people/mcsele/TemperatureAlarm.htm

This application (which belongs to M.Csele from Niagara College Ontario)
will give you all important ideas of using an LCD and maintaining modular
subroutines for it. Please also note

org 100 at the starting of Strings and

movlw 1
movwf PCLATH at the starting of Outstring function

these 2 points is the issue which i mentioned as the first topic. See
also Outstring function you will understand what i mean by a modular
subroutine.

Hope one of these will help and I did not bore you with the topics you
already know.

--
Best Regards
Ghan CAN -----Original Message-----
From: "madajimmy" <>
To:
Date: Wed, 29 May 2002 06:11:15 -0000
Subject: [piclist] LCD and 16F877

> Hi,
>
> I need help.
> I'm working in LCD display with PIC 16F877.
> My project is displaying messages on 16x2 LCD (Hitachi HD44780) with
> 4 bit interface.
> To make easy, I create a macro subroutine to send to the LCD.
> It's no problem when I only send little message.
> But...
> I have 21 message to display.
> Each message have 3 languages, and
> Each message contains 16 characters long.
> So. totaly I have 63 different messages.
>
> Now I'm using a Table Read mothode, but still have some problem.
> Not all the messages can be sent to the LCD. After message 27th can
> not be sent.
> I'm trying to change the code but still the same.
>
> May be someone have the good ideas ?????
>
> Thank you.
>