Shop OBEX P1 Docs P2 Docs Learn Events
lcd and position of char — Parallax Forums

lcd and position of char

ArchiverArchiver Posts: 46,084
edited 2000-10-25 14:23 in General Discussion
Hex80 is the start position on the top line and hexC0 is the start
possition on the second line. For example if you want the third
position on the second line then it would be

char=$C2
LCDcmd

The display position codes would be

$80 $81 $82 $83 $84 $85 $86 $87 $88 $89 $8A $8B $8C $8D $8E $8F
$C0 $C1 $C2 $C3 $C4 $C5 $C6 $C7 $C8 $C9 $CA $CB $CC $CD $CE $CF

Hope that this helps.

--- In basicstamps@egroups.com, "Pieter-Jan van Diepen"
<diepenpj@h...> wrote:
> hello all stampers!
>
> Step by step i learn more about the bs2, but another problem has
rised..
>
> I've got a lcd, 2*16, hitachi compatible. All demo program's I found
on the
> net work perfect [noparse]:)[/noparse]
>
> Now what i want is to start displaying characters at a different
place as
> the start position. According to me I have the possibility to set
the
> position to 00hex to 4F for the first line. Is this correct?
>
> In some demo's i found a startposition of hex80 and hexC0. How's
this
> possible?
>
> (the program i used is lcdtherm.bs2 from Jon Williams. He says that
he moves
> the cursor to position 7 by
>
> char=$86
> LCDcmd 'this command writes the character to lcd
>
> What's my mistake in thinking?
>
>
> thanks pieter-jan
>
______________________________________________________________________
___
> Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-10-25 13:25
    hello all stampers!

    Step by step i learn more about the bs2, but another problem has rised..

    I've got a lcd, 2*16, hitachi compatible. All demo program's I found on the
    net work perfect [noparse]:)[/noparse]

    Now what i want is to start displaying characters at a different place as
    the start position. According to me I have the possibility to set the
    position to 00hex to 4F for the first line. Is this correct?

    In some demo's i found a startposition of hex80 and hexC0. How's this
    possible?

    (the program i used is lcdtherm.bs2 from Jon Williams. He says that he moves
    the cursor to position 7 by

    char=$86
    LCDcmd 'this command writes the character to lcd

    What's my mistake in thinking?


    thanks pieter-jan
    _________________________________________________________________________
    Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

    Share information about yourself, create your own public profile at
    http://profiles.msn.com.
  • ArchiverArchiver Posts: 46,084
    edited 2000-10-25 14:23
    In a message dated 10/25/00 2:25:49 AM Central Daylight Time,
    diepenpj@h... writes:

    > I've got a lcd, 2*16, hitachi compatible. All demo program's I found on the
    > net work perfect [noparse]:)[/noparse]
    >
    > Now what i want is to start displaying characters at a different place as
    > the start position. According to me I have the possibility to set the
    > position to 00hex to 4F for the first line. Is this correct?
    >
    > In some demo's i found a startposition of hex80 and hexC0. How's this
    > possible?
    >
    > (the program i used is lcdtherm.bs2 from Jon Williams. He says that he
    moves
    >
    > the cursor to position 7 by
    >
    > char=$86
    > LCDcmd 'this command writes the character to lcd
    >
    > What's my mistake in thinking?

    If you look carefully at that program you'll see that the subroutine called
    LCDcmd pulls the RS line low, putting the LCD into command state. To
    position the cursor, you need to send the command that is $80 + position.
    So...

    char = $80
    GOSUB LCDcmd

    ...is the same as sending the cursor home. The LCD address of the first
    position on the second line is $40, so moving the cursor to that position can
    be done like this:

    char = $C0 ' $80 + $40
    GOSUB LCDcmd

    In many of my programs I create constants like this:

    Line1 CON $80
    Line2 CON $C0

    With these constants, I just add the position (0 is leftmost position) to the
    line constant and call LCDcmd.

    I hope this clears things up a bit. Even though my programs take care of
    most of the details, you'd be wise to download the HD4470 spec. I couldn't
    find it on the Hitachi site but was successful searching for HD44780.PDF at
    www.google.com.

    -- Jon Williams
    -- Dallas, TX
Sign In or Register to comment.