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


Software for Signboard 2
[Split-in]




This routine sholud be put on the main process.
Function
    This routine displays the data which was set to the workarea from both edges with shifting.
    The position of the displayed data isn't 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
058
059
060
061
062
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
;*********************  Split-in  ***********************
        cblock         h'40'
        spin_lp
        spin_adr
        spin_adrr
        spin_adrwl
        spin_adrwr
        spin_data
        spin_sft
        spin_sftw
        spin_tol
        spin_fml
        spin_tor
        spin_fmr
        endc

split_in
        movlw   d'8'            ;Set loop count
        movwf   spin_lp         ;Save loop count
        movlw   scrnhd          ;Set screen head adr
        movwf   spin_adr        ;Save head adr
        addlw   d'15'           ;Head + 15(Right)
        movwf   spin_adrr       ;Save right adr
        movlw   scrnwhd         ;Set work head adr
        addlw   d'7'            ;Set work adr(Left)
        movwf   spin_adrwl      ;Save work adr(Left)
        addlw   d'1'            ;Set work adr(Right)
        movwf   spin_adrwr      ;Save work adr(Right)
        movlw   d'1'            ;Set shift loop count
        movwf   spin_sft        ;Save shift loop count
split_in_lp
        decfsz  spin_sft,w      ;Need shift ?
        goto    split_in_shift  ;Yes. jump to shift proc
split_in1
        movf    spin_adrwl,w    ;Read work adr(Left)
        movwf   fsr             ;Set work adr
        movf    indf,w          ;Read work data
        movwf   spin_data       ;Save data
        movf    spin_adr,w      ;Read screen adr
        movwf   fsr             ;Set screen adr
        movf    spin_data,w     ;Read data
        movwf   indf            ;Write data(Left)
        movf    spin_adrwr,w    ;Read work adr(Right)
        movwf   fsr             ;Set work adr
        movf    indf,w          ;Read work data
        movwf   spin_data       ;Save data
        movf    spin_adrr,w     ;Read screen adr
        movwf   fsr             ;Set screen adr
        movf    spin_data,w     ;Read data
        movwf   indf            ;Write data(Right)
        call    led_cnt         ;LED control
        call    t100m           ;Wait 100 msec
        decf    spin_adrwl,f    ;Work left adr - 1
        incf    spin_adrwr,f    ;Work right adr + 1
        incf    spin_sft,f      ;Shift loop count + 1
        decfsz  spin_lp,f       ;Split end ?
        goto    split_in_lp     ;No. Next
        return

split_in_shift
        decf    spin_sft,w      ;Shift loop count - 1
        movwf   spin_sftw       ;Save shift loop count
        movwf   spin_tol        ;Save TO adr index(Left)
        sublw   d'16'           ;Set FROM adr index(Right)
        movwf   spin_fmr        ;Save FROM adr index(Right)
        movlw   scrnhd          ;Set screen head address
        addwf   spin_tol,f      ;HA + index = TO adr(Left)
        decf    spin_tol,w      ;TO - 1 = FROM adr(Left)
        movwf   spin_fml        ;Save FROM adr(Left)
        movlw   scrnhd          ;Set screen head address
        addwf   spin_fmr,f      ;Save FROM adr(Right)
        decf    spin_fmr,w      ;FROM - 1 = TO adr(Right)
        movwf   spin_tor        ;Save TO adr(Right)
spliti_shift_lp
        movf    spin_fml,w      ;Read FROM adr(Left)
        movwf   fsr             ;Set FROM adr
        movf    indf,w          ;Read FROM data
        movwf   spin_data       ;Save data
        movf    spin_tol,w      ;Read TO adr
        movwf   fsr             ;Set TO adr
        movf    spin_data,w     ;Read data
        movwf   indf            ;Write data(Left)
        movf    spin_fmr,w      ;Read FROM adr(Right)
        movwf   fsr             ;Set FROM adr
        movf    indf,w          ;Read FROM data
        movwf   spin_data       ;Save data
        movf    spin_tor,w      ;Read TO adr
        movwf   fsr             ;Set TO adr
        movf    spin_data,w     ;Read data
        movwf   indf            ;Write data(Right)
        decf    spin_tol,f      ;TO adr(Left) - 1
        decf    spin_fml,f      ;FROM adr(Left) - 1
        incf    spin_tor,f      ;TO adr(Right) + 1
        incf    spin_fmr,f      ;FROM adr(Right) + 1
        decfsz  spin_sftw,f     ;Shift end ?
        goto    spliti_shift_lp ;No. Next
        goto    split_in1       ;Yes. Shift end



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

    In this routine, the data which is set at the center of screen workarea is copied to both edges of screen area by one row and it calls LED control subroutine.
    The shift speed of the display is 100 milliseconds/row. If changing this timer, the display speed can be changed.
    Address calculation for the shift processing in the screen area was a little complicated.