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.
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]