Forums

How to convert a serial 4x20LCD code into a 2x16LCD

Started by a97annlu February 25, 2004
Well, this is it. I want to run a 2x16LCD with a BasicX-chip.
Currently, it does run and do what I want it to do, except for one,
crucial thing: the geometry.

The code I'm using id based upon code found in this PDF from NetMedia
http://www.basicx.com/Products/SLCD/ser2x16.pdf

The question is: How do I change the default geometry of 4x20 to the
2x16 that I need? There is a function that should provide this
functionality, but I don't understand how to get it right.. Quote:
Set Geometry Ctrl-O
Defines the layout (or geometry of the LCD). This command needs to
issued before any other commands if the LCD
is not a 20 character by 4 line LCD. You need to send 5 addition bytes
after sending a ?Set Geometry? command.
Example:
15,20,0x80, 0xC0,0x94,0xD4Standard 20 column by 4 line display
15,16,0x80, 0xC0,0x94,0xD4Standard 16 column by 4 line display
15,16,0x80, 0xC0,0x80,0x80 Standard 16 column by 2 line display
If the display is less than 4 lines then you still need to send the
line 1 starting address for the unused starting addresses.
See the appendix for the typical layout of various LCD modules. I've tried several versions of syntax in several different places..

'Call LCDPutCommand(Set_Geometry)
'Call LCDPutCommand(SetGeometryCmd)
'Call LCDPutCommand(SetGeometryCmd(15,16,0x80, 0xC0,0x80,0x80))
'Call LCDPutCommand(Chr(15,16,0x80, 0xC0,0x80,0x80))
'Call LCDPutString(Com3Out, Chr(15,16,0x80, 0xC0,0x80,0x80)
'Call PutQueueStr(Com3Out, Chr(Set_Geometry)&Chr(15, 16,0x80, 0xC0,
0x80,0x80))

Neither of these work.... Thanx for your help



--- In , "a97annlu" <a97annlu@h...> wrote:

> I've tried several versions of syntax in several different places..

I don't have any experience with this but I took a quick look at the
PDF to which you referred. It shows syntax similar to the line
below. Have you tried this?

Call PutQueueStr(Com3Out, Chr(15) & Chr(16) & Chr(0x80) & Chr(0xC0) &
Chr(0x80) & Chr(0x80))

I assume that you're using this device to interface a parallel LCD to
the BX-24. It is very simple to connect a parallel interface LCD
using a couple of shift registers and a few control lines, especially
so if you have other parallel devices because they can usually share
the same parallel data bus. The schematics for my Ethernet interface
show one way to do it. See
http://www.kinzers.com/don/BX24/Ethernet

Don




From: a97annlu <>

> [...] I want to run a 2x16LCD with a BasicX-chip.
> Currently, it does run and do what I want it to
> do, except for one, crucial thing: the geometry.
> [...]
> The question is: How do I change the default
> geometry of 4x20 to the 2x16 that I need? [...]

The 2x16 LCD actually defaults to the correct geometry, so you
don't really need to set it yourself. We need to update the
documentation to reflect this.

By the way, if you're using the current V2.1 compiler, you can
have it automatically generate code for driving the LCD. The code
does a lot more than the example program in the PDF file provided
with the device.

-- Frank Manning
-- NetMedia, Inc.



I got it working, finally..

The fault was mine since I, with my limited electronic knowledge, used
a display which needed a BasicStamp-protocol. Not easy to know when it
isn't staded explicitly anywhere, but I guess I should have read the
datasheet a few more times before I asked here.

A little syntax conversion later and it does work! Yay! ;) --- In , "Frank Manning" <fmanning@n...> wrote:
> From: a97annlu <a97annlu@h...>
>
> > [...] I want to run a 2x16LCD with a BasicX-chip.
> > Currently, it does run and do what I want it to
> > do, except for one, crucial thing: the geometry.
> > [...]
> > The question is: How do I change the default
> > geometry of 4x20 to the 2x16 that I need? [...]
>
> The 2x16 LCD actually defaults to the correct geometry, so you
> don't really need to set it yourself. We need to update the
> documentation to reflect this.
>
> By the way, if you're using the current V2.1 compiler, you can
> have it automatically generate code for driving the LCD. The code
> does a lot more than the example program in the PDF file provided
> with the device.
>
> -- Frank Manning
> -- NetMedia, Inc.