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


Software for Signboard 2
[Wipe ON]




This routine sholud be put on the main process.
Function
    This routine lights up 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 ON  ***********************
        cblock         h'40'
        won_lp
        won_index
        endc

wipe_on
        movlw   d'16'           ;Set loop count
        movwf   won_lp          ;Save loop count
        movlw   d'15'           ;Set row index
        movwf   won_index       ;Save row index
wipe_on_loop
        movlw   scrnhd          ;Set table head address
        addwf   won_index,w     ;Head + Index
        movwf   fsr             ;Set table address
        movlw   h'00'           ;Set ON data
        movwf   indf            ;Write data
        call    led_cnt         ;LED control
        call    t100m           ;Wait 100msec
        decf    won_index,f     ;Index - 1
        decfsz  won_lp,f        ;Loop end ?
        goto    wipe_on_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. 'won_lp' is 40h and won_index' is 41h.

    In this processing, it is calling LED control subroutine after setting lighting-up data '0' 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 light up LEDs, it sets only screen area. The data of the screen workarea is saved.