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


Software for Signboard 2
[All LED goes ON]




This routine sholud be put on the main process.
Function
    This routine lights up all LEDs at the same time.


Source code

001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
;*******************  All ON Process  ******************
all_on
        movlw   d'16'           ;Set loop count
        movwf   lpcnt           ;Save loop count
        movlw   d'15'           ;Set row index
        movwf   rowindex        ;Save row index
all_on_loop
        movlw   scrnhd          ;Set table head address
        addwf   rowindex,w      ;Head + Index
        movwf   fsr             ;Set table address
        movlw   h'00'           ;Set ON data
        movwf   indf            ;Write data
        decf    rowindex,f      ;Index - 1
        decfsz  lpcnt,f         ;Loop end ?
        goto    all_on_loop     ;No. Next row
        call    led_cnt         ;LED control
        return



Explanation
    It sets lighting-up data '0' directly in the screen area(10h-1Fh).
    To light up LEDs, it sets only screen area. The data of the screen workarea is saved.
    It calls LED control subroutine when finishing setting all data and it lights up LEDs.