Vertically Scrolling your LCD

tarzan

Senior Member
Vertically Scrolling your LCD

I gave up on the idea of vertically scrolling a LCD some time ago, but the other day I revisited an old web site where I read something that I had previously over looked.

It described how once you’ve placed a cgram character on screen you can rewrite it in cgram and all instances of that character would refresh on screen. This widens the limiting scope that only eight cgram locations presents. Animation of special characters is possible and opens the door for vertically scrolling text on screen.

I have written a small program to demonstrate vertically scrolling the text “PICAXE” on the LCD screen. As with most visual displays speed is of the essence, my usual methods of maximizing speed will not be available to most of you. I recommend at least a baud rate of 9600, but this code will run with the AXE033 module @ n2400 just to demonstrate the process.


Code:
[FONT=Times New Roman]#picaxe 28X1[/FONT]
[FONT=Times New Roman]#freq m4[/FONT]
[FONT=Times New Roman]#com 1[/FONT]
[FONT=Times New Roman]'symbol speed = 0 'Adjust scroll rate here for 9600 baud rate[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,1)[/FONT]
[FONT=Times New Roman]pause 40[/FONT]
[FONT=Times New Roman]main:[/FONT]
[FONT=Times New Roman]gosub PICAXE_[/FONT]
[FONT=Times New Roman]pause 1500[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,133,"      ")[/FONT]
[FONT=Times New Roman]pause 500[/FONT]
[FONT=Times New Roman]goto main[/FONT]
[FONT=Times New Roman]PICAXE_:[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,128," >>>        <<< ")[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,192,"Vertical  Scroll") [/FONT]
[FONT=Times New Roman]gosub bottom_up_PICAXE [/FONT]
[FONT=Times New Roman]return[/FONT]
[FONT=Times New Roman]bottom_up_PICAXE:[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,72,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000)[/FONT]
[FONT=Times New Roman]'serout 1,n2400,(254,133,1,2,3,4,5,6) 'FRM010[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,133,9,10,11,12,13,14)'AXE033[/FONT]
[FONT=Times New Roman]'pause speed[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,72,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01011110,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01010001,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01011111,%01000000)[/FONT]
[FONT=Times New Roman]'pause speed[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,72,%01000000,%01000000,%01000000,%01000000,%01000000,%01011110,%01010001,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01000100,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01010001,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01010001,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01010001,%01010001,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01011111,%01010000,%01000000)[/FONT]
[FONT=Times New Roman]'pause speed[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,72,%01000000,%01000000,%01000000,%01000000,%01011110,%01010001,%01010001,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01000100,%01000100,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01010001,%01010000,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01010001,%01010001,%01000000,%01000000,%01000000,%01000000,%01000000,%01010001,%01010001,%01001010,%01000000,%01000000,%01000000,%01000000,%01000000,%01011111,%01010000,%01010000,%01000000)[/FONT]
[FONT=Times New Roman]'pause speed[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,72,%01000000,%01000000,%01000000,%01011110,%01010001,%01010001,%01011110,%01000000,%01000000,%01000000,%01000000,%01001110,%01000100,%01000100,%01000100,%01000000,%01000000,%01000000,%01000000,%01001110,%01010001,%01010000,%01010000,%01000000,%01000000,%01000000,%01000000,%01001110,%01010001,%01010001,%01010001,%01000000,%01000000,%01000000,%01000000,%01010001,%01010001,%01001010,%01000100,%01000000,%01000000,%01000000,%01000000,%01011111,%01010000,%01010000,%01011110,%01000000)[/FONT]
[FONT=Times New Roman]'pause speed[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,72,%01000000,%01000000,%01011110,%01010001,%01010001,%01011110,%01010000,%01000000,%01000000,%01000000,%01001110,%01000100,%01000100,%01000100,%01000100,%01000000,%01000000,%01000000,%01001110,%01010001,%01010000,%01010000,%01010000,%01000000,%01000000,%01000000,%01001110,%01010001,%01010001,%01010001,%01011111,%01000000,%01000000,%01000000,%01010001,%01010001,%01001010,%01000100,%01001010,%01000000,%01000000,%01000000,%01011111,%01010000,%01010000,%01011110,%01010000,%01000000)[/FONT]
[FONT=Times New Roman]'pause speed[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,72,%01000000,%01011110,%01010001,%01010001,%01011110,%01010000,%01010000,%01000000,%01000000,%01001110,%01000100,%01000100,%01000100,%01000100,%01000100,%01000000,%01000000,%01001110,%01010001,%01010000,%01010000,%01010000,%01010001,%01000000,%01000000,%01001110,%01010001,%01010001,%01010001,%01011111,%01010001,%01000000,%01000000,%01010001,%01010001,%01001010,%01000100,%01001010,%01010001,%01000000,%01000000,%01011111,%01010000,%01010000,%01011110,%01010000,%01010000,%01000000)[/FONT]
[FONT=Times New Roman]'pause speed [/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,133,"PICAXE")[/FONT]
[FONT=Times New Roman]return[/FONT]
 

