In a message dated 9/2/01 5:08:59 PM Central Daylight Time, veewee77@a... writes:
> Here is some code. I can get the display to show 8 characters and
> no more. What is the 'key' to making the display usable?
>
> The code I gave you displays the word "Parallax". I can get
> spaces, and several other characters to display.
> How can I clear the screen and display another set of characters.
>
>
(Once again, let me recommend that you download the StampWorks LCD
experiments. It will save you a lot of time and frustration.)
As far as only being able to display eight characters, this means you have a
2-line display that is physically configured as a 1-line display. These
displays are cheap but a big pain. What you need to do is move the DDRAM
pointer to position 1 of line 2 to continue writing on that line.
Note: You cannot scroll this type of display cleanly and -- as you've seen --
writing across the line break is a hassle. With planning, you can avoid the
line break.
-- Jon Williams
-- Applications Engineer, Parallax
[noparse][[/noparse]Non-text portions of this message have been removed]
I have no documentation for the display. the 8 characters go half
way across the display. I will look at the sites you mention, and re-
examine the StampWorks experiments mentioned by another.
Doug
On 2 Sep 2001, at 15:37, S Parkis wrote:
> Looks like you're making progress. I suspect the key now is to dig
> deeply into the documentation for your particular LCD. Or maybe find
> some and then dig into it. They don't all work exactly alike, despite
> having the HD44780 controller in common.
>
> To clear your display, use again the "clear screen" code shown at the
> bottom of the initialization. Note you must send the command as a
> command vice character, by manipulating the RS pin. Your
> documentation should be useful to make further sense out of all this
> and the other commands available to you.
>
> I don't see why you are running into an 8-character barrier. Maybe
> something specific to your LCD (8 positions wide?).
>
> If you have trouble finding a data sheet or whatever for your LCD
> module, perhaps others can help if you post a detailed description
> (manufacturer, model #, etc.). You may also find this site useful:
>
> http://home.iae.nl/users/pouweha/lcd/lcd.shtml
>
> Lots and lots of generic HD44780 info and code examples.
>
>
> Regards,
>
> Steve
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
Typically pin 1 will be marked with a number one, *or* have a square solder
pad versus a round one.
Following the traces will only work on SMT chips, not the glob-top chips
used on the cheaper displays.
Original Message
> Try this, it's about as stripped down as I can get it. You should
> see a blank display with blinking cursor for about 5 seconds, then
> the letter 'A' should appear. Works fine with my BS2SX and 4x20
> Optrex LCD. Add complexity when you get this working.
>
> Regarding your module pin numbering, look closely (on both sides)
> for a '1' or '14' at either end of the row of pins. If that doesn't
> pan out, try to follow the PCB traces from what you suspect are pins
> 9 through 14--they should go to consecutive pins located along the
> top edge of your HD44780, as viewed looking at the (correctly oriented)
> printing on the top of the chip. Connector pins 4 thru 7 go to
> consecutive HD44780 pins along the right edge of the chip.
>
> Make sure your Stamp's and module's grounds are connected. You can
> simply connect module pin 3 to ground to get max contrast and do
> away with the pot. Make sure module pins 1 and 5 are also connected to
> ground, and pin 2 is connected to +5V. The RS and E connections are
> as shown below.
>
> I hope that helps get you going.
>
> Regards,
>
> Steve
>
> '{$STAMP BS2sx}
> ' __________
> ' SER TX <-| 1 24 |-- PWR
> ' SER RX ->| 2 23 |-- GND
> ' SER ATN ->| 3 22 |-- RESET
> ' SER GND --| 4 21 |-- +5V
> ' lcd d4 I/O 0 <-| 5 20 |--
> ' lcd d5 I/O 1 <-| 6 19 |--
> ' lcd d6 I/O 2 <-| 7 18 |--
> ' lcd d7 I/O 3 <-| 8 17 |--
> ' RS I/O 4 <-| 9 16 |--
> ' E I/O 5 <-| 10 15 |--
> ' I/O 6 --| 11 14 |--
> ' I/O 7 --| 12 13 |--
> ' |__________|
> '
> ' BS2-IC
>
> OUTS = %0000000000100000
> DIRS = %0000000000111111
>
> lcd_rs CON 4
> lcd_en CON 5
>
> PAUSE 100
> OUTA = %0011
> PULSOUT lcd_en,1: PAUSE 2
> PULSOUT lcd_en,1: PAUSE 2
> PULSOUT lcd_en,1: PAUSE 2
>
> OUTA = %0010 : PULSOUT lcd_en,1: PAUSE 2 '4-bit mode
>
> OUTA = %0000 : PULSOUT lcd_en,1: PAUSE 2 'display on, visible+blinking
cursor
> OUTA = %1111 : PULSOUT lcd_en,1: PAUSE 2
>
> OUTA = %0000 : PULSOUT lcd_en,1: PAUSE 2 'cursor adv right, shift not
> OUTA = %0110 : PULSOUT lcd_en,1: PAUSE 2
>
> OUTA = %0000 : PULSOUT lcd_en,1: PAUSE 2 'clear screen, allow extra time
to complete
> OUTA = %0001 : PULSOUT lcd_en,1: PAUSE 5
>
> HIGH lcd_rs ' subsequent data will be characters
>
> main:
> PAUSE 5000
> OUTA = "A" >> 4: PULSOUT lcd_en, 1
> OUTA = "A": PULSOUT lcd_en, 1
> STOP
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
Hmm... the cheapy 1 x 16 displays I got from MPJA had to be treated as 2 x 8
displays. The way I found out was to keep sending characters to the display
and count how many are sent and not shown between the 8th and 9th character.
Original Message
> I have no documentation for the display. the 8 characters go half
> way across the display. I will look at the sites you mention, and re-
> examine the StampWorks experiments mentioned by another.
> > Looks like you're making progress. I suspect the key now is to dig
> > deeply into the documentation for your particular LCD. Or maybe find
> > some and then dig into it. They don't all work exactly alike, despite
> > having the HD44780 controller in common.
> >
I got the code from the StampWorks Project #11 which is the LCD
project, but it won't run properly. Looking through the code, there
are variables that are defined at the beginning but never used
elsewhere, and some that appear to be wrong. The display fills
with black squares instead of characters.
what would the line:
lcdout var outb
do? outb is never seen anywhere else in the program. It is never
defined anywhere else in the program.
Incidentally, I am getting nowhere with this display thing.
Sounds to me like your display contrast is wrong. You need to check the
documentation to see if the contrast adjustment is connected between +5 and
ground or just ground.
Original Message
> I got the code from the StampWorks Project #11 which is the LCD
> project, but it won't run properly. Looking through the code, there
> are variables that are defined at the beginning but never used
> elsewhere, and some that appear to be wrong. The display fills
> with black squares instead of characters.
>
> what would the line:
> lcdout var outb
> do? outb is never seen anywhere else in the program. It is never
> defined anywhere else in the program.
>
> Incidentally, I am getting nowhere with this display thing.
In a message dated 9/4/01 6:52:46 AM Central Daylight Time, veewee77@a... writes:
> I got the code from the StampWorks Project #11 which is the LCD
> project, but it won't run properly. Looking through the code, there
> are variables that are defined at the beginning but never used
> elsewhere, and some that appear to be wrong. The display fills
> with black squares instead of characters.
...Let's be clear: it won't run properly on YOUR project -- probably due to
a wiring error. The StampWorks 1.1 LCD projects use the same wiring
scheme as the BS2p:
Be sure you have a contrast pot (usually 10k) with the wiper connected to LCD
pin 3.
> what would the line:
> lcdout var outb
> do? outb is never seen anywhere else in the program. It is never
> defined anywhere else in the program.
The line "LCDout VAR OutB" aliases (renames) the Stamp's OutB variable. OutB
corresponds to pin 4 - 7 (where the LCD data bus is connected). If you look
through the listing, you'll see many places where it says "LCDout =". Why
did I do this? "OutB =" has little meaning (other than I'm setting some
output bits) -- except to the programmer. I try to write programs that are
easy to read and modify, so "LCDout =" tells me what is going on.
> Incidentally, I am getting nowhere with this display thing.
>
>
Don't get frustrated...it gets easier as you go along. Perhaps you should
download the whole StampWorks book and read the introductory section on
PBASIC programming. Scott Edwards and Al Williams (no relation) also have
good books on PBASIC.
-- Jon Williams
-- Applications Engineer, Parallax
-- Author of "StampWorks"
[noparse][[/noparse]Non-text portions of this message have been removed]
Finally got the display to work, but the stampworks #11 thing still
won't work. The contrast is ok with other programs.
I'll keep plugging away at it. . .
Doug
On 4 Sep 2001, at 7:06, Rodent wrote:
> Sounds to me like your display contrast is wrong. You need to check
> the documentation to see if the contrast adjustment is connected
> between +5 and ground or just ground.
>
>
Original Message
>
> > I got the code from the StampWorks Project #11 which is the LCD
> > project, but it won't run properly. Looking through the code, there
> > are variables that are defined at the beginning but never used
> > elsewhere, and some that appear to be wrong. The display fills with
> > black squares instead of characters.
> >
> > what would the line:
> > lcdout var outb
> > do? outb is never seen anywhere else in the program. It is never
> > defined anywhere else in the program.
> >
> > Incidentally, I am getting nowhere with this display thing.
>
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
If its a two-line display, you have to initialize it properly -- they
apparently default to a 1-line display. The Stampworks article I remember
for the LCD was a 1-line, was it not?
When I was messing with a display here, I adjusted the contrast for one
line -- when I figured out how to set it for 2 lines, the display contrast
changed radically.
Original Message
> Finally got the display to work, but the stampworks #11 thing still
> won't work. The contrast is ok with other programs.
> > Sounds to me like your display contrast is wrong. You need to check
> > the documentation to see if the contrast adjustment is connected
> > between +5 and ground or just ground.
> >
> >
Original Message
> >
> > > I got the code from the StampWorks Project #11 which is the LCD
> > > project, but it won't run properly. Looking through the code, there
> > > are variables that are defined at the beginning but never used
> > > elsewhere, and some that appear to be wrong. The display fills with
> > > black squares instead of characters.
> > >
> > > what would the line:
> > > lcdout var outb
> > > do? outb is never seen anywhere else in the program. It is never
> > > defined anywhere else in the program.
> > >
> > > Incidentally, I am getting nowhere with this display thing.
In a message dated 9/6/01 7:28:18 AM Central Daylight Time, daweasel@s... writes:
> If its a two-line display, you have to initialize it properly -- they
> apparently default to a 1-line display. The Stampworks article I remember
> for the LCD was a 1-line, was it not?
>
> When I was messing with a display here, I adjusted the contrast for one
> line -- when I figured out how to set it for 2 lines, the display contrast
>
StampWorks Experiment 11 initializes the LCD for a single line. With LCDs
that are using two lines physically stacked as one, this program won't quite
work (characters on the right side won't show up). And yes, there is a
dramatic difference in display contrast between single-line and multi-line
modes (due to the number of pixels that have to be multiplexed). This is why
it's always a good idea to use a contrast pot instead of grounding pin 3 of
the LCD.
-- Jon Williams
[noparse][[/noparse]Non-text portions of this message have been removed]
> In a message dated 9/6/01 7:28:18 AM Central Daylight Time,
> daweasel@s... writes:
>
>
> > If its a two-line display, you have to initialize it properly --
> > they apparently default to a 1-line display. The Stampworks article
> > I remember for the LCD was a 1-line, was it not?
> >
> > When I was messing with a display here, I adjusted the contrast for
> > one line -- when I figured out how to set it for 2 lines, the
> > display contrast
> >
>
> StampWorks Experiment 11 initializes the LCD for a single line. With
> LCDs that are using two lines physically stacked as one, this program
> won't quite work (characters on the right side won't show up). And
> yes, there is a dramatic difference in display contrast between
> single-line and multi-line modes (due to the number of pixels that
> have to be multiplexed). This is why it's always a good idea to use a
> contrast pot instead of grounding pin 3 of the LCD.
>
> -- Jon Williams
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
> In a message dated 9/6/01 7:28:18 AM Central Daylight Time,
> daweasel@s... writes:
>
>
> > If its a two-line display, you have to initialize it properly --
> > they apparently default to a 1-line display. The Stampworks article
> > I remember for the LCD was a 1-line, was it not?
> >
> > When I was messing with a display here, I adjusted the contrast for
> > one line -- when I figured out how to set it for 2 lines, the
> > display contrast
> >
>
> StampWorks Experiment 11 initializes the LCD for a single line. With
> LCDs that are using two lines physically stacked as one, this program
> won't quite work (characters on the right side won't show up). And
> yes, there is a dramatic difference in display contrast between
> single-line and multi-line modes (due to the number of pixels that
> have to be multiplexed). This is why it's always a good idea to use a
> contrast pot instead of grounding pin 3 of the LCD.
>
> -- Jon Williams
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
In a message dated 9/6/01 3:58:48 PM Central Daylight Time, veewee77@a... writes:
> So how can I initialize it for two lines? It appears that the display
> only has one line.
There are displays that are PHYSICALLY configured as a single line, but
actually work as a two-line display. The logic for this escapes me, yet it
exists. Here's some multi-line intialization code for a BS2p:
With the display off, you should be able to see two faint rows of blocks if
you hold the display just right and look across it.
The documentation for the display should tell you what code to send to it
for that. I messed with mine a great while and finally figured it out.
Unfortunately, I tore down the circuit and don't have access to the code
right now.
Original Message
> So how can I initialize it for two lines? It appears that the display
> only has one line. I could be mistaken though. . .
> > > If its a two-line display, you have to initialize it properly --
> > > they apparently default to a 1-line display. The Stampworks article
> > > I remember for the LCD was a 1-line, was it not?
> > >
> > > When I was messing with a display here, I adjusted the contrast for
> > > one line -- when I figured out how to set it for 2 lines, the
> > > display contrast
I can only see one line of blocks. And the characters only go
halfway across the display. There are 16 blocks, but only 8 ever
show anything.
Doug
On 6 Sep 2001, at 17:13, Rodent wrote:
> With the display off, you should be able to see two faint rows of
> blocks if you hold the display just right and look across it.
>
> The documentation for the display should tell you what code to send to
> it for that. I messed with mine a great while and finally figured it
> out. Unfortunately, I tore down the circuit and don't have access to
> the code right now.
>
>
Original Message
>
>
>
> > So how can I initialize it for two lines? It appears that the
> > display only has one line. I could be mistaken though. . .
>
> > > > If its a two-line display, you have to initialize it properly --
> > > > they apparently default to a 1-line display. The Stampworks
> > > > article I remember for the LCD was a 1-line, was it not?
> > > >
> > > > When I was messing with a display here, I adjusted the contrast
> > > > for one line -- when I figured out how to set it for 2 lines,
> > > > the display contrast
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
In a message dated 9/6/01 8:04:18 PM Central Daylight Time, veewee77@a... writes:
> I can only see one line of blocks. And the characters only go
> halfway across the display. There are 16 blocks, but only 8 ever
>
This is confirmation that you -- in fact -- have a two-line display that is
physically configured as one line. You need to use the multi-line
initialization sequence and when writing to the right half of the display,
you need to address it as line 2.
-- Jon Williams
[noparse][[/noparse]Non-text portions of this message have been removed]
> In a message dated 9/6/01 3:59:43 PM Central Daylight Time,
> veewee77@a... writes:
>
>
> > If this is a two-line display, the characters will be very small in
> > two
> >
>
> No, they won't. In those displays, the left-most characters (usually
> 8) are on line one, and the right-most characters are on line 2.
>
> So...to put a character in the ninth position in the display, you
> actually put it into the first position of line 2.
>
> Goofy, I know. This is just how these (cheap) displays work. It's
> best to avoid them, especially if you want to scroll the display.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
>
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
I did try that code for two lines but still only get 8 characters. On
the left. . .
I probably need to just find a better display, huh?
One more question. I have a sonar module, and run a program that
displays (in inches) via debug. What would I need to do to make it
display the inches on the LCD? (I think I can figure out how to put
the word "inches" on 'line two' (right side of display)and make it
stay there. . .and put the number on the left. How do I define what
is displayed, then display it?
Thanks for everything, and I'll try to not bother you much more on
this.
> In a message dated 9/6/01 3:58:48 PM Central Daylight Time,
> veewee77@a... writes:
>
>
> > So how can I initialize it for two lines? It appears that the
> > display only has one line.
>
> There are displays that are PHYSICALLY configured as a single line,
> but actually work as a two-line display. The logic for this escapes
> me, yet it exists. Here's some multi-line intialization code for a
> BS2p:
>
> Initialize:
> PAUSE 500 ' let the LCD settle
> LCDCMD LCDpin,%00110000 : PAUSE 5 ' 8-bit mode LCDCMD
> LCDpin,%00110000 : PAUSE 0 LCDCMD LCDpin,%00110000 : PAUSE 0 LCDCMD
> LCDpin,%00100000 : PAUSE 0 ' 4-bit mode LCDCMD LCDpin,%00101000
> : PAUSE 0 ' 2-line mode LCDCMD LCDpin,%00001100 : PAUSE 0 '
> no crsr, no blink LCDCMD LCDpin,%00000110 ' inc crsr, no
> disp shift
>
> Note the line that is commented "2-line" mode. This is what you need
> to add to the "normal" initialization sequence to make it multi-line.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
The bit that's probably confusing is that a 1x16 LCD is physically one line,
but the LCD controller handles it as though it was a 2x8 line display.
Here's the bit you need to know to get all 16 characters working:
- The first 8 characters are mapped to line 1 (CGRAM 0h - 7h)
- The second 8 characters are mapped to line 2 (CGRAM 40h - 47h).
This isn't mis-typed - it really is 40h - 47h. In other words, the
controller thinks each line is 64 characters long!! It makes life difficult
to write to the display, because you now have to know whether you're about
to move from character 8 to character 9. If so, you need to advance the
cursor from 8h (where the ninth char should be) to 40h (where the ninth char
actually is).
Hope this helps - this is the result of many, many frustrating hours!!!
>From: jonwms@a...
>Reply-To: basicstamps@yahoogroups.com
>To: basicstamps@yahoogroups.com
>Subject: Re: [noparse][[/noparse]basicstamps] LCD
>Date: Thu, 6 Sep 2001 18:04:48 EDT
>
>In a message dated 9/6/01 3:59:43 PM Central Daylight Time,
>veewee77@a... writes:
>
>
> > If this is a two-line display, the characters will be very small in two
> >
>
>No, they won't. In those displays, the left-most characters (usually 8)
>are
>on line one, and the right-most characters are on line 2.
>
>So...to put a character in the ninth position in the display, you actually
>put it into the first position of line 2.
>
>Goofy, I know. This is just how these (cheap) displays work. It's best to
>avoid them, especially if you want to scroll the display.
>
>-- Jon Williams
>-- Applications Engineer, Parallax
>
>
>
>
>[noparse][[/noparse]Non-text portions of this message have been removed]
>
>
>To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
>from the same email address that you subscribed. Text in the Subject and
>Body of the message will be ignored.
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
That information is correct -- except that the display is mapped to DDRAM.
CGRAM is used to store custom characters.
In a message dated 9/6/01 8:23:50 PM Central Daylight Time, ristone64@h... writes:
> The bit that's probably confusing is that a 1x16 LCD is physically one line,
> but the LCD controller handles it as though it was a 2x8 line display.
>
> Here's the bit you need to know to get all 16 characters working:
>
> - The first 8 characters are mapped to line 1 (CGRAM 0h - 7h)
> - The second 8 characters are mapped to line 2 (CGRAM 40h - 47h).
>
> This isn't mis-typed - it really is 40h - 47h. In other words, the
> controller thinks each line is 64 characters long!! It makes life difficult
> to write to the display, because you now have to know whether you're about
> to move from character 8 to character 9. If so, you need to advance the
> cursor from 8h (where the ninth char should be) to 40h (where the ninth
> char
> actually is).
>
> Hope this helps - this is the result of many, many frustrating hours!!!
>
[noparse][[/noparse]Non-text portions of this message have been removed]
In a message dated 9/6/01 8:22:23 PM Central Daylight Time, veewee77@a... writes:
> I did try that code for two lines but still only get 8 characters. On
> the left. . .
You need to set the address correctly. Possition 9 on your display is the
first character on line 2. The address for that character in the DDRAM is 64
($40).
So...you need to move the DDRAM pointer to that position, then start writing.
It would be best if you didn't attept to write accross the middle of the
display. Write on the left, move the cursor, then write on the right. It's
a drag working with those kind of displays.
-- Jon Williams
[noparse][[/noparse]Non-text portions of this message have been removed]
It appears you have a single-line 16-character display that has to be
initialized and treated as a 2 line x 8 character display.
Do what Jon says and it should work OK.
Original Message
> I can only see one line of blocks. And the characters only go
> halfway across the display. There are 16 blocks, but only 8 ever
> show anything.
> > With the display off, you should be able to see two faint rows of
> > blocks if you hold the display just right and look across it.
> >
> > The documentation for the display should tell you what code to send to
> > it for that. I messed with mine a great while and finally figured it
> > out. Unfortunately, I tore down the circuit and don't have access to
> > the code right now.
> >
> >
Original Message
> >
> >
> >
> > > So how can I initialize it for two lines? It appears that the
> > > display only has one line. I could be mistaken though. . .
> >
> > > > > If its a two-line display, you have to initialize it properly --
> > > > > they apparently default to a 1-line display. The Stampworks
> > > > > article I remember for the LCD was a 1-line, was it not?
> > > > >
> > > > > When I was messing with a display here, I adjusted the contrast
> > > > > for one line -- when I figured out how to set it for 2 lines,
> > > > > the display contrast
Doug
All the problems that are discussed in this thread are adressed with the program
that I send the 2 sept.
You answered that it did not work.
Strange, because it works for me.
Regards
ECO
Original Message
From: <veewee77@a...>
To: <basicstamps@yahoogroups.com>
Sent: Friday, September 07, 2001 3:19 AM
Subject: Re: [noparse][[/noparse]basicstamps] LCD
> I did try that code for two lines but still only get 8 characters. On
> the left. . .
>
> I probably need to just find a better display, huh?
>
etc
Already having fun! Just spending a lot of time having it!
But that is why I got this thing in the first place. It is actuall the
brains for a robot. One that I hope will follow me around the school
where I work and carry my tools and equipment for me.
The display was a side project to see if I could make it say things
based on the senso'r responses.
> In a message dated 9/6/01 8:15:26 PM Central Daylight Time,
> veewee77@a... writes:
>
>
> > So line one is the left half of the display, and line two is the
> > right half?
>
> Yes.
>
>
> > OK, what would I need to do to the code (stampworks 11) to make it
> > display in all 16 blocks at the same time?
>
> Use the initialization code from Experiment 12 -- this adds a line to
> make it a multi-line display.
>
>
> > My display was really cheap. . . I salvaged it from an old laser
> > printer. . .
> >
> >
>
> It's always the "cheapies" that present this problem. Hopefully,
> you'll have it licked shortly and can start having fun.
>
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
H Doug
This time we prepare a book covering BS2... in German language.
Included are different programs to control LCDs.
Please send me your email address and I can send you an example for
BS2sx.
Best regards
Claus
--- In basicstamps@y..., veewee77@a... wrote:
> Hi all!
> In the Stamp M1nual 1.9, on page 71, it describes how to use an
> LCD display with the Hitachi 44780 controller. I have a display of
> the type and I have a Stamp2SX and want to use this display with
> it. I have been unable to modify the program that came with the
> Stamp2SX on the Parallax CD to drive this display. The program is
> written for a Stamp I and won't download to the Stamp2SX.
>
> Can anyone help me with this?
>
> Thanks.
>
> Doug Simpson
I had that problem in the very beginning too. The mistake was a wrong wiring
of the LCD pin. Sometimes the Stampworks Experiment just defines OUTB or
OUTA, etc. without much explanation on it. That makes the problem more
confusing. That was solved until I have find out OUTA, B correspond to pin
0-7, OUT C, D pin 8-15.
In experiment #11, D4 of LCD means pin 11 of the LCD module (NOT STAMP pin),
D5 = pin 12, D6=pin13, D7=pin14.
It turns out that the stamp pin 4 is connected to pin 11 of LCD module,
pin5(stamp) to pin 12 of LCD, etc...
E = pin 6 of LCD. So pin0 of stamp connected to pin6 of LCD.
Last but not the least, R/W is pin5 of LCD. That goes to GND.
RS=pin4 of LCD, that goes to pin3 of stamp.
Electrical wiring of LCD is important too. pin1(LCD)=Vss.
pin2(LCD)=Vdd
pin3(LCD)=VL
Wish you find this information useful.
John Leung
Hong Kong
====================================================
> Ok gentlemen,
>
> I am about to pull my hair out on a parallel LCD. This is my first time
to
> use one and I have serious problems.
>
> I ordered a hitachi compatible parallel LCD from Allied and hooked it up.
> I cannot get this thing to work and I cannot find any good code for just
> simple testing. I found some on the stampworks experiment #11 and I cant
> get it to work and all the rest that I found was for the 2P, which I am
not
> using.
>
> Can anyone help me out here, I would like to use the 4bit mode, but will
do
> 8 if that is what you have.
>
> I just dont know where to start for now and am very frustrated!
>
> TIA
>
> Mark
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
Comments
veewee77@a... writes:
> Here is some code. I can get the display to show 8 characters and
> no more. What is the 'key' to making the display usable?
>
> The code I gave you displays the word "Parallax". I can get
> spaces, and several other characters to display.
> How can I clear the screen and display another set of characters.
>
>
(Once again, let me recommend that you download the StampWorks LCD
experiments. It will save you a lot of time and frustration.)
As far as only being able to display eight characters, this means you have a
2-line display that is physically configured as a 1-line display. These
displays are cheap but a big pain. What you need to do is move the DDRAM
pointer to position 1 of line 2 to continue writing on that line.
Note: You cannot scroll this type of display cleanly and -- as you've seen --
writing across the line break is a hassle. With planning, you can avoid the
line break.
-- Jon Williams
-- Applications Engineer, Parallax
[noparse][[/noparse]Non-text portions of this message have been removed]
I have no documentation for the display. the 8 characters go half
way across the display. I will look at the sites you mention, and re-
examine the StampWorks experiments mentioned by another.
Doug
On 2 Sep 2001, at 15:37, S Parkis wrote:
> Looks like you're making progress. I suspect the key now is to dig
> deeply into the documentation for your particular LCD. Or maybe find
> some and then dig into it. They don't all work exactly alike, despite
> having the HD44780 controller in common.
>
> To clear your display, use again the "clear screen" code shown at the
> bottom of the initialization. Note you must send the command as a
> command vice character, by manipulating the RS pin. Your
> documentation should be useful to make further sense out of all this
> and the other commands available to you.
>
> I don't see why you are running into an 8-character barrier. Maybe
> something specific to your LCD (8 positions wide?).
>
> If you have trouble finding a data sheet or whatever for your LCD
> module, perhaps others can help if you post a detailed description
> (manufacturer, model #, etc.). You may also find this site useful:
>
> http://home.iae.nl/users/pouweha/lcd/lcd.shtml
>
> Lots and lots of generic HD44780 info and code examples.
>
>
> Regards,
>
> Steve
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
pad versus a round one.
Following the traces will only work on SMT chips, not the glob-top chips
used on the cheaper displays.
Original Message
> Try this, it's about as stripped down as I can get it. You should
> see a blank display with blinking cursor for about 5 seconds, then
> the letter 'A' should appear. Works fine with my BS2SX and 4x20
> Optrex LCD. Add complexity when you get this working.
>
> Regarding your module pin numbering, look closely (on both sides)
> for a '1' or '14' at either end of the row of pins. If that doesn't
> pan out, try to follow the PCB traces from what you suspect are pins
> 9 through 14--they should go to consecutive pins located along the
> top edge of your HD44780, as viewed looking at the (correctly oriented)
> printing on the top of the chip. Connector pins 4 thru 7 go to
> consecutive HD44780 pins along the right edge of the chip.
>
> Make sure your Stamp's and module's grounds are connected. You can
> simply connect module pin 3 to ground to get max contrast and do
> away with the pot. Make sure module pins 1 and 5 are also connected to
> ground, and pin 2 is connected to +5V. The RS and E connections are
> as shown below.
>
> I hope that helps get you going.
>
> Regards,
>
> Steve
>
> '{$STAMP BS2sx}
> ' __________
> ' SER TX <-| 1 24 |-- PWR
> ' SER RX ->| 2 23 |-- GND
> ' SER ATN ->| 3 22 |-- RESET
> ' SER GND --| 4 21 |-- +5V
> ' lcd d4 I/O 0 <-| 5 20 |--
> ' lcd d5 I/O 1 <-| 6 19 |--
> ' lcd d6 I/O 2 <-| 7 18 |--
> ' lcd d7 I/O 3 <-| 8 17 |--
> ' RS I/O 4 <-| 9 16 |--
> ' E I/O 5 <-| 10 15 |--
> ' I/O 6 --| 11 14 |--
> ' I/O 7 --| 12 13 |--
> ' |__________|
> '
> ' BS2-IC
>
> OUTS = %0000000000100000
> DIRS = %0000000000111111
>
> lcd_rs CON 4
> lcd_en CON 5
>
> PAUSE 100
> OUTA = %0011
> PULSOUT lcd_en,1: PAUSE 2
> PULSOUT lcd_en,1: PAUSE 2
> PULSOUT lcd_en,1: PAUSE 2
>
> OUTA = %0010 : PULSOUT lcd_en,1: PAUSE 2 '4-bit mode
>
> OUTA = %0000 : PULSOUT lcd_en,1: PAUSE 2 'display on, visible+blinking
cursor
> OUTA = %1111 : PULSOUT lcd_en,1: PAUSE 2
>
> OUTA = %0000 : PULSOUT lcd_en,1: PAUSE 2 'cursor adv right, shift not
> OUTA = %0110 : PULSOUT lcd_en,1: PAUSE 2
>
> OUTA = %0000 : PULSOUT lcd_en,1: PAUSE 2 'clear screen, allow extra time
to complete
> OUTA = %0001 : PULSOUT lcd_en,1: PAUSE 5
>
> HIGH lcd_rs ' subsequent data will be characters
>
> main:
> PAUSE 5000
> OUTA = "A" >> 4: PULSOUT lcd_en, 1
> OUTA = "A": PULSOUT lcd_en, 1
> STOP
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
displays. The way I found out was to keep sending characters to the display
and count how many are sent and not shown between the 8th and 9th character.
Original Message
> I have no documentation for the display. the 8 characters go half
> way across the display. I will look at the sites you mention, and re-
> examine the StampWorks experiments mentioned by another.
> > Looks like you're making progress. I suspect the key now is to dig
> > deeply into the documentation for your particular LCD. Or maybe find
> > some and then dig into it. They don't all work exactly alike, despite
> > having the HD44780 controller in common.
> >
Steve (and others)
I got the code from the StampWorks Project #11 which is the LCD
project, but it won't run properly. Looking through the code, there
are variables that are defined at the beginning but never used
elsewhere, and some that appear to be wrong. The display fills
with black squares instead of characters.
what would the line:
lcdout var outb
do? outb is never seen anywhere else in the program. It is never
defined anywhere else in the program.
Incidentally, I am getting nowhere with this display thing.
Frustrated. . .
documentation to see if the contrast adjustment is connected between +5 and
ground or just ground.
Original Message
> I got the code from the StampWorks Project #11 which is the LCD
> project, but it won't run properly. Looking through the code, there
> are variables that are defined at the beginning but never used
> elsewhere, and some that appear to be wrong. The display fills
> with black squares instead of characters.
>
> what would the line:
> lcdout var outb
> do? outb is never seen anywhere else in the program. It is never
> defined anywhere else in the program.
>
> Incidentally, I am getting nowhere with this display thing.
veewee77@a... writes:
> I got the code from the StampWorks Project #11 which is the LCD
> project, but it won't run properly. Looking through the code, there
> are variables that are defined at the beginning but never used
> elsewhere, and some that appear to be wrong. The display fills
> with black squares instead of characters.
...Let's be clear: it won't run properly on YOUR project -- probably due to
a wiring error. The StampWorks 1.1 LCD projects use the same wiring
scheme as the BS2p:
Stamp P0 --> LCD Enable (pin 6)
Stamp P2 --> LCD R/W (pin 5)
Stamp P3 --> LCD RS (pin 4)
Stamp P4 --> LCD DB4 (pin 11)
Stamp P5 --> LCD DB5 (pin 12)
Stamp P6 --> LCD DB7 (pin 13)
Stamp P7 --> LCD DB8 (pin 14)
Be sure you have a contrast pot (usually 10k) with the wiper connected to LCD
pin 3.
> what would the line:
> lcdout var outb
> do? outb is never seen anywhere else in the program. It is never
> defined anywhere else in the program.
The line "LCDout VAR OutB" aliases (renames) the Stamp's OutB variable. OutB
corresponds to pin 4 - 7 (where the LCD data bus is connected). If you look
through the listing, you'll see many places where it says "LCDout =". Why
did I do this? "OutB =" has little meaning (other than I'm setting some
output bits) -- except to the programmer. I try to write programs that are
easy to read and modify, so "LCDout =" tells me what is going on.
> Incidentally, I am getting nowhere with this display thing.
>
>
Don't get frustrated...it gets easier as you go along. Perhaps you should
download the whole StampWorks book and read the introductory section on
PBASIC programming. Scott Edwards and Al Williams (no relation) also have
good books on PBASIC.
-- Jon Williams
-- Applications Engineer, Parallax
-- Author of "StampWorks"
[noparse][[/noparse]Non-text portions of this message have been removed]
won't work. The contrast is ok with other programs.
I'll keep plugging away at it. . .
Doug
On 4 Sep 2001, at 7:06, Rodent wrote:
> Sounds to me like your display contrast is wrong. You need to check
> the documentation to see if the contrast adjustment is connected
> between +5 and ground or just ground.
>
>
Original Message
>
> > I got the code from the StampWorks Project #11 which is the LCD
> > project, but it won't run properly. Looking through the code, there
> > are variables that are defined at the beginning but never used
> > elsewhere, and some that appear to be wrong. The display fills with
> > black squares instead of characters.
> >
> > what would the line:
> > lcdout var outb
> > do? outb is never seen anywhere else in the program. It is never
> > defined anywhere else in the program.
> >
> > Incidentally, I am getting nowhere with this display thing.
>
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
Can anyone send me a list of the control codes for the Hitachi
44780 LCD controller?
And is there a code that will erase everything in the controller's
memory?
Thanks again!
Doug
apparently default to a 1-line display. The Stampworks article I remember
for the LCD was a 1-line, was it not?
When I was messing with a display here, I adjusted the contrast for one
line -- when I figured out how to set it for 2 lines, the display contrast
changed radically.
Original Message
> Finally got the display to work, but the stampworks #11 thing still
> won't work. The contrast is ok with other programs.
> > Sounds to me like your display contrast is wrong. You need to check
> > the documentation to see if the contrast adjustment is connected
> > between +5 and ground or just ground.
> >
> >
Original Message
> >
> > > I got the code from the StampWorks Project #11 which is the LCD
> > > project, but it won't run properly. Looking through the code, there
> > > are variables that are defined at the beginning but never used
> > > elsewhere, and some that appear to be wrong. The display fills with
> > > black squares instead of characters.
> > >
> > > what would the line:
> > > lcdout var outb
> > > do? outb is never seen anywhere else in the program. It is never
> > > defined anywhere else in the program.
> > >
> > > Incidentally, I am getting nowhere with this display thing.
daweasel@s... writes:
> If its a two-line display, you have to initialize it properly -- they
> apparently default to a 1-line display. The Stampworks article I remember
> for the LCD was a 1-line, was it not?
>
> When I was messing with a display here, I adjusted the contrast for one
> line -- when I figured out how to set it for 2 lines, the display contrast
>
StampWorks Experiment 11 initializes the LCD for a single line. With LCDs
that are using two lines physically stacked as one, this program won't quite
work (characters on the right side won't show up). And yes, there is a
dramatic difference in display contrast between single-line and multi-line
modes (due to the number of pixels that have to be multiplexed). This is why
it's always a good idea to use a contrast pot instead of grounding pin 3 of
the LCD.
-- Jon Williams
[noparse][[/noparse]Non-text portions of this message have been removed]
veewee77@a... writes:
> Can anyone send me a list of the control codes for the Hitachi
> 44780 LCD controller?
Check the LCDCMD, LCDIN and LCDOUT sections of the Parallax manual (version
2.0c). All the codes are there.
> And is there a code that will erase everything in the controller's
>
Yes, there is a ClearScreen (1) command. In the BS2p with the Enable pin
connected to pin 1, the command would look like this:
LCDCMD 1, 1
LCDOUT lets you send a command ahead of any data you want to write. You can
clear the LCD then write a string like this:
LCDOUT 1, 1, [noparse][[/noparse]"Hello, World!"]
-- Jon Williams
-- Applications Engineer, Parallax
[noparse][[/noparse]Non-text portions of this message have been removed]
only has one line. I could be mistaken though. . .
TIA
On 6 Sep 2001, at 12:05, jonwms@a... wrote:
> In a message dated 9/6/01 7:28:18 AM Central Daylight Time,
> daweasel@s... writes:
>
>
> > If its a two-line display, you have to initialize it properly --
> > they apparently default to a 1-line display. The Stampworks article
> > I remember for the LCD was a 1-line, was it not?
> >
> > When I was messing with a display here, I adjusted the contrast for
> > one line -- when I figured out how to set it for 2 lines, the
> > display contrast
> >
>
> StampWorks Experiment 11 initializes the LCD for a single line. With
> LCDs that are using two lines physically stacked as one, this program
> won't quite work (characters on the right side won't show up). And
> yes, there is a dramatic difference in display contrast between
> single-line and multi-line modes (due to the number of pixels that
> have to be multiplexed). This is why it's always a good idea to use a
> contrast pot instead of grounding pin 3 of the LCD.
>
> -- Jon Williams
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
line mode.
What would be the code to initialize it for two lines?
TIA
On 6 Sep 2001, at 12:05, jonwms@a... wrote:
> In a message dated 9/6/01 7:28:18 AM Central Daylight Time,
> daweasel@s... writes:
>
>
> > If its a two-line display, you have to initialize it properly --
> > they apparently default to a 1-line display. The Stampworks article
> > I remember for the LCD was a 1-line, was it not?
> >
> > When I was messing with a display here, I adjusted the contrast for
> > one line -- when I figured out how to set it for 2 lines, the
> > display contrast
> >
>
> StampWorks Experiment 11 initializes the LCD for a single line. With
> LCDs that are using two lines physically stacked as one, this program
> won't quite work (characters on the right side won't show up). And
> yes, there is a dramatic difference in display contrast between
> single-line and multi-line modes (due to the number of pixels that
> have to be multiplexed). This is why it's always a good idea to use a
> contrast pot instead of grounding pin 3 of the LCD.
>
> -- Jon Williams
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
veewee77@a... writes:
> So how can I initialize it for two lines? It appears that the display
> only has one line.
There are displays that are PHYSICALLY configured as a single line, but
actually work as a two-line display. The logic for this escapes me, yet it
exists. Here's some multi-line intialization code for a BS2p:
Initialize:
PAUSE 500 ' let the LCD settle
LCDCMD LCDpin,%00110000 : PAUSE 5 ' 8-bit mode
LCDCMD LCDpin,%00110000 : PAUSE 0
LCDCMD LCDpin,%00110000 : PAUSE 0
LCDCMD LCDpin,%00100000 : PAUSE 0 ' 4-bit mode
LCDCMD LCDpin,%00101000 : PAUSE 0 ' 2-line mode
LCDCMD LCDpin,%00001100 : PAUSE 0 ' no crsr, no blink
LCDCMD LCDpin,%00000110 ' inc crsr, no disp shift
Note the line that is commented "2-line" mode. This is what you need to add
to the "normal" initialization sequence to make it multi-line.
-- Jon Williams
-- Applications Engineer, Parallax
[noparse][[/noparse]Non-text portions of this message have been removed]
veewee77@a... writes:
> If this is a two-line display, the characters will be very small in two
>
No, they won't. In those displays, the left-most characters (usually 8) are
on line one, and the right-most characters are on line 2.
So...to put a character in the ninth position in the display, you actually
put it into the first position of line 2.
Goofy, I know. This is just how these (cheap) displays work. It's best to
avoid them, especially if you want to scroll the display.
-- Jon Williams
-- Applications Engineer, Parallax
[noparse][[/noparse]Non-text portions of this message have been removed]
you hold the display just right and look across it.
The documentation for the display should tell you what code to send to it
for that. I messed with mine a great while and finally figured it out.
Unfortunately, I tore down the circuit and don't have access to the code
right now.
Original Message
> So how can I initialize it for two lines? It appears that the display
> only has one line. I could be mistaken though. . .
> > > If its a two-line display, you have to initialize it properly --
> > > they apparently default to a 1-line display. The Stampworks article
> > > I remember for the LCD was a 1-line, was it not?
> > >
> > > When I was messing with a display here, I adjusted the contrast for
> > > one line -- when I figured out how to set it for 2 lines, the
> > > display contrast
halfway across the display. There are 16 blocks, but only 8 ever
show anything.
Doug
On 6 Sep 2001, at 17:13, Rodent wrote:
> With the display off, you should be able to see two faint rows of
> blocks if you hold the display just right and look across it.
>
> The documentation for the display should tell you what code to send to
> it for that. I messed with mine a great while and finally figured it
> out. Unfortunately, I tore down the circuit and don't have access to
> the code right now.
>
>
Original Message
>
>
>
> > So how can I initialize it for two lines? It appears that the
> > display only has one line. I could be mistaken though. . .
>
> > > > If its a two-line display, you have to initialize it properly --
> > > > they apparently default to a 1-line display. The Stampworks
> > > > article I remember for the LCD was a 1-line, was it not?
> > > >
> > > > When I was messing with a display here, I adjusted the contrast
> > > > for one line -- when I figured out how to set it for 2 lines,
> > > > the display contrast
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
veewee77@a... writes:
> I can only see one line of blocks. And the characters only go
> halfway across the display. There are 16 blocks, but only 8 ever
>
This is confirmation that you -- in fact -- have a two-line display that is
physically configured as one line. You need to use the multi-line
initialization sequence and when writing to the right half of the display,
you need to address it as line 2.
-- Jon Williams
[noparse][[/noparse]Non-text portions of this message have been removed]
half?
OK, what would I need to do to the code (stampworks 11) to make
it display in all 16 blocks at the same time?
My display was really cheap. . . I salvaged it from an old laser
printer. . .
Thanks again. . .
On 6 Sep 2001, at 18:04, jonwms@a... wrote:
> In a message dated 9/6/01 3:59:43 PM Central Daylight Time,
> veewee77@a... writes:
>
>
> > If this is a two-line display, the characters will be very small in
> > two
> >
>
> No, they won't. In those displays, the left-most characters (usually
> 8) are on line one, and the right-most characters are on line 2.
>
> So...to put a character in the ninth position in the display, you
> actually put it into the first position of line 2.
>
> Goofy, I know. This is just how these (cheap) displays work. It's
> best to avoid them, especially if you want to scroll the display.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
>
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
veewee77@a... writes:
> So line one is the left half of the display, and line two is the right
> half?
Yes.
> OK, what would I need to do to the code (stampworks 11) to make
> it display in all 16 blocks at the same time?
Use the initialization code from Experiment 12 -- this adds a line to make it
a multi-line display.
> My display was really cheap. . . I salvaged it from an old laser
> printer. . .
>
>
It's always the "cheapies" that present this problem. Hopefully, you'll have
it licked shortly and can start having fun.
[noparse][[/noparse]Non-text portions of this message have been removed]
the left. . .
I probably need to just find a better display, huh?
One more question. I have a sonar module, and run a program that
displays (in inches) via debug. What would I need to do to make it
display the inches on the LCD? (I think I can figure out how to put
the word "inches" on 'line two' (right side of display)and make it
stay there. . .and put the number on the left. How do I define what
is displayed, then display it?
Thanks for everything, and I'll try to not bother you much more on
this.
On 6 Sep 2001, at 18:02, jonwms@a... wrote:
> In a message dated 9/6/01 3:58:48 PM Central Daylight Time,
> veewee77@a... writes:
>
>
> > So how can I initialize it for two lines? It appears that the
> > display only has one line.
>
> There are displays that are PHYSICALLY configured as a single line,
> but actually work as a two-line display. The logic for this escapes
> me, yet it exists. Here's some multi-line intialization code for a
> BS2p:
>
> Initialize:
> PAUSE 500 ' let the LCD settle
> LCDCMD LCDpin,%00110000 : PAUSE 5 ' 8-bit mode LCDCMD
> LCDpin,%00110000 : PAUSE 0 LCDCMD LCDpin,%00110000 : PAUSE 0 LCDCMD
> LCDpin,%00100000 : PAUSE 0 ' 4-bit mode LCDCMD LCDpin,%00101000
> : PAUSE 0 ' 2-line mode LCDCMD LCDpin,%00001100 : PAUSE 0 '
> no crsr, no blink LCDCMD LCDpin,%00000110 ' inc crsr, no
> disp shift
>
> Note the line that is commented "2-line" mode. This is what you need
> to add to the "normal" initialization sequence to make it multi-line.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
but the LCD controller handles it as though it was a 2x8 line display.
Here's the bit you need to know to get all 16 characters working:
- The first 8 characters are mapped to line 1 (CGRAM 0h - 7h)
- The second 8 characters are mapped to line 2 (CGRAM 40h - 47h).
This isn't mis-typed - it really is 40h - 47h. In other words, the
controller thinks each line is 64 characters long!! It makes life difficult
to write to the display, because you now have to know whether you're about
to move from character 8 to character 9. If so, you need to advance the
cursor from 8h (where the ninth char should be) to 40h (where the ninth char
actually is).
Hope this helps - this is the result of many, many frustrating hours!!!
>From: jonwms@a...
>Reply-To: basicstamps@yahoogroups.com
>To: basicstamps@yahoogroups.com
>Subject: Re: [noparse][[/noparse]basicstamps] LCD
>Date: Thu, 6 Sep 2001 18:04:48 EDT
>
>In a message dated 9/6/01 3:59:43 PM Central Daylight Time,
>veewee77@a... writes:
>
>
> > If this is a two-line display, the characters will be very small in two
> >
>
>No, they won't. In those displays, the left-most characters (usually 8)
>are
>on line one, and the right-most characters are on line 2.
>
>So...to put a character in the ninth position in the display, you actually
>put it into the first position of line 2.
>
>Goofy, I know. This is just how these (cheap) displays work. It's best to
>avoid them, especially if you want to scroll the display.
>
>-- Jon Williams
>-- Applications Engineer, Parallax
>
>
>
>
>[noparse][[/noparse]Non-text portions of this message have been removed]
>
>
>To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
>from the same email address that you subscribed. Text in the Subject and
>Body of the message will be ignored.
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
CGRAM is used to store custom characters.
In a message dated 9/6/01 8:23:50 PM Central Daylight Time,
ristone64@h... writes:
> The bit that's probably confusing is that a 1x16 LCD is physically one line,
> but the LCD controller handles it as though it was a 2x8 line display.
>
> Here's the bit you need to know to get all 16 characters working:
>
> - The first 8 characters are mapped to line 1 (CGRAM 0h - 7h)
> - The second 8 characters are mapped to line 2 (CGRAM 40h - 47h).
>
> This isn't mis-typed - it really is 40h - 47h. In other words, the
> controller thinks each line is 64 characters long!! It makes life difficult
> to write to the display, because you now have to know whether you're about
> to move from character 8 to character 9. If so, you need to advance the
> cursor from 8h (where the ninth char should be) to 40h (where the ninth
> char
> actually is).
>
> Hope this helps - this is the result of many, many frustrating hours!!!
>
[noparse][[/noparse]Non-text portions of this message have been removed]
veewee77@a... writes:
> I did try that code for two lines but still only get 8 characters. On
> the left. . .
You need to set the address correctly. Possition 9 on your display is the
first character on line 2. The address for that character in the DDRAM is 64
($40).
So...you need to move the DDRAM pointer to that position, then start writing.
It would be best if you didn't attept to write accross the middle of the
display. Write on the left, move the cursor, then write on the right. It's
a drag working with those kind of displays.
-- Jon Williams
[noparse][[/noparse]Non-text portions of this message have been removed]
initialized and treated as a 2 line x 8 character display.
Do what Jon says and it should work OK.
Original Message
> I can only see one line of blocks. And the characters only go
> halfway across the display. There are 16 blocks, but only 8 ever
> show anything.
> > With the display off, you should be able to see two faint rows of
> > blocks if you hold the display just right and look across it.
> >
> > The documentation for the display should tell you what code to send to
> > it for that. I messed with mine a great while and finally figured it
> > out. Unfortunately, I tore down the circuit and don't have access to
> > the code right now.
> >
> >
Original Message
> >
> >
> >
> > > So how can I initialize it for two lines? It appears that the
> > > display only has one line. I could be mistaken though. . .
> >
> > > > > If its a two-line display, you have to initialize it properly --
> > > > > they apparently default to a 1-line display. The Stampworks
> > > > > article I remember for the LCD was a 1-line, was it not?
> > > > >
> > > > > When I was messing with a display here, I adjusted the contrast
> > > > > for one line -- when I figured out how to set it for 2 lines,
> > > > > the display contrast
All the problems that are discussed in this thread are adressed with the program
that I send the 2 sept.
You answered that it did not work.
Strange, because it works for me.
Regards
ECO
Original Message
From: <veewee77@a...>
To: <basicstamps@yahoogroups.com>
Sent: Friday, September 07, 2001 3:19 AM
Subject: Re: [noparse][[/noparse]basicstamps] LCD
> I did try that code for two lines but still only get 8 characters. On
> the left. . .
>
> I probably need to just find a better display, huh?
>
etc
But that is why I got this thing in the first place. It is actuall the
brains for a robot. One that I hope will follow me around the school
where I work and carry my tools and equipment for me.
The display was a side project to see if I could make it say things
based on the senso'r responses.
Thanks for all your help.
Doug
On 6 Sep 2001, at 21:17, jonwms@a... wrote:
> In a message dated 9/6/01 8:15:26 PM Central Daylight Time,
> veewee77@a... writes:
>
>
> > So line one is the left half of the display, and line two is the
> > right half?
>
> Yes.
>
>
> > OK, what would I need to do to the code (stampworks 11) to make it
> > display in all 16 blocks at the same time?
>
> Use the initialization code from Experiment 12 -- this adds a line to
> make it a multi-line display.
>
>
> > My display was really cheap. . . I salvaged it from an old laser
> > printer. . .
> >
> >
>
> It's always the "cheapies" that present this problem. Hopefully,
> you'll have it licked shortly and can start having fun.
>
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
This time we prepare a book covering BS2... in German language.
Included are different programs to control LCDs.
Please send me your email address and I can send you an example for
BS2sx.
Best regards
Claus
ckuehnel@i...
www.ckuehnel.ch
www.ckskript.ch
www.upublish.com/books/kuhnel.htm
--- In basicstamps@y..., veewee77@a... wrote:
> Hi all!
> In the Stamp M1nual 1.9, on page 71, it describes how to use an
> LCD display with the Hitachi 44780 controller. I have a display of
> the type and I have a Stamp2SX and want to use this display with
> it. I have been unable to modify the program that came with the
> Stamp2SX on the Parallax CD to drive this display. The program is
> written for a Stamp I and won't download to the Stamp2SX.
>
> Can anyone help me with this?
>
> Thanks.
>
> Doug Simpson
I had that problem in the very beginning too. The mistake was a wrong wiring
of the LCD pin. Sometimes the Stampworks Experiment just defines OUTB or
OUTA, etc. without much explanation on it. That makes the problem more
confusing. That was solved until I have find out OUTA, B correspond to pin
0-7, OUT C, D pin 8-15.
In experiment #11, D4 of LCD means pin 11 of the LCD module (NOT STAMP pin),
D5 = pin 12, D6=pin13, D7=pin14.
It turns out that the stamp pin 4 is connected to pin 11 of LCD module,
pin5(stamp) to pin 12 of LCD, etc...
E = pin 6 of LCD. So pin0 of stamp connected to pin6 of LCD.
Last but not the least, R/W is pin5 of LCD. That goes to GND.
RS=pin4 of LCD, that goes to pin3 of stamp.
Electrical wiring of LCD is important too. pin1(LCD)=Vss.
pin2(LCD)=Vdd
pin3(LCD)=VL
Wish you find this information useful.
John Leung
Hong Kong
====================================================
> Ok gentlemen,
>
> I am about to pull my hair out on a parallel LCD. This is my first time
to
> use one and I have serious problems.
>
> I ordered a hitachi compatible parallel LCD from Allied and hooked it up.
> I cannot get this thing to work and I cannot find any good code for just
> simple testing. I found some on the stampworks experiment #11 and I cant
> get it to work and all the rest that I found was for the 2P, which I am
not
> using.
>
> Can anyone help me out here, I would like to use the 4bit mode, but will
do
> 8 if that is what you have.
>
> I just dont know where to start for now and am very frustrated!
>
> TIA
>
> Mark
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>