fl { Drived on 9-lines for 8x8DotMatrix by Charlieplexing 2014/10/28 19:45:15 } \ =========================================================================== \ Constants \ =========================================================================== \ =========================================================================== \ Variables \ =========================================================================== \ Buffer for 8x8 LED-Matrix variable matrix 4 allot \ =========================================================================== \ Main \ =========================================================================== lockdict create _8x8matrix_Charlie forthentry \$C_a_lxasm w, h12D h113 1- tuck - h9 lshift or here W@ alignl h10 lshift or l, z2Wi\JB l, z1SyLI[ l, z2WyPW8 l, z2WiPff l, z2WiPnd l, z2Wyxj0 l, z2WyxW0 l, z2Wyxn0 l, z2WixZD l, z2Wyxqy l, z2Wyxmy l, zixZE l, z1Sy\C] l, z2WyxZy l, zfyPb1 l, z20yPj1 l, z1Sy\C] l, z3[yP[O l, z1SV04L l, z2WyPve l, z20iPyk l, z3ryPr0 l, z1SV000 l, 0 l, zJY0 l, z1 l, freedict \ Test 8x8 Matrix LED \ ( -- ) : matrix_test begin 0 dira COG! \ Hi-Z from P0 to P8 0 outa COG! \ Set data to 0 h100 dira COG! \ Set P8 to lo 1 outa COG! h1FF dira COG! \ SCR1 on hFF dira COG! \ Set P8 to hi h7F outa COG! \ Set data 1 delms hFF outa COG! \ All LEDs off 1 delms 0 dira COG! \ Hi-Z from P0 to P8 0 outa COG! \ Set data to 0 h100 dira COG! \ Set P8 to lo 2 outa COG! h1FF dira COG! \ SCR1 on hFF dira COG! \ Set P8 to hi hBF outa COG! \ Set data 1 delms hFF outa COG! \ All LEDs off 1 delms 0 dira COG! \ Hi-Z from P0 to P8 0 outa COG! \ Set data to 0 h100 dira COG! \ Set P8 to lo 4 outa COG! h1FF dira COG! \ SCR1 on hFF dira COG! \ Set P8 to hi hDF outa COG! \ Set data 1 delms hFF outa COG! \ All LEDs off 1 delms 0 dira COG! \ Hi-Z from P0 to P8 0 outa COG! \ Set data to 0 h100 dira COG! \ Set P8 to lo 8 outa COG! h1FF dira COG! \ SCR1 on hFF dira COG! \ Set P8 to hi hEF outa COG! \ Set data 1 delms hFF outa COG! \ All LEDs off 1 delms 0 dira COG! \ Hi-Z from P0 to P8 0 outa COG! \ Set data to 0 h100 dira COG! \ Set P8 to lo h10 outa COG! h1FF dira COG! \ SCR1 on hFF dira COG! \ Set P8 to hi hF7 outa COG! \ Set data 1 delms hFF outa COG! \ All LEDs off 1 delms 0 dira COG! \ Hi-Z from P0 to P8 0 outa COG! \ Set data to 0 h100 dira COG! \ Set P8 to lo h20 outa COG! h1FF dira COG! \ SCR1 on hFF dira COG! \ Set P8 to hi hFB outa COG! \ Set data 1 delms hFF outa COG! \ All LEDs off 1 delms 0 dira COG! \ Hi-Z from P0 to P8 0 outa COG! \ Set data to 0 h100 dira COG! \ Set P8 to lo h40 outa COG! h1FF dira COG! \ SCR1 on hFF dira COG! \ Set P8 to hi hFD outa COG! \ Set data 1 delms hFF outa COG! \ All LEDs off 1 delms 0 dira COG! \ Hi-Z from P0 to P8 0 outa COG! \ Set data to 0 h100 dira COG! \ Set P8 to lo h80 outa COG! h1FF dira COG! \ SCR1 on hFF dira COG! \ Set P8 to hi hFE outa COG! \ Set data 1 delms hFF outa COG! \ All LEDs off 1 delms fkey? swap drop until ; { \ Driver for 8x8-Matrix-LED by Charlieplexing \ Using P0 - P8 \ Top pin for drive is P0 \ \$C_treg1:loop counter \ \$C_treg2:SCR drive data \ \$C_treg3:buffer address \ ( n1 -- ) n1:address of 8x8-Matrix buffer fl build_BootOpt :rasm mov __buffer , \$C_stTOS spop __1 mov \$C_treg1 , # 8 mov \$C_treg2 , __scr mov \$C_treg3 , __buffer __2 \ Set from P0 to P8 to Hi-Z mov dira , # 0 \ Set data to 0 mov outa , # 0 \ Set P8 to lo mov dira , # h100 \ each SCR on mov outa , \$C_treg2 mov dira , # h1FF \ Set P8 to Hi-Z mov dira , # hFF \ Set data rdbyte outa , \$C_treg3 \ Delay 1msec jmpret __delayret , # __delay \ All LEDs off mov outa , # hFF shl \$C_treg2 , # 1 add \$C_treg3 , # 1 \ Delay 1msec jmpret __delayret , # __delay djnz \$C_treg1 , # __2 jmp # __1 __delay mov \$C_treg4 , # __1msec add \$C_treg4 , cnt waitcnt \$C_treg4 , # 0 __delayret ret __buffer 0 __1msec d80000 __scr 1 ;asm _8x8matrix_Charlie }