tarzan

Senior Member
Animation of cgram characters on LCD

This version demonstrates animation of the arrows pointing at the text. You will see that it is possible to give the illusion that the arrows move in from both directions, from the left and from the right as the text “PICAXE” vertically scrolls onto the screen.

Once again I say this is all so much more impressive when run at 9600 baud rate with a FRM010, or whatever you have on hand that will allow you to run at this speed or better.

Code:
[FONT=Times New Roman]#picaxe 28X1[/FONT]
[FONT=Times New Roman]#freq m4[/FONT]
[FONT=Times New Roman]#com 1[/FONT]
[FONT=Times New Roman]'symbol speed = 0 'Adjust scroll rate here for 9600 baud rate[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,1)[/FONT]
[FONT=Times New Roman]pause 40[/FONT]
[FONT=Times New Roman]main:[/FONT]
[FONT=Times New Roman]gosub PicAxe_[/FONT]
[FONT=Times New Roman]pause 1500[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,128,"                ")[/FONT]
[FONT=Times New Roman]pause 500[/FONT]
[FONT=Times New Roman]goto main[/FONT]
[FONT=Times New Roman]PicAxe_:[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,192,"Vertical  Scroll") [/FONT]
[FONT=Times New Roman]gosub bottom_up_PicAxe [/FONT]
[FONT=Times New Roman]return[/FONT]
[FONT=Times New Roman]bottom_up_PicAxe:[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,64,%01000000,%01010000,%01001000,%01000100,%01001000,%01010000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000001,%01000010,%01000100,%01001000,%01000100,%01000010,%01000001,%01000000)[/FONT]
[FONT=Times New Roman]'serout 1,n2400,(254,128,$20,0,0,0,$20,1,2,3,4,5,6,$20,7,7,7,$20)'FRM010[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,128,$20,8,8,8,$20,9,10,11,12,13,14,$20,15,15,15,$20)'AXE033[/FONT]
[FONT=Times New Roman]'pause speed[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,64,%01010000,%01001000,%01000100,%01000010,%01000100,%01001000,%01010000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01011110,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01010001,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01011111,%01000000,%01000010,%01000100,%01001000,%01010000,%01001000,%01000100,%01000010,%01000000)[/FONT]
[FONT=Times New Roman]'pause speed[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,64,%01001000,%01000100,%01000010,%01000001,%01000010,%01000100,%01001000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01011110,%01010001,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01000100,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01010001,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01010001,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01010001,%01010001,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01011111,%01010000,%01000000,%01000000,%01000000,%01000000,%01000001,%01000000,%01000000,%01000000,%01000000)[/FONT]
[FONT=Times New Roman]'pause speed[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,64,%01000000,%01000000,%01000000,%01010000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01011110,%01010001,%01010001,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01000100,%01000100,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01010001,%01010000,%01000000,%01000000,%01000000,%01000000,%01000000,%01001110,%01010001,%01010001,%01000000,%01000000,%01000000,%01000000,%01000000,%01010001,%01010001,%01001010,%01000000,%01000000,%01000000,%01000000,%01000000,%01011111,%01010000,%01010000,%01000000,%01000000,%01000000,%01000001,%01000010,%01000001,%01000000,%01000000,%01000000)[/FONT]
[FONT=Times New Roman]'pause speed[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,64,%01000000,%01000000,%01010000,%01001000,%01010000,%01000000,%01000000,%01000000,%01000000,%01000000,%01000000,%01011110,%01010001,%01010001,%01011110,%01000000,%01000000,%01000000,%01000000,%01001110,%01000100,%01000100,%01000100,%01000000,%01000000,%01000000,%01000000,%01001110,%01010001,%01010000,%01010000,%01000000,%01000000,%01000000,%01000000,%01001110,%01010001,%01010001,%01010001,%01000000,%01000000,%01000000,%01000000,%01010001,%01010001,%01001010,%01000100,%01000000,%01000000,%01000000,%01000000,%01011111,%01010000,%01010000,%01011110,%01000000,%01000000,%01000001,%01000010,%01000100,%01000010,%01000001,%01000000,%01000000)[/FONT]
[FONT=Times New Roman]'pause speed[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,64,%01000000,%01010000,%01001000,%01000100,%01001000,%01010000,%01000000,%01000000,%01000000,%01000000,%01011110,%01010001,%01010001,%01011110,%01010000,%01000000,%01000000,%01000000,%01001110,%01000100,%01000100,%01000100,%01000100,%01000000,%01000000,%01000000,%01001110,%01010001,%01010000,%01010000,%01010000,%01000000,%01000000,%01000000,%01001110,%01010001,%01010001,%01010001,%01011111,%01000000,%01000000,%01000000,%01010001,%01010001,%01001010,%01000100,%01001010,%01000000,%01000000,%01000000,%01011111,%01010000,%01010000,%01011110,%01010000,%01000000,%01000001,%01000010,%01000100,%01001000,%01000100,%01000010,%01000001,%01000000)[/FONT]
[FONT=Times New Roman]'pause speed[/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,64,%01010000,%01001000,%01000100,%01000010,%01000100,%01001000,%01010000,%01000000,%01000000,%01011110,%01010001,%01010001,%01011110,%01010000,%01010000,%01000000,%01000000,%01001110,%01000100,%01000100,%01000100,%01000100,%01000100,%01000000,%01000000,%01001110,%01010001,%01010000,%01010000,%01010000,%01010001,%01000000,%01000000,%01001110,%01010001,%01010001,%01010001,%01011111,%01010001,%01000000,%01000000,%01010001,%01010001,%01001010,%01000100,%01001010,%01010001,%01000000,%01000000,%01011111,%01010000,%01010000,%01011110,%01010000,%01010000,%01000000,%01000010,%01000100,%01001000,%01010000,%01001000,%01000100,%01000010,%01000000)[/FONT]
[FONT=Times New Roman]'pause speed [/FONT]
[FONT=Times New Roman]serout 1,n2400,(254,128," >>> PICAXE <<< ")[/FONT]
[FONT=Times New Roman]return[/FONT]
 

