Shop OBEX P1 Docs P2 Docs Learn Events
Line scrolling vs Display scrolling — Parallax Forums

Line scrolling vs Display scrolling

baba40baba40 Posts: 13
edited 2005-02-12 19:14 in BASIC Stamp
OK,· I thought solving this problem was·going to be easy, but I'm
beginning to think it may be impossible using an HD44780.

In short, I am trying to overcome the·line character·limit on a 2X16
character LCD display by scrolling the the second line of the display.
I have successfully written code that loop scrolls the display, but I
can't identify any way (in the HD44780 instruction set) to scroll by
line vs display.

I have begun to think about doing the scrolling in code and refreshing
the display with every shift, but I really don't want to go there.

As anyone solved this problem in the controller (sample code would be
greatly appreciated), or if not, does anyone have any ideas (how about
the function set command or something clever with DRAM addressing?)

I am programming on a stamp [url=mailto:BS@p]BS2p[/url]

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-02-05 23:21
    To my knowledge there is no line scrolling in the HD44780 driver; I've been using them with BASIC Stamps for over 10 years and if that feature was in there I would have taken advantage of it. I think you'll have to use a bit of code: copy one line to the other, then clear the first line (as in scrolling up) or copy data from a buffer.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-02-06 21:54
    Jon,

    ·· I think he's trying to scroll the characters from left to right on line two (I could be wrong here).· If that's the case, here's an idea...

    ·· Using a relatively small amount of code you could do this by placing the text you want to print to the LCD in a DATA statement.··You could set the display address to line 2.· Send the first 16 characters via a loop using the DATA address as the start pointer.· Inside the loop reset the DD Address and increment the data pointer and resend the 16 characters.· Inside a small loop this would scroll the data very nicely.

    ·· In case I am wrong, you could do something similar for scrolling line 2 to line 1.· Then set your DD Ram Address to line 2 and start printing data again...Basically use pointers for each line pointing at the start address of the text block.






    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --==<{Chris}>==--

    Post Edited (Chris Savage) : 2/6/2005 9:59:48 PM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-02-06 21:56
    Oh ... I thought he wanted to scroll the whole line (that is, move line 2 up to line 1 -- or vice versa). To your point, if he just wants to scroll characters on line two then he must do it in code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-02-06 22:00
    I'm not really sure...I guess we'll have to wait to see what exactly he wants.· I guess we as programmers tend to think of things the original poster might not have.· I tend to read into things a bit I guess.·

    tongue.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --==<{Chris}>==--
  • baba40baba40 Posts: 13
    edited 2005-02-09 15:59
    Jon, Chris

    Chris is correct.· I am not trying to scroll the lines vertically.· I am trying to scroll the second line from left to right while the first line (which contains a static banner) remains fixed.· Jon, you are correct in that I will have to do this in code as the HH44780 does not support line scrolling (thought a newer device which is difficult to find imbedded with LCDs does seem to support left/right line scrolling).· Having to do this in code is at the root of my original comment "but I really don't want to go there".· I hate to use precious program space to solve a problem that, I feel, should be·addressed by the controller.

    Chris, now that you understand what I am trying to do, does this modify your orginal suggestion/approach?· I will begin going down the road you suggest, but would welcome references to any existing code that might be useful.

    Jon, Chris thanks for your thoughts and suggestions and the ongoing support.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-02-11 14:29
    baba40,

    ·· My original suggestion stands (Now that I am sure what you're doing).· I would handle your printing to the display using pointers to text blocks in DATA statements.· This should be the most efficient way to handle this in terms of raw EEPROM space and code.· Clever code could handle normal printing, and line scrolling by incrementing the pointer as your normally would, but always displaying 16 characters from a larger than 16-character data segment.· I'm not at my shop where I could try something to get you started, but if you look at it from that perspective, you should be alright.

    ···Now that we're clear on what·you're doing, perhaps·Jon might have something to add that I didn't think about?· There's always more than one way to accomplish something, so maybe from more ideas you can find something you like.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --==<{Chris}>==--
  • baba40baba40 Posts: 13
    edited 2005-02-12 17:53
    Chris,

    Thanks for the followup-up.· I'll keep an eye out for any further suggestions from Jon. and will
    let you know how things turn out.

    Again, thanks for all your help!
  • NWUpgradesNWUpgrades Posts: 292
    edited 2005-02-12 19:03
    Jon, I am looking for a bit of help. Although I have been building computers for years, I am just now getting into circuit boards, etc. I have a project I am working on for a pan and tilt system. Using the homework board I have figured out how to do this controlling each of 2 motors with a pushbutton move CW when one is pressed and counter clockwise when the other is pressed. My question is this, how do I make it so a could control the motors rather than the pushbuttons? I somewhat understand about the programming, etc. but I am not sure what to use in this situation. Thanks in advance for any help.
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-02-12 19:14
    NWUpgrades,

    You'll probably get more help if you post this as a new thread with an appropriate subject. Adding it to a thread on scrolling LCDs isn't likely to attract the people who would know about what you need, unless they also happen to know about LCD scrolling.

    Jim
Sign In or Register to comment.