Maker Pro
Maker Pro

LCD for pic 16F876

A

Ahmed Samir

Jan 1, 1970
0
Hi there

i built this temprature sensor using pic876,and i would like to add an LCD
to it
is there any header file available i can include that gives functions to
control the lcd-initialize, type ...etc.

i have port b still free for the lcd

thanks
ahmdsamir
 
A

A E

Jan 1, 1970
0
Ahmed said:
Hi there

i built this temprature sensor using pic876,and i would like to add an LCD
to it
is there any header file available i can include that gives functions to
control the lcd-initialize, type ...etc.

i have port b still free for the lcd

thanks
ahmdsamir

What type of LCD? I'm sure you mean a module that you send high level data to,
but there are also 'raw' panels that you drive each segment yourself. There are
many types of interfaces. You can even get a module with serial access.
I have a project using an old parallel Epson 16 char display. It's very simple
to write your own routines.
I'll email you my code and schematic if you want it. (to give you an idea)
 
W

Wouter van Ooijen

Jan 1, 1970
0
i built this temprature sensor using pic876,and i would like to add an LCD
to it
is there any header file available i can include that gives functions to
control the lcd-initialize, type ...etc.

Did you browse www.piclist.com ? don't do anything with PICs without
it...

My Jal compiler (GPL!) comes with a HD44780 library...


Wouter van Ooijen

-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting
 
S

Spehro Pefhany

Jan 1, 1970
0
i was talking about the HITACHI HD44780

A PIC connected to an HD44780 (or Samsung equivalent)-based module?

Google is your friend. You can find lots of examples, though I can't
speak for how good they are. If it's a commercial project I strongly
suggest (re)writing it from scratch using the chip data sheet. If you
do that, follow the initialization instructions to the letter, many
people get in trouble there.

You can use 4-bit mode. Don't forget to put a pot on the contrast
input.

Best regards,
Spehro Pefhany
 
M

Michael

Jan 1, 1970
0
I second Wouter van Ooijen's suggestion: check the PICLIST.
Also, Myke Predko did a nifty 1-wire interface for LCDs; I've used it in
several projects where my 16F628 was low on I/O pins.
 
S

Spehro Pefhany

Jan 1, 1970
0
Another gotcha to look out for is if using LCDs with two lines. I had a
bunch of code already written up for single line versions that I knew worked.
All I did was configure the display for two lines and it goes blank.

After much stuffing around, I found the _contrast_ changes when switching
from the default one line mode, to two line mode.

Then I had to go back to find out what part of the code I _broke_ in the
futile attempt to fix it.

Many of them, such as the common 2 x 16 panels have an "interesting"
"hole" in memory; you have to jump to 0x40 (IIRC) to get to the first
character of the second line.

Best regards,
Spehro Pefhany
 
J

John Tserkezis

Jan 1, 1970
0
Spehro said:
Many of them, such as the common 2 x 16 panels have an "interesting"
"hole" in memory; you have to jump to 0x40 (IIRC) to get to the first
character of the second line.

The HD44780 has built in support for 40 character wide displays, is that 0x40
you're thinking of not 0x28 (40 decimal)? I haven't played with them for a
while, can't remember if the address continues directly to the next line or not.

In any case, if you were to write characters in memory, you'll eventually get
to the next line.
 
S

Spehro Pefhany

Jan 1, 1970
0
The HD44780 has built in support for 40 character wide displays, is that 0x40
you're thinking of not 0x28 (40 decimal)?

Yes, that's right.
I haven't played with them for a
while, can't remember if the address continues directly to the next line or not.

The basic chip has support for two lines and the second line usually
starts at 40 regardless of how many characters actually are in each
line. IIRC, there are some single line ones where the second half of
the SINGLE line is connected so it starts at 40 too.
In any case, if you were to write characters in memory, you'll eventually get
to the next line.

For some reason it seems to confuse people, as I've seen the question
too many times. As does the initialization sequence, which is a bit
complex. If you follow the data sheet religiously including timing and
initialization, all will be well.

There are MANY web pages on this, here's one:
http://home.iae.nl/users/pouweha/lcd/lcd.shtml
I've not tested the code from this (or any other) web page.

Best regards,
Spehro Pefhany
 
Top