; PROGRAMMABLE RUNNING LED MATRIX ; AUTHOR: Md. Ahsan Habib indf = 00h pcl = 02h status = 03h fsr = 04h porta = 05h portb = 06h pclath = 0x0A trisa = 85h trisb = 86h t0 = 0ch t1 = 0dh t2 = 0eh L_size = 0fh const1 = 10h const2 = 11h temp1 = 12h temp2 = 13h cnt = 14h clmn = 15h count = 17h shift = 18h record = 19h column = 40h #define rp0 status,5 org 00h goto init sequence addwf pcl,1 retlw .60 ;1 retlw .120 ;2 retlw .130 ;3 retlw .65 ;4 retlw .0 ;5 retlw .60 ;6 retlw .20 ;7 retlw .130 ;8 retlw .40 ;9 retlw .90 ;10 retlw .130 ;11 retlw .90 ;12 retlw .0 ;13 retlw .45 ;14 retlw .0 ;15 retlw .55 ;16 retlw .135 ;17 retlw .40 ;18 retlw .130 ;19 retlw .0 ;20 retlw .60 ;21 retlw .130 ;22 retlw .0 ;23 retlw .130 ;24 retlw .90 ;25 retlw .95 ;26 retlw .100 ;27 retlw .15 ;28 retlw .20 ;29 retlw .65 ;30 retlw .95 ;31 retlw .130 ;32 retlw .70 ;33 retlw .25 ;34 retlw .130 ;35 retlw .0 ;36 retlw .75 ;37 retlw .20 ;38 retlw .10 ;39 retlw .20 ;40 retlw .135 ;41 retlw .96 ;42 retlw .66 ;43 retlw .96 ;44 retlw .9 ;45 retlw .42 ;46 retlw .33 ;47 retlw .0 ;48 retlw .101 ;49 retlw .9 ;50 retlw .3 ;51 letters addwf pcl,1 bsf pclath,0 ;0 movf clmn,0 call Ia bcf pclath,0 return bsf pclath,0 ;5 movf clmn,0 call Ib bcf pclath,0 return bsf pclath,0 ;10 movf clmn,0 call Ic bcf pclath,0 return bsf pclath,0 ;15 movf clmn,0 call Id bcf pclath,0 return bsf pclath,0 ;20 movf clmn,0 call Ie bcf pclath,0 return bsf pclath,0 ;25 movf clmn,0 call Iff bcf pclath,0 return bsf pclath,0 ;30 movf clmn,0 call Ig bcf pclath,0 return bsf pclath,0 ;35 movf clmn,0 call Ih bcf pclath,0 return bsf pclath,0 ;40 movf clmn,0 call Ii bcf pclath,0 return bsf pclath,0 ;45 movf clmn,0 call Ij bcf pclath,0 return bsf pclath,0 ;50 movf clmn,0 call Ik bcf pclath,0 return bsf pclath,0 ;55 movf clmn,0 call Il bcf pclath,0 return bsf pclath,0 ;60 movf clmn,0 call Im bcf pclath,0 return bsf pclath,0 ;65 movf clmn,0 call In bcf pclath,0 return bsf pclath,0 ;70 movf clmn,0 call Io bcf pclath,0 return bsf pclath,0 ;75 movf clmn,0 call Ip bcf pclath,0 return bsf pclath,0 ;80 movf clmn,0 call Iq bcf pclath,0 return bsf pclath,0 ;85 movf clmn,0 call Ir bcf pclath,0 return bsf pclath,0 ;90 movf clmn,0 call Is bcf pclath,0 return bsf pclath,0 ;95 movf clmn,0 call It bcf pclath,0 return bsf pclath,0 ;100 movf clmn,0 call Iu bcf pclath,0 return bsf pclath,0 ;105 movf clmn,0 call Iv bcf pclath,0 return bsf pclath,0 ;110 movf clmn,0 call Iw bcf pclath,0 return bsf pclath,0 ;115 movf clmn,0 call Ix bcf pclath,0 return bsf pclath,0 ;120 movf clmn,0 call Iy bcf pclath,0 return bsf pclath,0 ;125 movf clmn,0 call Iz bcf pclath,0 return bsf pclath,0 ;130 movf clmn,0 call Isp bcf pclath,0 return bsf pclath,0 ;135 movf clmn,0 call Ibutton bcf pclath,0 return delay movlw .1 movwf t2 nn movlw .1 movwf t1 time1 movlw .200 movwf t0 decfsz t0,f goto $-1 decfsz t1,f goto time1 decfsz t2,f goto nn return reverse movwf temp2 clrf temp1 movlw .8 movwf cnt lab clrf porta rrf temp2,1 rlf temp1,1 decfsz cnt,1 goto lab return lB movlw 48h movwf fsr movf count,0 call sequence movwf record clrf clmn lBB movf record,0 call letters movwf indf incf fsr,1 incf clmn,1 btfss fsr,4 goto lBB return SA movlw 40h movwf fsr bcf status,0 SAA rlf indf,1 incf fsr,1 btfss fsr,3 goto SAA return SB movlw 48h movwf fsr bcf status,0 SBB rlf indf,1 incf fsr,1 btfss fsr,4 goto SBB return clear_1 movlw .8 subwf fsr,1 bcf indf,3 addwf fsr,1 return set_1 movlw .8 subwf fsr,1 bsf indf,3 addwf fsr,1 return Ia addwf pcl,1 retlw b'01110' retlw b'10001' retlw b'10001' retlw b'11111' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'00000' Ib addwf pcl,1 retlw b'11110' retlw b'10001' retlw b'10001' retlw b'11110' retlw b'10001' retlw b'10001' retlw b'11110' retlw b'00000' Ic addwf pcl,1 retlw b'01110' retlw b'10001' retlw b'10000' retlw b'10000' retlw b'10000' retlw b'10001' retlw b'01110' retlw b'00000' Id addwf pcl,1 retlw b'11110' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'11110' retlw b'00000' Ie addwf pcl,1 retlw b'11110' retlw b'10000' retlw b'10000' retlw b'11110' retlw b'10000' retlw b'10000' retlw b'11110' retlw b'00000' Iff addwf pcl,1 retlw b'11110' retlw b'10000' retlw b'10000' retlw b'11110' retlw b'10000' retlw b'10000' retlw b'10000' retlw b'00000' Ig addwf pcl,1 retlw b'01110' retlw b'10001' retlw b'10000' retlw b'10111' retlw b'10101' retlw b'10001' retlw b'01110' retlw b'00000' Ih addwf pcl,1 retlw b'10001' retlw b'10001' retlw b'10001' retlw b'11111' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'00000' Ii addwf pcl,1 retlw b'11100' retlw b'01000' retlw b'01000' retlw b'01000' retlw b'01000' retlw b'01000' retlw b'11100' retlw b'00000' nop Ij addwf pcl,1 retlw b'00001' retlw b'00001' retlw b'00001' retlw b'00001' retlw b'00001' retlw b'10001' retlw b'01110' retlw b'00000' Ik addwf pcl,1 retlw b'10001' retlw b'10010' retlw b'10100' retlw b'11000' retlw b'10100' retlw b'10010' retlw b'10001' retlw b'00000' Il addwf pcl,1 retlw b'10000' retlw b'10000' retlw b'10000' retlw b'10000' retlw b'10000' retlw b'10000' retlw b'11110' retlw b'00000' Im addwf pcl,1 retlw b'10001' retlw b'11011' retlw b'10101' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'00000' In addwf pcl,1 retlw b'10001' retlw b'10001' retlw b'11001' retlw b'10101' retlw b'10011' retlw b'10001' retlw b'10001' retlw b'00000' Io addwf pcl,1 retlw b'01110' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'01110' retlw b'00000' Ip addwf pcl,1 retlw b'11100' retlw b'10010' retlw b'10010' retlw b'11100' retlw b'10000' retlw b'10000' retlw b'10000' retlw b'00000' Iq addwf pcl,1 retlw b'01100' retlw b'10010' retlw b'10010' retlw b'10010' retlw b'10111' retlw b'10010' retlw b'01100' retlw b'00000' Ir addwf pcl,1 retlw b'11110' retlw b'10001' retlw b'10001' retlw b'11110' retlw b'10100' retlw b'10010' retlw b'10001' retlw b'00000' Is addwf pcl,1 retlw b'01110' retlw b'10001' retlw b'10000' retlw b'01110' retlw b'00001' retlw b'10001' retlw b'01110' retlw b'00000' It addwf pcl,1 retlw b'11111' retlw b'00100' retlw b'00100' retlw b'00100' retlw b'00100' retlw b'00100' retlw b'00100' retlw b'00000' Iu addwf pcl,1 retlw b'10001' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'01110' retlw b'00000' Iv addwf pcl,1 retlw b'10001' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'01010' retlw b'00100' retlw b'00000' Iw addwf pcl,1 retlw b'10001' retlw b'10001' retlw b'10001' retlw b'10001' retlw b'10101' retlw b'11011' retlw b'10001' retlw b'00000' Ix addwf pcl,1 retlw b'10001' retlw b'10001' retlw b'01010' retlw b'00100' retlw b'01010' retlw b'10001' retlw b'10001' retlw b'00000' Iy addwf pcl,1 retlw b'10001' retlw b'10001' retlw b'01010' retlw b'00100' retlw b'00100' retlw b'00100' retlw b'00100' retlw b'00000' Iz addwf pcl,1 retlw b'11111' retlw b'00001' retlw b'00010' retlw b'00100' retlw b'01000' retlw b'10000' retlw b'11111' retlw b'00000' Isp addwf pcl,1 retlw b'00000' retlw b'00000' retlw b'00000' retlw b'00000' retlw b'00000' retlw b'00000' retlw b'00000' retlw b'00000' Ibutton addwf pcl,1 retlw b'00000' retlw b'00000' retlw b'00110' retlw b'01111' retlw b'00110' retlw b'00000' retlw b'00000' retlw b'00000' erase_A movlw 0x40 movwf fsr nx clrf indf incf fsr,1 btfss fsr,3 goto nx return erase_B movlw 0x48 movwf fsr nxt clrf indf incf fsr,1 btfss fsr,4 goto nxt return init bsf rp0 clrf trisa clrf trisb bcf rp0 call erase_A call erase_B clrf shift clrf count movlw .41 movwf L_size movlw .5 movwf const1 movlw .6 movwf const2 main movlw .80 movwf clmn movlw b'11111110' movwf portb clrf porta movf column,0 call reverse movf temp1,0 movwf porta call delay movlw b'11111101' movwf portb clrf porta movf column+1,0 call reverse movf temp1,0 movwf porta call delay movlw b'11111011' movwf portb clrf porta movf column+2,0 call reverse movf temp1,0 movwf porta call delay movlw b'11110111' movwf portb clrf porta movf column+3,0 call reverse movf temp1,0 movwf porta call delay movlw b'11101111' movwf portb clrf porta movf column+4,0 call reverse movf temp1,0 movwf porta call delay movlw b'11011111' clrf porta movwf portb movf column+5,0 call reverse movf temp1,0 movwf porta call delay movlw b'10111111' movwf portb clrf porta movf column+6,0 call reverse movf temp1,0 movwf porta call delay decfsz clmn,1 goto main+2 movf shift,0 xorwf const1,0 btfss status,2 goto $+2 call erase_B movf shift,0 xorwf const2,0 btfss status,2 goto sign call lB clrf shift movlw .130 xorwf record,0 btfss status,2 goto $+3 movlw .4 addwf shift,1 movlw .20 xorwf record,0 btfss status,2 goto $+2 incf shift,1 movlw .25 xorwf record,0 btfss status,2 goto $+2 incf shift,1 movlw .55 xorwf record,0 btfss status,2 goto $+2 incf shift,1 movlw .40 xorwf record,0 btfss status,2 goto $+3 movlw .2 addwf shift,1 movlw .75 xorwf record,0 btfss status,2 goto $+2 incf shift,1 incf count,1 movf L_size,0 xorwf count,0 btfss status,2 goto $+2 clrf count sign call SA call SB movlw 48h movwf fsr mvd btfss indf,5 call clear_1 btfsc indf,5 call set_1 incf fsr,1 btfss fsr,4 goto mvd incf shift,1 goto main end