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


Software for Signboard 2
[Slide-down]




This routine sholud be put on the main process.
Function
    This routine displays the data which was set to the workarea from top with shifting.
    The position of the displayed data isn't shifted.
    In the lighting-up interval, it is 100 milliseconds per row.


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
098
099
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
;********************  Slide-down  **********************
        cblock         h'40'
        sldw_lp
        sldw_lpw
        sldw_lps
        sldw_idx
        sldw_idxw
        sldw_masks
        sldw_maskw
        sldw_adr
        sldw_adrw
        sldw_datas
        sldw_dataw
        endc

sldw_masks1   equ   b'01111110'
sldw_maskw1   equ   b'00000001'
sldw_masks2   equ   b'01111100'
sldw_maskw2   equ   b'00000011'
sldw_masks3   equ   b'01111000'
sldw_maskw3   equ   b'00000111'
sldw_masks4   equ   b'01110000'
sldw_maskw4   equ   b'00001111'
sldw_masks5   equ   b'01100000'
sldw_maskw5   equ   b'00011111'
sldw_masks6   equ   b'01000000'
sldw_maskw6   equ   b'00111111'
sldw_masks7   equ   b'00000000'
sldw_maskw7   equ   b'01111111'

slide_down
        movlw   d'7'            ;Set loop count
        movwf   sldw_lp         ;Save loop count
        movlw   d'1'            ;Set index
        movwf   sldw_idx        ;Save index

slide_dw_loop
        movf    sldw_idx,w      ;Read index
        movwf   sldw_idxw       ;Save index to work
        decfsz  sldw_idxw,f     ;Index = 1 ?
        goto    sldw2           ;No. Next
        goto    slide_dw1       ;Index = 1
sldw2   decfsz  sldw_idxw,f     ;Index = 2 ?
        goto    sldw3           ;No. Next
        goto    slide_dw2       ;Index = 2
sldw3   decfsz  sldw_idxw,f     ;Index = 3 ?
        goto    sldw4           ;No. Next
        goto    slide_dw3       ;Index = 3
sldw4   decfsz  sldw_idxw,f     ;Index = 4 ?
        goto    sldw5           ;No. Next
        goto    slide_dw4       ;Index = 4
sldw5   decfsz  sldw_idxw,f     ;Index = 5 ?
        goto    sldw6           ;No. Next
        goto    slide_dw5       ;Index = 5
sldw6   decfsz  sldw_idxw,f     ;Index = 6 ?
        goto    slide_dw7       ;Index = 7
        goto    slide_dw6       ;Index = 6
slide_dw_lp1
        incf    sldw_idx,f      ;Index + 1
        decfsz  sldw_lp,f       ;Loop end ?
        goto    slide_dw_loop   ;Next
        return

slide_dw1
        movlw   sldw_masks1     ;Set mask1 for screen
        movwf   sldw_masks      ;Save screen mask1
        movlw   sldw_maskw1     ;Set mask1 for work
        movwf   sldw_maskw      ;Save work mask1
        call    sldw_sub        ;Bit process and LED cont
        goto    slide_dw_lp1
slide_dw2
        movlw   sldw_masks2     ;Set mask2 for screen
        movwf   sldw_masks      ;Save screen mask1
        movlw   sldw_maskw2     ;Set mask2 for work
        movwf   sldw_maskw      ;Save work mask1
        call    sldw_sub        ;Bit process and LED cont
        goto    slide_dw_lp1
slide_dw3
        movlw   sldw_masks3     ;Set mask3 for screen
        movwf   sldw_masks      ;Save screen mask1
        movlw   sldw_maskw3     ;Set mask3 for work
        movwf   sldw_maskw      ;Save work mask1
        call    sldw_sub        ;Bit process and LED cont
        goto    slide_dw_lp1
slide_dw4
        movlw   sldw_masks4     ;Set mask4 for screen
        movwf   sldw_masks      ;Save screen mask1
        movlw   sldw_maskw4     ;Set mask4 for work
        movwf   sldw_maskw      ;Save work mask1
        call    sldw_sub        ;Bit process and LED cont
        goto    slide_dw_lp1
slide_dw5
        movlw   sldw_masks5     ;Set mask5 for screen
        movwf   sldw_masks      ;Save screen mask1
        movlw   sldw_maskw5     ;Set mask5 for work
        movwf   sldw_maskw      ;Save work mask1
        call    sldw_sub        ;Bit process and LED cont
        goto    slide_dw_lp1
slide_dw6
        movlw   sldw_masks6     ;Set mask6 for screen
        movwf   sldw_masks      ;Save screen mask1
        movlw   sldw_maskw6     ;Set mask6 for work
        movwf   sldw_maskw      ;Save work mask1
        call    sldw_sub        ;Bit process and LED cont
        goto    slide_dw_lp1
slide_dw7
        movlw   sldw_masks7     ;Set mask7 for screen
        movwf   sldw_masks      ;Save screen mask1
        movlw   sldw_maskw7     ;Set mask7 for work
        movwf   sldw_maskw      ;Save work mask1
        call    sldw_sub        ;Bit process and LED cont
        goto    slide_dw_lp1

sldw_sub
        movlw   d'16'           ;Set loop count
        movwf   sldw_lpw        ;Save loop count
        movlw   scrnhd          ;Set screen head address
        movwf   sldw_adr        ;Save screen head address
        movlw   scrnwhd         ;Set screen work head adr
        movwf   sldw_adrw       ;Save screen work adr
sldw_sub_lp
        movf    sldw_adr,w      ;Read screen adr
        movwf   fsr             ;Set screen adr
        movf    indf,w          ;Read screen data
        movwf   sldw_datas      ;Save screen data
        movf    sldw_masks,w    ;Read screen mask
        andwf   sldw_datas,f    ;Screen data AND Mask
        movf    sldw_adrw,w     ;Read screen work adr
        movwf   fsr             ;Set screen work adr
        movf    indf,w          ;Read screen work data
        movwf   sldw_dataw      ;Save screen work data
        movf    sldw_idx,w      ;Read index
        sublw   d'8'            ;8 - Index
        movwf   sldw_lps        ;Save loop count
        decfsz  sldw_lps,f      ;Need rotate ?
        goto    sldw_sub1       ;Yes. Need rotate
        goto    sldw_sub2       ;No. skip
sldw_sub1
        rrf     sldw_dataw,f    ;Rotate right
        decfsz  sldw_lps,f      ;Rotate end ?
        goto    sldw_sub1       ;No. More
sldw_sub2
        movf    sldw_maskw,w    ;Read work mask
        andwf   sldw_dataw,f    ;Work data AND Mask
        movf    sldw_dataw,w    ;Read work data
        iorwf   sldw_datas,f    ;Screen OR Work
        movf    sldw_adr,w      ;Read screen adr
        movwf   fsr             ;Set screen adr
        movf    sldw_datas,w    ;Read screen data
        movwf   indf            ;Write screen data
        incf    sldw_adr,f      ;Screen adr + 1
        incf    sldw_adrw,f     ;Screen work adr + 1
        decfsz  sldw_lpw,f      ;Loop end ?
        goto    sldw_sub_lp     ;No. Next
        call    led_cnt         ;LED control
        call    t100m           ;Wait 100 msec
        return



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

    In this routine, the data which is set at the bottom of screen workarea is copied to top of screen area by one bit. It has bit processing by each row to shift a display. Mask patterns are used for the bit processing. After picking out the bit which needs a screen area and a screen workarea, a logical OR is done.
    When processing 1 bit by all the rows, 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.