[Menu]>[Circuits Gallery]>[Signboard 2]>[Software]


Software for Signboard 2
[Scroll]




This routine sholud be put on the main process.
Function
    This routine displays the data which was set to the workarea from right with shifting.
    The position of the displayed data is shifted.
    In the lighting-up interval, it is 100 milliseconds per row.
    In the animation which is shown above, it is culling to make a file size small.


Source code

001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
;**********************  Scroll  ************************
        cblock         h'40'
        scroll_lp
        scroll_adr
        scroll_adrw
        scroll_lp1
        scroll_to
        scroll_from
        scroll_data
        endc

scroll
        movlw   d'16'           ;Set loop count
        movwf   scroll_lp       ;Save loop count
        movlw   scrnhd          ;Set screen head adr
        addlw   d'15'           ;Head address + 15(Right)
        movwf   scroll_adr      ;Save screen adr
        movlw   scrnwhd         ;Set screen work head adr
        movwf   scroll_adrw     ;Save screen work adr

scroll_loop
;-----------------  Screen shiftting  -------------------
        movlw   d'15'           ;Set loop count
        movwf   scroll_lp1      ;Save loop count
        movlw   scrnhd          ;Set screen head adr
        movwf   scroll_to       ;Save TO address
        addlw   d'1'            ;TO address + 1
        movwf   scroll_from     ;Save FROM address
scroll_loop1
        movf    scroll_from,w   ;Read FROM adr
        movwf   fsr             ;Set FROM adr
        movf    indf,w          ;Read FROM data
        movwf   scroll_data     ;Save data
        movf    scroll_to,w     ;Read TO adr
        movwf   fsr             ;Set to adr
        movf    scroll_data,w   ;Read data
        movwf   indf            ;Write data
        incf    scroll_to,f     ;TO adr + 1
        incf    scroll_from,f   ;FROM adr + 1
        decfsz  scroll_lp1,f    ;Shift end ?
        goto    scroll_loop1    ;No. Next
;--------------  End of Screen shiftting  ---------------

        movf    scroll_adrw,w   ;Read screen work adr
        movwf   fsr             ;Set screen work adr
        movf    indf,w          ;Read screen work data
        movwf   scroll_data     ;Save data
        movf    scroll_adr,w    ;Read screen adr
        movwf   fsr             ;Set screen adr
        movf    scroll_data,w   ;Read data
        movwf   indf            ;Write data
        call    led_cnt         ;LED control
        call    t100m           ;Wait 100 msec
        incf    scroll_adrw,f   ;Screen work adr + 1
        decfsz  scroll_lp,f     ;Scroll end ?
        goto    scroll_loop     ;No. Next
        return



Explanation
    The assignment of workarea is done among the 10th line from the 2nd line.

    In this routine, the data which is set on the screen workarea is shifted to left by one row. And the data of screen workarea is copied to right edge of screen area. The copy of the screen workarea data is done from left edge. The shift speed of the display is 100 milliseconds/row. If changing this timer, the display speed can be changed.