Line scrolling vs Display scrolling
baba40
Posts: 13
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]
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 Williams
Applications Engineer, Parallax
Dallas, TX· USA
·· 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 Williams
Applications Engineer, Parallax
Dallas, TX· USA
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--==<{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.
·· 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}>==--
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!
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