Oled vertical scroll with standalone axe133y

DanielH

Member
Hi All

Hoping someone can help me out here...

I am currently playing around with the axe133y oled using it as the basis of an all in one display without the need for a serial connection ( ie all the code runs on the axe133y, i just left all the original axe133y code for initialization and deleted the rest). Although very new to this i have been able to scroll text left to right and right to left without any problems. What i want to do is scroll vertically like an odometer would.

Any help would be appreciated

Thanks
Daniel
 

Puuhaaja

Senior Member
If I remember right there's no command for that but it's easy to do if you just refresh your display like:
serout b.0, n2400, (254, 128, "AAAA")
serout b.0, n2400, (254, 192, "BBBB")
serout b.0, n2400, (254, 128, "BBBB")
serout b.0, n2400, (254, 192, "CCCC")
There's only 2 lines on your display so I suppose that it's not as cool as it is with 20x4 display.
 

hippy

Ex-Staff (retired)
There is no vertical scroll command for OLED or LCD displays. If you have 8 or less digits which require scrolling then you can achieve an odometer type digit scroll by using the CGRAM characters; write those where the digits would be and then keep reprogramming the CGRAM data to produce the scrolling images.

The OLED also has a graphics mode which allows it to have its data set a column of pixels at a time which could also be used. That is likely to be more complicated than using CGRAM characters.
 

DanielH

Member
If I remember right there's no command for that but it's easy to do if you just refresh your display like:


There's only 2 lines on your display so I suppose that it's not as cool as it is with 20x4 display.
Thanks but not really what i was after.. Im chasing the effect of actually rolling a number vertically not just overlaying the next one on top.
 

DanielH

Member
There is no vertical scroll command for OLED or LCD displays. If you have 8 or less digits which require scrolling then you can achieve an odometer type digit scroll by using the CGRAM characters; write those where the digits would be and then keep reprogramming the CGRAM data to produce the scrolling images.

The OLED also has a graphics mode which allows it to have its data set a column of pixels at a time which could also be used. That is likely to be more complicated than using CGRAM characters.
Thanks, i think this is more like what im trying to do.. Would you be able to give an example or two on how it would be done?

I did think about using the custom characters by building a number or letter up over eight CGRAM characters (and display like a flip book) but being limited to only eight would limit it to only one scrolling number or letter. Is there any way around the 8 character limitation?

Thanks
 

tarzan

Senior Member
Hi DanielH

If you do a search on this forum for "vertical scroll" I'm sure you'll find something to help you get started.
 

hippy

Ex-Staff (retired)
I don't have any example code but the way I would do it is to define a bitmap for all 10 digits, and place them consecutively in internal Eeprom ...

Eeprom ( %01110 ) ; 0
Eeprom ( %10001 )
Eeprom ( %10001 )
Eeprom ( %10001 )
Eeprom ( %10001 )
Eeprom ( %10001 )
Eeprom ( %01110 )
Eeprom ( %00000 )

Eeprom ( %00100 ) ; 1
Eeprom ( %01100 )
Eeprom ( %00100 )
Eeprom ( %00100 )
Eeprom ( %00100 )
Eeprom ( %00100 )
Eeprom ( %01110 )
Eeprom ( %00000 )

Etc. You need another "0" following the "9".

Then place a CGRAM character on the screen. The CGRAM character can then be programmed from 8 consecutive bytes of Eeprom. If programmed from the first 8 bytes the display will show "0", if programmed from the second 8 bytes it will show "1" etc.

The trick is that the CGRAM character does not need to be set from the first byte of the 8 byte sets. If you use 8 bytes starting from the second byte of the first 8, then the third of the first 8, up until you are actually setting from the second sets of 8 bytes, you will see the digit vertically scroll from "0" to "1".

Get that working with CGRAM 0 then you can add a CGRAM 1 character and set that the same way. Then both digits can be set and scrolled independently.

You can improve the scroll which uses the bottom (cursor) line of the display by not programming each CGRAM character with 8 bytes, but 7 bytes from memory then a zero byte.
 

DanielH

Member
Example code attached, tested with OLED AXE133Y.
Thanks hippy thats a great starting point, i was struggling all last night to get somewhere..

Just one thing, i dont use an external serial driver for the axe133y, what would i have to change in your example code to have it run directly on the axe133y? i assume it would just be the serout parts?
 

DanielH

Member
Im stuck in converting this sample code to run directly on the axe133y.. I can follow all of the code but changing the below has me stumped..
Any pointers are greatly appreciated




' Put CGRAM character 0 on display onto display
SerOut B.2, N2400, ( 254, $80 )
SerOut B.2, N2400, ( 0 )

b10 = 0
Do
Gosub Scroll
Pause 2000
b10 = b10 + 1 // 10
Loop

Scroll:
For b21 = 0 To 8
SerOut B.2, N2400, ( 254, $40 ) ' CGRAM Address = 01ccc000
For b22 = 0 To 6
b23 = b10 * 8 + b21 + b22
Read b23, b24
SerOut B.2, N2400, ( b24 )
Next
SerOut B.2, N2400, ( 0 )
Pause 10
Next
Return
 

nick12ab

Senior Member
Some pointers:
SerOut B.2, N2400, ( 254, $80 )
This would become:
Code:
low rs
pinsB = $80
pulsout enable,1
rs and enable would be defined as the appropriate pin constants using symbol definitions.

SerOut B.2, N2400, ( 0 )
This would become:
Code:
high rs
pinsB = 0
pulsout enable,1
When a number has 254 sent before it, you make rs low when 'sending' just that number. Any number without 254 before it must be sent to the LCD when rs is high.

'Sending' = put the number/data to send on port B and pulse the Enable pin of the LCD.
 

DanielH

Member
Some pointers:This would become:
Code:
low rs
pinsB = $80
pulsout enable,1
rs and enable would be defined as the appropriate pin constants using symbol definitions.

This would become:
Code:
high rs
pinsB = 0



pulsout enable,1
When a number has 254 sent before it, you make rs low when 'sending' just that number. Any number without 254 before it must be sent to the LCD when rs is high.

'Sending' = put the number/data to send on port B and pulse the Enable pin of the LCD.
Thanks Nick thats just what i was missing, stupid me overlooked adding low rs and high rs..
And thanks to Hippy for the sample code
Really appreciate it guys, now to modify and include in my code
 

hippy

Ex-Staff (retired)
My thanks to nick12ab as well for stepping in while I wasn't around to answer the question.

A pre-emptive answer to the question of why the character bitmaps ( 8 bytes high, 5 bits wide ) have bit 7 set in the DATA commands in my example code ...

That's because sending a zero via serial to some LCD controllers may be interpreted other than as passing on a data byte of zero. Setting the msb means it's always non-zero so that cannot happen and, because the CGRAM programming only stores the bottom 5 bits, it doesn't matter how the top 3 bits are set.

For code running on the AXE132 18M2 itself the bitmaps can be 5 bits wide which can make them easier to read.

And, yes, there is a potential bug in my example code. That "SEROUT...(0)" as the last data byte sent to CGRAM would fail if the LCD controller interpreted zero as a command rather than as data, should be "SEROUT...($80)".
 
Top