eclectic

Moderator
Nice one Dan. (Well two actually).

I've played with both of your programs.
Very entertaining. And, an excellent learning example for the higher levels of
LCD programming.

How long did they take you to write?

e.
 

tarzan

Senior Member
CGRAM

Not long, once I had a clear idea of what I wanted to achieve.

In the case of the horizontally animated arrows, when programming in the Programming Editor I rearranged the text on my PC screen to reflect what would appear on the LCD screen to give a clearer picture of what I was doing. This means placing each row directly underneath each other (5x8 grid). There are seven frames to scroll the text “PICAXE” onto the screen. So working backwards from the last, the arrows appear in the form of a completed arrow at its final position and six intermediary successive places along the way. So the arrows actually cycles more than once. Remembering that the cgram character is only five wide. Of course you can string more than one cgram character together to makeup a much large object, but it will be visually affected by the separation breaks between cgram characters.

Now the next step is to place the frames into external EEPROM and retrieve the data from there.

There was also another project I viewed on the Internet that showed a vertically scrolling odometer, just like an automotive mechanical one. I think I’ll have ago at that also.
 

nbw

Senior Member
Awesome! With the increased grunt of the X2 - speed and program space - one might be able to use a 20X2 to interface to the LCD. You could serially send it a string, e.g. Do not adjust your set, with a direction (up/down), and a speed (fast/med/slow) to tell it how to vroll.
 
Top