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

Software for Signboard 2
[Slide-up]

This routine sholud be put on the main process. Function This routine displays the data which was set to the workarea from bottom 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-up  ***********************
            cblock         h'40'
            slup_lp
            slup_lpw
            slup_lps
            slup_idx
            slup_idxw
            slup_masks
            slup_maskw
            slup_adr
            slup_adrw
            slup_datas
            slup_dataw
            endc

    slup_masks1   equ   b'00111111'
    slup_maskw1   equ   b'01000000'
    slup_masks2   equ   b'00011111'
    slup_maskw2   equ   b'01100000'
    slup_masks3   equ   b'00001111'
    slup_maskw3   equ   b'01110000'
    slup_masks4   equ   b'00000111'
    slup_maskw4   equ   b'01111000'
    slup_masks5   equ   b'00000011'
    slup_maskw5   equ   b'01111100'
    slup_masks6   equ   b'00000001'
    slup_maskw6   equ   b'01111110'
    slup_masks7   equ   b'00000000'
    slup_maskw7   equ   b'01111111'

    slide_up
            movlw   d'7'            ;Set loop count
            movwf   slup_lp         ;Save loop count
            movlw   d'1'            ;Set index
            movwf   slup_idx        ;Save index

    slide_up_loop
            movf    slup_idx,w      ;Read index
            movwf   slup_idxw       ;Save index to work
            decfsz  slup_idxw,f     ;Index = 1 ?
            goto    slup2           ;No. Next
            goto    slide_up1       ;Index = 1
    slup2   decfsz  slup_idxw,f     ;Index = 2 ?
            goto    slup3           ;No. Next
            goto    slide_up2       ;Index = 2
    slup3   decfsz  slup_idxw,f     ;Index = 3 ?
            goto    slup4           ;No. Next
            goto    slide_up3       ;Index = 3
    slup4   decfsz  slup_idxw,f     ;Index = 4 ?
            goto    slup5           ;No. Next
            goto    slide_up4       ;Index = 4
    slup5   decfsz  slup_idxw,f     ;Index = 5 ?
            goto    slup6           ;No. Next
            goto    slide_up5       ;Index = 5
    slup6   decfsz  slup_idxw,f     ;Index = 6 ?
            goto    slide_up7       ;Index = 7
            goto    slide_up6       ;Index = 6
    slide_up_lp1
            incf    slup_idx,f      ;Index + 1
            decfsz  slup_lp,f       ;Loop end ?
            goto    slide_up_loop   ;Next
            return

    slide_up1
            movlw   slup_masks1     ;Set mask1 for screen
            movwf   slup_masks      ;Save screen mask1
            movlw   slup_maskw1     ;Set mask1 for work
            movwf   slup_maskw      ;Save work mask1
            call    slup_sub        ;Bit process and LED cont
            goto    slide_up_lp1
    slide_up2
            movlw   slup_masks2     ;Set mask2 for screen
            movwf   slup_masks      ;Save screen mask1
            movlw   slup_maskw2     ;Set mask2 for work
            movwf   slup_maskw      ;Save work mask1
            call    slup_sub        ;Bit process and LED cont
            goto    slide_up_lp1
    slide_up3
            movlw   slup_masks3     ;Set mask3 for screen
            movwf   slup_masks      ;Save screen mask1
            movlw   slup_maskw3     ;Set mask3 for work
            movwf   slup_maskw      ;Save work mask1
            call    slup_sub        ;Bit process and LED cont
            goto    slide_up_lp1
    slide_up4
            movlw   slup_masks4     ;Set mask4 for screen
            movwf   slup_masks      ;Save screen mask1
            movlw   slup_maskw4     ;Set mask4 for work
            movwf   slup_maskw      ;Save work mask1
            call    slup_sub        ;Bit process and LED cont
            goto    slide_up_lp1
    slide_up5
            movlw   slup_masks5     ;Set mask5 for screen
            movwf   slup_masks      ;Save screen mask1
            movlw   slup_maskw5     ;Set mask5 for work
            movwf   slup_maskw      ;Save work mask1
            call    slup_sub        ;Bit process and LED cont
            goto    slide_up_lp1
    slide_up6
            movlw   slup_masks6     ;Set mask6 for screen
            movwf   slup_masks      ;Save screen mask1
            movlw   slup_maskw6     ;Set mask6 for work
            movwf   slup_maskw      ;Save work mask1
            call    slup_sub        ;Bit process and LED cont
            goto    slide_up_lp1
    slide_up7
            movlw   slup_masks7     ;Set mask7 for screen
            movwf   slup_masks      ;Save screen mask1
            movlw   slup_maskw7     ;Set mask7 for work
            movwf   slup_maskw      ;Save work mask1
            call    slup_sub        ;Bit process and LED cont
            goto    slide_up_lp1

    slup_sub
            movlw   d'16'           ;Set loop count
            movwf   slup_lpw        ;Save loop count
            movlw   scrnhd          ;Set screen head address
            movwf   slup_adr        ;Save screen head address
            movlw   scrnwhd         ;Set screen work head adr
            movwf   slup_adrw       ;Save screen work adr
    slup_sub_lp
            movf    slup_adr,w      ;Read screen adr
            movwf   fsr             ;Set screen adr
            movf    indf,w          ;Read screen data
            movwf   slup_datas      ;Save screen data
            movf    slup_masks,w    ;Read screen mask
            andwf   slup_datas,f    ;Screen data AND Mask
            movf    slup_adrw,w     ;Read screen work adr
            movwf   fsr             ;Set screen work adr
            movf    indf,w          ;Read screen work data
            movwf   slup_dataw      ;Save screen work data
            movf    slup_idx,w      ;Read index
            sublw   d'8'            ;8 - Index
            movwf   slup_lps        ;Save loop count
            decfsz  slup_lps,f      ;Need rotate ?
            goto    slup_sub1       ;Yes. Need rotate
            goto    slup_sub2       ;No. skip
    slup_sub1
            rlf     slup_dataw,f    ;Rotate left
            decfsz  slup_lps,f      ;Rotate end ?
            goto    slup_sub1       ;No. More
    slup_sub2
            movf    slup_maskw,w    ;Read work mask
            andwf   slup_dataw,f    ;Work data AND Mask
            movf    slup_dataw,w    ;Read work data
            iorwf   slup_datas,f    ;Screen OR Work
            movf    slup_adr,w      ;Read screen adr
            movwf   fsr             ;Set screen adr
            movf    slup_datas,w    ;Read screen data
            movwf   indf            ;Write screen data
            incf    slup_adr,f      ;Screen adr + 1
            incf    slup_adrw,f     ;Screen work adr + 1
            decfsz  slup_lpw,f      ;Loop end ?
            goto    slup_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 top of screen workarea is copied to bottom 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.