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


Software for Signboard 2
[Wipe OFF]




This routine sholud be put on the main process.
Function
    This routine turns off all LEDs on left from right.
    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
;*********************  Wipe OFF  **********************
        cblock         h'40'
        woff_lp
        woff_index
        endc

wipe_off
        movlw   d'16'           ;Set loop count
        movwf   woff_lp         ;Save loop count
        movlw   d'15'           ;Set row index
        movwf   woff_index      ;Save row index
wipe_off_loop
        movlw   scrnhd          ;Set table head address
        addwf   woff_index,w    ;Head + Index
        movwf   fsr             ;Set table address
        movlw   h'7f'           ;Set OFF data
        movwf   indf            ;Write data
        call    led_cnt         ;LED control
        call    t100m           ;Wait 100msec
        decf    woff_index,f    ;Index - 1
        decfsz  woff_lp,f       ;Loop end ?
        goto    wipe_off_loop   ;No. Next row
        return                  ;Yes. Count end



Explanation
    The display effect processing workarea (40h-4Fh) is used as the area of loop count and table index.
    As for the label between 'CBLOCK' with the 2nd line and 'ENDC' with the 5th line, an address is allocated in the order from 40h. 'woff_lp' is 40h and woff_index' is 41h.

    In this processing, it is calling LED control subroutine after setting going-out data '1' for one row (7 bits). After that, it is processing the next row after waiting 100 milliseconds. If changing this timer, the display speed can be changed.

    To turn off LEDs, it clears only screen area. The data of the screen workarea is saved.