MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 1 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00001 ; list p=12f683,b=4,n=0 ; declare processor, tabs, and lines/page 00002 00003 ;********************************************************************** 00004 ; Copyright (C) 2005-2011 Dwayne Forsyth 00005 ; 00006 ; This program is free software; you can redistribute it and/or 00007 ; modify it under the terms of the GNU General Public License 00008 ; as published by the Free Software Foundation; either version 2 00009 ; of the License, or (at your option) any later version. 00010 ; 00011 ; This program is distributed in the hope that it will be useful, 00012 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 ; GNU General Public License for more details. 00015 ; 00016 ; You should have received a copy of the GNU General Public License 00017 ; along with this program; if not, write to the 00018 ; 00019 ; Free Software Foundation, Inc. 00020 ; 51 Franklin Street, Fifth Floor 00021 ; Boston, MA 02110-1301, USA. 00022 ; 00023 ;********************************************************************** 00024 ; 00025 ; This is a merger of a number of Blinkie programs I created for different 00026 ; www.2DKits.com boards using the newer PIC chips. This code does NOT 00027 ; support the older 12F683, 16F688 and 16F886 2DKits chips. 00028 ; 00029 ; The newer chips have enough enhancements and keeping backward compatibility 00030 ; for is not worth the effort. The new chips are better, faster, and cheaper. 00031 ; 00032 ; 4RBG /w common anode (ufo and clear 5mm) .... Working 01/02/2012 00033 ; 4RBG /w common Cathode (milk 5mm) ........... shold be ok 00034 ; 6 circle /w bi-color LEDs. .................. Working 01/02/2012 00035 ; 6 circle /w mono LEDs. ...................... Working 01/02/2012 00036 ; badge 6 bi-color plus 1 mono, no IR ......... shold be ok 00037 ; badge 7 LED /w mono LEDs, no IR ............. shold be ok 00038 ; 19 LED Stick ................................ Working 01/20/2012 00039 ; 19 circle /w mono............................ unknown 00040 ; 19 circle /w bi-color........................ Working 01/04/2012 00041 ; RGB Stick ................................... unknown 00042 ; 3x3 /w mono ................................. unknown 00043 ; 3x3 /w bi-color ............................. unknown 00044 ; 5x7 matrix .................................. code should be ported over. 00045 ; 16x8x2 ...................................... working 3/28/2012 00046 ; 12 Circle ................................... unknown (should be close) 00047 ; 24 Sphere ................................... unknown (should be close) 00048 ; 4x4x4 ....................................... work in progress 00049 ; 4x4 ......................................... work in progress 00050 ; gator ....................................... working 8/4/2011 00051 ; dogtag 2RGB ................................. working 8/5/2011 00052 ; dogtag 6 BI ................................. working 8/5/2011 00053 ; Rocket ...................................... work in progress MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 2 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00054 ; 00055 ; Dwayne Forsyth wrote the original code, Dwayne pulled a number of updates, 00056 ; code cleanup, and patterns from Dave Holle. 00057 ; 00058 ;********************************************************************** 00059 ; 00060 ; Filename: generic_2011.asm 00061 ; Date: 2011 (conaints code developed from 2004 onward. 00062 ; 00063 ; Author: Dwayne Forsyth 00064 ; email: Dwayne@2DKits.com 00065 ; Company: www.2DKits.com 00066 ; 502 Rue Orleanais 00067 ; Deer Park, IL 60010 00068 ; 00069 ; Help from: Dave Holle 00070 ; 00071 ;********************************************************************** 00072 00073 errorlevel -302 ; suppress banking messages 00074 00075 ; '__CONFIG' directive is used to embed configuration data within .asm file. 00076 ; The labels following the directive are located in the respective .inc file. 00077 ; See respective data sheet for additional information on configuration word. 00078 00079 ; this SIM_DEBUG disables the buttons and IR inputs so the code will run the patterns. 00080 ; #define SIM_DEBUG 00081 00082 ;---------------------------------------------------- 00083 ; Select 1 board config! 00084 ;---------------------------------------------------- 00085 ;#define RGB4 ; Rom "1" 00086 ;#define RGB4_Common_Cathode ; Rom "2" ; Working 01/02/2012 00087 ;#define BI6 ; Rom "3" ; Working 01/02/2012 00088 ;#define BI6_MONO ; Rom "4" ; Working 01/02/2012 00089 #define BI6_G2 ; Rom "W" ; Working 07/02/2012 00090 ;#define BI6_G2_MONO ; Rom "X" ; Working 07/02/2012 00091 ;#define BI6_BADGE ; Rom "5" 00092 ;#define BI6_BADGE_MONO ; Rom "6" 00093 ;#define S19 ; Rom "7" ; Working 01/02/2012 00094 ;#define C19 ; Rom "8" ; Working 01/04/2012 00095 ;#define C19_MONO ; Rom "9" 00096 ; 5x7 Mono ; Rom "0" 00097 ; 5x7 ; Rom "10" 00098 ;#define D10 00099 ;#define M3X3 ; Rom "E" 00100 ;#define M3X3_MONO ; Rom "F" 00101 ;#define SRGB ; Rom "G" 00102 ;#define SRGB_Common_Cathode ; Rom "H" 00103 ;#define M8X16 ; Rom "J" 00104 ;#define C12 ; Rom "M" 00105 ;#define C12_MONO ; Rom "L" 00106 ;#define C12_SINGLE ; Rom "K" MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 3 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00107 ;#define C12_SINGLE_MONO ; Rom "P" 00108 ;#define GATOR ; Rom "Q" ; Working 08/02/2011 00109 ;#define BI6_DOGTAG ; Rom "R" ; Working 08/02/2011 00110 ;#define BI6_DOGTAG_MONO ; Rom "S" ; Working 08/02/2011 00111 ;#define RGB2_DOGTAG ; Rom "T" ; Working 08/02/2011 00112 ;#define RGB_4x4x4 ; Rom K13 ; Working 08/01/2012 00113 ;#define RGB_4x4 ; Rom K12 ; Working 08/01/2012 00114 ;#define ROCKET ; Rom U ; Proto Working 08/02/2011 00115 ;#define BADGE_G2 ; Rom ? ; Proto /w 3 patterns 03/01/2012 00116 ;---------------------------------------------------- 00117 00118 ;********************************* 00119 ; 4RBG /w common anode (ufo and clear 5mm) 00120 ;********************************* 00121 00122 #ifdef RGB4 00123 #define PATTERN1 00124 #define PATTERN2 00125 #define PATTERN3 00126 #define PATTERN4 00127 #define PATTERN20 00128 #define DISPLAY_1BIT_C 00129 #define DISPLAY_2BIT_C 00130 #define ENABLE_IR 00131 #include ; processor specific variable definitions 00132 LIST P=P12F1822 00133 NUM_TAB equ d'14' ;highest pattern table number 00134 STROBE_LINES equ 0x04 00135 DELAYTIMER equ 0x36 00136 #endif 00137 00138 ;********************************* 00139 ; 4RBG /w common Cathode (milk 5mm and 10mm) 00140 ;********************************* 00141 00142 #ifdef RGB4_Common_Cathode 00143 #define RGB4 00144 #define Common_Cathode 00145 #define PATTERN1 00146 #define PATTERN2 00147 #define PATTERN3 00148 #define PATTERN4 00149 #define PATTERN20 00150 #define DISPLAY_1BIT_C 00151 #define DISPLAY_2BIT_C 00152 #define ENABLE_IR 00153 #include ; processor specific variable definitions 00154 LIST P=P12F1822 00155 NUM_TAB equ d'14' ;highest pattern table number 00156 STROBE_LINES equ 0x04 00157 DELAYTIMER equ 0x36 00158 #endif 00159 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 4 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00160 ;********************************* 00161 ; D10 12 LEDs. 00162 ;********************************* 00163 00164 #ifdef D10 00165 #define BIN2LED 00166 #define PATTERN1 00167 #define PATTERN3 00168 #define FLIPBYTE 00169 #define DEDICATED_BUTTON 00170 #define DEDICATED_BUTTON2 00171 #define DISPLAY_1BIT_I 00172 #define DISPLAY_2BIT_C 00173 #include ; processor specific variable definitions 00174 LIST P=PIC12F683 00175 NUM_TAB equ d'14' ;highest pattern table number 00176 STROBE_LINES equ 0x04 00177 DELAYTIMER equ 0x0A ; not sure 00178 #endif 00179 00180 ;********************************* 00181 ; 6 BI /w bi-color LEDs. 00182 ;********************************* 00183 00184 #ifdef BI6 00185 #define BIN2LED 00186 #define PATTERN1 00187 #define PATTERN3 00188 #define DISPLAY_1BIT_C 00189 #define DISPLAY_2BIT_C 00190 #define ENABLE_IR 00191 #include ; processor specific variable definitions 00192 LIST P=P12F1822 00193 NUM_TAB equ d'14' ;highest pattern table number 00194 STROBE_LINES equ 0x04 00195 DELAYTIMER equ 0x3A 00196 #endif 00197 00198 ;********************************* 00199 ; 6 BI /w mono LEDs. 00200 ;********************************* 00201 00202 #ifdef BI6_MONO 00203 #define BI6 00204 #define MONO 00205 #define FLIPBYTE 00206 #define PATTERN5 00207 #define PATTERN11 00208 #define DISPLAY_1BIT_A 00209 #define DISPLAY_2BIT_A 00210 #define ENABLE_IR 00211 #include ; processor specific variable definitions 00212 LIST P=P12F1822 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 5 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00213 NUM_TAB equ d'17' ;highest pattern table number 00214 STROBE_LINES equ 0x04 00215 DELAYTIMER equ 0x3A 00216 #endif 00217 00218 ;********************************* 00219 ; 6 BI /w bi-color LEDs. 00220 ;********************************* 00221 00222 #ifdef BI6_G2 00223 #define BI6 00224 #define BIN2LED 00225 #define PATTERN1 00226 #define PATTERN3 00227 #define DISPLAY_1BIT_C 00228 #define DISPLAY_2BIT_C 00229 #define ENABLE_IR 00230 #include ; processor specific variable definitions 00001 LIST 00002 00003 ;========================================================================== 00004 ; MPASM PIC12F1822 processor include 00005 ; 00006 ; (c) Copyright 1999-2012 Microchip Technology, All rights reserved 00007 ;========================================================================== 00008 01035 LIST Warning[215]: Processor superseded by command line. Verify processor symbol. 00231 LIST P=P12F1822 0000000E 00232 NUM_TAB equ d'14' ;highest pattern table number 00000004 00233 STROBE_LINES equ 0x04 0000003A 00234 DELAYTIMER equ 0x3A 00235 #endif 00236 00237 ;********************************* 00238 ; 6 BI /w mono LEDs. 00239 ;********************************* 00240 00241 #ifdef BI6_G2_MONO 00242 #define BI6 00243 #define BI6_G2 00244 #define MONO 00245 #define FLIPBYTE 00246 #define PATTERN5 00247 #define PATTERN11 00248 #define DISPLAY_1BIT_A 00249 #define DISPLAY_2BIT_A 00250 #define ENABLE_IR 00251 #include ; processor specific variable definitions 00252 LIST P=P12F1822 00253 NUM_TAB equ d'17' ;highest pattern table number 00254 STROBE_LINES equ 0x04 00255 DELAYTIMER equ 0x3A MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 6 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00256 #endif 00257 00258 ;********************************* 00259 ; badge 6 bi-color plus 1 mono LEDs. 00260 ;********************************* 00261 00262 #ifdef BI6_BADGE 00263 #define BI6 00264 #define BIN2LED 00265 #define PATTERN10 00266 #define PATTERN3 00267 #define BADGE 00268 #define DISPLAY_1BIT_C 00269 #define DISPLAY_2BIT_C 00270 #include ; processor specific variable definitions 00271 LIST P=P12F1822 00272 NUM_TAB equ d'14' ;highest pattern table number 00273 STROBE_LINES equ 0x04 00274 DELAYTIMER equ 0x3A 00275 #endif 00276 00277 ;********************************* 00278 ; badge 6 mono LEDs. 00279 ;********************************* 00280 00281 #ifdef BI6_BADGE_MONO 00282 #define BI6 00283 #define MONO 00284 #define BADGE 00285 #define PATTERN5 00286 #define PATTERN11 00287 #define FLIPBYTE 00288 #define DISPLAY_1BIT_A 00289 #define DISPLAY_2BIT_A 00290 #include ; processor specific variable definitions 00291 LIST P=P12F1822 00292 NUM_TAB equ d'19' ;highest pattern table number 00293 STROBE_LINES equ 0x04 00294 DELAYTIMER equ 0x3A 00295 #endif 00296 00297 ;#define DREW ; special pattern in EEProm for Drew 00298 00299 ;********************************* 00300 ; 19 LED Stick 00301 ;********************************* 00302 00303 #ifdef S19 00304 #define PATTERN6 00305 #define PATTERN7 00306 #define PATTERN8 00307 #define FLIPBYTE 00308 #define DISPLAY_1BIT_D MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 7 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00309 #define ENABLE_IR 00310 #include ; processor specific variable definitions 00311 LIST P=P12F1822 00312 NUM_TAB equ d'23' ;highest pattern table number 00313 STROBE_LINES equ 0x05 00314 DELAYTIMER equ 0x3A 00315 #endif 00316 00317 ;********************************* 00318 ; 19 Circle bicolor 00319 ;********************************* 00320 00321 #ifdef C19 00322 #define PATTERN9 00323 #define PATTERN12 00324 #define PATTERN13 00325 #define BIN2LED 00326 #define RANDOM 00327 #define DEDICATED_BUTTON 00328 #define DISPLAY_1BIT_B 00329 #define DISPLAY_2BIT_D 00330 #define ENABLE_IR 00331 #include ; processor specific variable definitions 00332 LIST P=PIC16F1824 00333 NUM_TAB equ d'25' ;highest pattern table number 00334 STROBE_LINES equ 0x07 00335 DELAYTIMER equ 0x18 00336 #endif 00337 00338 ;********************************* 00339 ; 19 Circle mono 00340 ;********************************* 00341 00342 #ifdef C19_MONO 00343 #define MONO 00344 #define C19 00345 #define PATTERN9 00346 #define PATTERN12 00347 #define PATTERN14 00348 #define RANDOM 00349 #define BIN2LED 00350 #define DEDICATED_BUTTON 00351 #define DISPLAY_1BIT_B 00352 #define DISPLAY_2BIT_E 00353 #define ENABLE_IR 00354 #include ; processor specific variable definitions 00355 LIST P=PIC16F688 00356 NUM_TAB equ d'25' ;highest pattern table number 00357 STROBE_LINES equ 0x07 00358 DELAYTIMER equ 0x18 00359 #endif 00360 00361 ;********************************* MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 8 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00362 ; 3x3 matrix Bi-color 00363 ;********************************* 00364 00365 #ifdef M3X3 00366 #define PATTERN6 00367 #define PATTERN19 00368 #define PATTERN21 00369 #define BIN2LED 00370 #define DISPLAY_1BIT_F 00371 #define ENABLE_IR 00372 #define MULTIBUTTON 00373 #define RANDOM 00374 #include ; processor specific variable definitions 00375 LIST P=PIC12F683 00376 NUM_TAB equ d'14' ;highest pattern table number 00377 STROBE_LINES equ 0x05 00378 DELAYTIMER equ 0x2E 00379 #endif 00380 00381 ;********************************* 00382 ; 3x3 matrix mono 00383 ;********************************* 00384 00385 #ifdef M3X3_MONO 00386 #define M3X3 00387 #define MONO 00388 #define PATTERN6 00389 #define PATTERN19 00390 #define PATTERN21 00391 #define BIN2LED 00392 #define DISPLAY_1BIT_F 00393 #define ENABLE_IR 00394 #define MULTIBUTTON 00395 #define RANDOM 00396 #include ; processor specific variable definitions 00397 LIST P=PIC12F683 00398 NUM_TAB equ d'14' ;highest pattern table number 00399 STROBE_LINES equ 0x05 00400 DELAYTIMER equ 0x2E 00401 #endif 00402 00403 ;********************************* 00404 ; RGB Stick (new UFO 00405 ;********************************* 00406 00407 #ifdef SRGB 00408 #define PATTERN15 00409 #define PATTERN16 00410 #define PATTERN17 00411 #define PATTERN18 00412 #define DEDICATED_BUTTON 00413 #define DEDICATED_BUTTON2 00414 #define DISPLAY_1BIT_E MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 9 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00415 #define ENABLE_IR 00416 #include ; processor specific variable definitions 00417 LIST P=PIC16F688 00418 NUM_TAB equ d'15' ;highest pattern table number 00419 STROBE_LINES equ 0x07 00420 DELAYTIMER equ 0x18 00421 #endif 00422 00423 ;********************************* 00424 ; RGB Stick 00425 ;********************************* 00426 00427 #ifdef SRGB_Common_Cathode 00428 #define SRGB 00429 #define Common_Cathode 00430 #define PATTERN15 00431 #define PATTERN16 00432 #define PATTERN17 00433 #define PATTERN18 00434 #define DEDICATED_BUTTON 00435 #define DEDICATED_BUTTON2 00436 #define DISPLAY_1BIT_E 00437 #define ENABLE_IR 00438 #include 00439 LIST P=PIC16F688 00440 NUM_TAB equ d'15' ;highest pattern table number 00441 STROBE_LINES equ 0x07 00442 00443 var macro name 00444 name equ mem 00445 mem = mem + 1 00446 DELAYTIMER equ 0x18 00447 #endif 00448 00449 ;********************************* 00450 ; 8x16 Matrix 00451 ;********************************* 00452 00453 #ifdef M8X16 00454 #define PATTERN12 00455 #define PATTERN22 00456 #define PATTERN24 00457 #define PATTERN25 00458 #define PATTERN26 00459 #define BIN2LED 00460 #define RANDOM 00461 #define DEDICATED_BUTTON 00462 #define DISPLAY_1BIT_8x16 00463 ;#define DISPLAY_2BIT_D 00464 #define ENABLE_IR 00465 #include ; processor specific variable definitions 00466 LIST P=PIC16F1936 00467 NUM_TAB equ d'18' ;highest pattern table number MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 10 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00468 STROBE_LINES equ 0x10 00469 DELAYTIMER equ 0x0a 00470 #endif 00471 00472 ;********************************* 00473 ; 24 LED 3D Sphere Bi-color 00474 ;********************************* 00475 00476 #ifdef C12 00477 #define PATTERN23 00478 #define PATTERN27 00479 #define BIN2LED 00480 #define RANDOM 00481 #define DEDICATED_BUTTON 00482 #define DEDICATED_BUTTON2 00483 #define DISPLAY_1BIT_H 00484 #define FLIPBYTE 00485 ;#define DISPLAY_2BIT_D 00486 #define ENABLE_IR 00487 #include ; processor specific variable definitions 00488 LIST P=PIC16F1936 00489 FSR EQU FSR0L 00490 NUM_TAB equ d'14' ;highest pattern table number 00491 STROBE_LINES equ 0x06 00492 DELAYTIMER equ 0x14 00493 #endif 00494 00495 ;********************************* 00496 ; 24 LED 3D Sphere Mono 00497 ;********************************* 00498 00499 #ifdef C12_MONO 00500 #define C12 00501 #define MONO 00502 #define PATTERN23 00503 #define PATTERN27 00504 #define BIN2LED 00505 #define RANDOM 00506 #define DEDICATED_BUTTON 00507 #define DEDICATED_BUTTON2 00508 #define DISPLAY_1BIT_H 00509 #define FLIPBYTE 00510 ;#define DISPLAY_2BIT_D 00511 #define ENABLE_IR 00512 ;#include ; old chip 00513 ; LIST P=PIC16F886 ; old chip 00514 #include ; processor specific variable definitions 00515 LIST P=PIC16F1936 00516 FSR EQU FSR0L 00517 NUM_TAB equ d'14' ;highest pattern table number 00518 STROBE_LINES equ 0x06 00519 DELAYTIMER equ 0x14 00520 #endif MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 11 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00521 00522 ;********************************* 00523 ; 12 Single Bi-color Circle 00524 ;********************************* 00525 00526 #ifdef C12_SINGLE 00527 #define C12 00528 #define SINGLE 00529 #define PATTERN23 00530 #define PATTERN27 00531 #define BIN2LED 00532 #define RANDOM 00533 #define DEDICATED_BUTTON 00534 #define DEDICATED_BUTTON2 00535 #define DISPLAY_1BIT_H 00536 #define FLIPBYTE 00537 ;#define DISPLAY_2BIT_D 00538 #define ENABLE_IR 00539 ;#include ; old chip 00540 ; LIST P=PIC16F886 ; old chip 00541 #include ; processor specific variable definitions 00542 LIST P=PIC16F1936 00543 FSR EQU FSR0L 00544 NUM_TAB equ d'14' ;highest pattern table number 00545 STROBE_LINES equ 0x06 00546 DELAYTIMER equ 0x14 00547 #endif 00548 00549 ;********************************* 00550 ; 12 Single Mono Circle 00551 ;********************************* 00552 00553 #ifdef C12_SINGLE_MONO 00554 #define C12 00555 #define SINGLE 00556 #define MONO 00557 #define PATTERN23 00558 #define PATTERN27 00559 #define BIN2LED 00560 #define RANDOM 00561 #define DEDICATED_BUTTON 00562 #define DEDICATED_BUTTON2 00563 #define DISPLAY_1BIT_H 00564 #define FLIPBYTE 00565 ;#define DISPLAY_2BIT_D 00566 #define ENABLE_IR 00567 #include ; processor specific variable definitions 00568 LIST P=PIC16F1936 00569 FSR EQU FSR0L 00570 NUM_TAB equ d'14' ;highest pattern table number 00571 STROBE_LINES equ 0x06 00572 DELAYTIMER equ 0x14 00573 #endif MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 12 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00574 00575 00576 ;********************************* 00577 ; GATOR 00578 ;********************************* 00579 00580 #ifdef GATOR 00581 #define PATTERN6 00582 #define PATTERN28 00583 #define FLIPBYTE 00584 #define DISPLAY_1BIT_GATOR 00585 #define ENABLE_IR 00586 #include ; processor specific variable definitions 00587 LIST P=PIC12F1822 00588 NUM_TAB equ d'08' ;highest pattern table number 00589 STROBE_LINES equ 0x05 00590 DELAYTIMER equ 0x30 00591 #endif 00592 00593 ;********************************* 00594 ; ROCKET 00595 ;********************************* 00596 00597 #ifdef ROCKET 00598 #define PATTERN6 00599 #define PATTERN29 00600 #define FLIPBYTE 00601 #define DISPLAY_1BIT_ROCKET 00602 #define ENABLE_IR 00603 #include ; processor specific variable definitions 00604 LIST P=PIC12F1822 00605 NUM_TAB equ d'08' ;highest pattern table number 00606 STROBE_LINES equ 0x05 00607 DELAYTIMER equ 0x30 00608 #endif 00609 00610 ;********************************* 00611 ; 6 bi dogtag 00612 ;********************************* 00613 00614 #ifdef BI6_DOGTAG 00615 #define BIN2LED 00616 #define PATTERN1 00617 #define PATTERN3 00618 #define DISPLAY_1BIT_C 00619 #define DISPLAY_2BIT_C 00620 #include ; processor specific variable definitions 00621 LIST P=PIC12F1822 00622 NUM_TAB equ d'14' ;highest pattern table number 00623 STROBE_LINES equ 0x04 00624 DELAYTIMER equ 0x3a 00625 #endif 00626 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 13 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00627 ;********************************* 00628 ; 6 bi dogtag MONO 00629 ;********************************* 00630 00631 #ifdef BI6_DOGTAG_MONO 00632 #define MONO 00633 #define BI6_DOGTAG 00634 #define BIN2LED 00635 #define PATTERN1 00636 #define PATTERN3 00637 #define DISPLAY_1BIT_C 00638 #define DISPLAY_2BIT_C 00639 #include ; processor specific variable definitions 00640 LIST P=PIC12F1822 00641 NUM_TAB equ d'14' ;highest pattern table number 00642 STROBE_LINES equ 0x04 00643 DELAYTIMER equ 0x3a 00644 #endif 00645 00646 ;********************************* 00647 ; 2RGB DogTag 00648 ;********************************* 00649 00650 #ifdef RGB2_DOGTAG 00651 #define PATTERN1 00652 #define PATTERN2 00653 #define PATTERN3 00654 #define PATTERN4 00655 #define PATTERN20 00656 #define DISPLAY_1BIT_C 00657 #define DISPLAY_2BIT_C 00658 #define FLIPBYTE 00659 #include ; processor specific variable definitions 00660 LIST P=PIC12F1822 00661 NUM_TAB equ d'14' ;highest pattern table number 00662 STROBE_LINES equ 0x03 00663 DELAYTIMER equ 0x3a 00664 #endif 00665 00666 ;********************************* 00667 ; Badge G2 00668 ;********************************* 00669 00670 #ifdef BADGE_G2 00671 #define Common_Cathode 00672 #define PATTERN6 00673 #define PATTERN30 00674 ;#define PATTERN17 00675 ;#define PATTERN18 00676 #define DISPLAY_1BIT_BADGE_G2 00677 #include ; processor specific variable definitions 00678 LIST P=PIC16F1824 00679 NUM_TAB equ d'2' ;highest pattern table number MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 14 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00680 STROBE_LINES equ 0x06 00681 DELAYTIMER equ 0x18 00682 #endif 00683 00684 ;********************************* 00685 ; 4x4x4 cube 00686 ;********************************* 00687 00688 #ifdef RGB_4x4x4 00689 #define PATTERN31 00690 #define PATTERN32 00691 #define RANDOM 00692 #define DEDICATED_BUTTON 00693 ; #define LONGER_DELAY 00694 #define BIN2LED 00695 #define DISPLAY_1BIT_4x4x4 00696 ; #define ENABLE_IR 00697 #include ; processor specific variable definitions 00698 LIST P=PIC16F1936 00699 NUM_TAB equ d'6' ;highest pattern table number 00700 STROBE_LINES equ 0x08 00701 DELAYTIMER equ 0x08 00702 #endif 00703 00704 00705 00706 ; '__CONFIG' directive is used to embed configuration data within .asm file. 00707 ; The labels following the directive are located in the respective .inc file. 00708 ; See respective data sheet for additional information on configuration word. 00709 00710 #ifdef __12F1822 8007 E984 00711 __CONFIG _CONFIG1, _CLKOUTEN_OFF & _FCMEN_ON & _IESO_OFF & _BOREN_OFF & _CPD_OFF & _CP_OFF & _MCL RE_OFF & _PWRTE_ON & _WDTE_OFF & _FOSC_INTOSC 8008 DEFF 00712 __CONFIG _CONFIG2, _WRT_OFF & _BORV_19 & _PLLEN_OFF & _STVREN_ON & _LVP_OFF 00713 #else 00714 #ifdef __16F1936 00715 __CONFIG _CONFIG1, _CLKOUTEN_OFF & _FCMEN_ON & _IESO_OFF & _BOREN_OFF & _CPD_OFF & _CP_OFF & _MCL RE_OFF & _PWRTE_ON & _WDTE_OFF & _FOSC_INTOSC 00716 __CONFIG _CONFIG2, _WRT_OFF & _BORV_19 & _PLLEN_OFF & _STVREN_ON & _LVP_OFF 00717 #else 00718 #ifdef __16F1938 00719 __CONFIG _CONFIG1, _CLKOUTEN_OFF & _FCMEN_ON & _IESO_OFF & _BOREN_OFF & _CPD_OFF & _CP_OFF & _MCL RE_OFF & _PWRTE_ON & _WDTE_OFF & _FOSC_INTOSC 00720 __CONFIG _CONFIG2, _WRT_OFF & _BORV_19 & _PLLEN_OFF & _STVREN_ON & _LVP_OFF 00721 #else 00722 #ifdef __16F1824 00723 __CONFIG _CONFIG1, _CLKOUTEN_OFF & _FCMEN_ON & _IESO_OFF & _BOREN_OFF & _CPD_OFF & _CP_OFF & _MCL RE_OFF & _PWRTE_ON & _WDTE_OFF & _FOSC_INTOSC 00724 __CONFIG _CONFIG2, _WRT_OFF & _BORV_19 & _PLLEN_OFF & _STVREN_ON & _LVP_OFF 00725 #else 00726 error 'Non Supported PIC chip' 00727 #endif 00728 #endif MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 15 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00729 #endif 00730 #endif 00731 00732 00733 00734 ;********************************************************************** 00735 ; Macros 00736 ;********************************************************************** 00737 00000020 00738 mem = 20 0000007F 00739 mem2 = 0x7F 000000A0 00740 mem3 = 0xa0 00741 #include macros.asm 00001 ;********************************************************************** 00002 ; Macros 00003 ;********************************************************************** 00004 00005 var macro name 00006 name equ mem 00007 mem = mem + 1 00008 if (mem >= mem2) 00009 error 'Too much var space used' 00010 endif 00011 endm 00012 00013 dupvar macro name, name2 00014 name equ name2 00015 endm 00016 00017 var_all_bank macro name 00018 name equ mem2 00019 mem2 = mem2 - 1 00020 if (mem >= mem2) 00021 error 'Too much var space used' 00022 endm 00023 000000A0 00024 mem3 = 0xa0 00025 var_bank2 macro name 00026 name equ mem3 00027 mem3 = mem3 + 1 00028 if (mem3 >= 0xef) 00029 error 'Too much var space used' 00030 endm 00031 00000000 00032 patternc = 0 00033 start_pattern macro typem, delaym 00034 00035 table#v(patternc) 00036 if (typem == 1) || (typem == 6) || (typem == 0x15) || (typem == 0x1c)|| (typem == 0x1d)||(typem == 0 x01e) 00037 leng = (endpat#v(patternc)-$-3)/3 ;tbltype1,speed,length 00038 else 00039 if (typem == 3) || (typem == 0x0b) || (typem == 0x10) || (typem == 0x13) || (typem == 0x14)|| (typem MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 16 LOC OBJECT CODE LINE SOURCE TEXT VALUE == 0x18) 00040 leng = (endpat#v(patternc)-$-3)/2 ;tbltype1,speed,length 00041 else 00042 if (typem == 9) || (typem == 0x0e) 00043 leng =(endpat#v(patternc)-$-3)/5 ;tbltype1,speed,length 00044 else 00045 if (typem == 0x0a) 00046 leng =(endpat#v(patternc)-$-3)/4 ;tbltype1,speed,length 00047 else 00048 if (typem == 0x0d) 00049 leng =(endpat#v(patternc)-$-3)/(9+1) ;tbltype1,speed,length 00050 else 00051 if (typem == 0x0f) || (typem == 0x12)|| (typem == 0x17)||(typem == 0x1b) 00052 leng =(endpat#v(patternc)-$-3)/(6) ;tbltype1,speed,length 00053 else 00054 if (typem == 0x11) 00055 leng = (endpat#v(patternc)-$-3)/(9+4) ;tbltype1,speed,length 00056 else 00057 if (typem == 0x16) || (typem == 0x1a) 00058 leng = (endpat#v(patternc)-$-3)/0x20 ;tbltype1,speed,length 00059 else 00060 if (typem == 0x1f) 00061 leng = (endpat#v(patternc)-$-3)/0x18 ;tbltype1,speed,length 00062 else 00063 if (typem == 0x20) 00064 leng = (endpat#v(patternc)-$-3)/0x19 ;tbltype1,speed,length 00065 else 00066 leng =(endpat#v(patternc)-$-3) 00067 endif 00068 endif 00069 endif 00070 endif 00071 endif 00072 endif 00073 endif 00074 endif 00075 endif 00076 endif 00077 expand 00078 if ($ < 0x2100) 00079 dt typem,delaym,(leng) 00080 else 00081 de typem,delaym,(leng) 00082 endif 00083 endm 00084 00085 storedata macro stuff 00086 if ($ < 0x2100) 00087 dt stuff 00088 else 00089 de stuff 00090 endif 00091 endm MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 17 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00092 00093 end_pattern macro 00094 endpat#v(patternc) 00095 patternc = patternc + 1 00096 endm 00097 00098 mult_nop macro nup_count 00099 local i = nup_count 00100 while i > 3 00101 call Lcontinue ;4 cycles 00102 i -= 4 00103 endw 00104 while i > 1 00105 goto $+1 ;2 cycles 00106 i -= 2 00107 endw 00108 if i > 0 00109 nop ;1 cycle 00110 endif 00111 endm 00112 00113 LedOut macro word,reg_dir,port 00114 movfw TMR0 00115 subwf word,w 00116 btfss STATUS,C 00117 bsf reg_dir, port 00118 endm 00119 00120 LedOutInd macro word,reg_dir,port 00121 movlw low word 00122 movwf FSR0L ; set indirect pointer to word 00123 movlw high word 00124 movwf FSR0H ; set indirect pointer to word 00125 movfw TMR0 00126 subwf INDF0,w 00127 btfss STATUS,C 00128 bsf reg_dir, port 00129 endm 00130 00131 ; Indirect Paged 00132 LedOutIndP macro page,word,reg_dir,port 00133 if (page == 0) 00134 bcf STATUS,IRP 00135 else 00136 bsf STATUS,IRP 00137 endif 00138 movlw (word & 0xff) 00139 movwf FSR ; set indirect pointer to word 00140 movfw TMR0 00141 subwf INDF,w 00142 btfss STATUS,C 00143 bsf reg_dir, port 00144 endm MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 18 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00145 00146 LedOutL macro word,reg_dir,port 00147 swapf word,w 00148 movwf temp4 00149 movfw TMR0 00150 subwf temp4,w 00151 btfss STATUS,C 00152 bsf reg_dir, port 00153 endm 00154 00155 LedOutH macro word,reg_dir,port 00156 nop 00157 nop 00158 movfw TMR0 00159 subwf word,w 00160 btfss STATUS,C 00161 bsf reg_dir, port 00162 endm 00163 00164 state_tbl macro num,zero,one,flag 00165 Lstate#v(num) 00166 #ifndef MULTIBUTTON 00167 if (flag == 0) 00168 bcf button,0 00169 movlw 0x30 00170 movwf butcount 00171 endif 00172 if (flag == 1) 00173 bsf button,0 00174 endif 00175 #endif 00176 btfsc IR_in,0 00177 goto Lstate#v(num)a 00178 00179 movlw zero 00180 movwf instate 00181 00182 goto Lcontinue 00183 00184 Lstate#v(num)a 00185 movlw one 00186 movwf instate 00187 00188 goto Lcontinue 00189 endm 00190 00191 state2_tbl macro num, name, offset 00192 Lstate#v(num) 00193 ; save the 1st half of word 00194 movf IR_in,w ; save 1st half 00195 movwf IR_lhalf 00196 incf instate,f 00197 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 19 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00198 goto Lcontinue 00199 00200 Lstate#v(num+1) 00201 ; save the 2nd half of word 00202 ; check for protocal error should get 01 or 10 00203 movf IR_lhalf,w 00204 xorwf IR_in,w 00205 btfss STATUS,Z 00206 goto Lstate#v(num+1)a 00207 clrf instate ; error state = zero 00208 00209 goto Lcontinue 00210 00211 ; set the correct bit in output vars. 00212 Lstate#v(num+1)a 00213 btfsc IR_in,0 00214 bcf name,offset 00215 btfss IR_in,0 00216 bsf name,offset 00217 00218 incf instate,f 00219 goto Lcontinue 00220 endm 00221 00222 entry macro a0,a1,a2 00223 dt a0,a1,a2 00224 endm 00225 00226 tbltype1 macro speed,length 00227 if (length > 2) & (length < d'256') 00228 dt 0x01,speed,length 00229 else 00230 error 'pattern length must be > 2 and < 256' 00231 endif 00232 endm 00233 00234 make_mtab macro numtab 00235 local i = 0 00236 while i <= numtab 00237 dt HIGH table#v(i), LOW table#v(i) 00238 i += 1 00239 endw 00240 endm 00241 00242 make_state_jump_table macro max_state 00243 local i = 0 00244 while i <= max_state 00245 dt HIGH Lstate#v(i), LOW Lstate#v(i) 00246 i += 1 00247 endw 00248 endm 00249 00742 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 20 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00743 00744 ; ++-------- A7 A6 unimplemented (0) 00745 ; || +------ A4 IR LED output (0) 00746 ; || |+----- A3 detector/button input (1) 00747 ; || || 00748 ; b'00101111' ;set LED matrix pins to input (tri-stated) 00749 ; | ||| 00750 ; +--+++-- LED matrix on A5 A2 A1 A0 (1) 00751 00752 ;********************************************************************** 0000 00753 ORG 0x000 ; processor reset vector 00754 ;********************************************************************** 0000 2C31 00755 goto main ; go to beginning of program 00756 00757 ;********************************************************************** 0004 00758 ORG 0x004 ; interrupt vector location 00759 ;********************************************************************** 00760 00761 var nextf ; flags for timing loops 00000020 M nextf equ mem 00000021 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00762 ; bit 0 is one display cycle (890 usec) 00763 ; bit 1 is about 1 minute 00764 var dcycle ; stobe counter [0-3] 00000021 M dcycle equ mem 00000022 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00765 var count1 ; lower bit counter 00000022 M count1 equ mem 00000023 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00766 var count2 ; higher bit counter. 00000023 M count2 equ mem 00000024 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00767 00768 0004 00769 here 00770 #ifndef __12F1822 00771 PAGESEL here ; DDF 00772 #endif 00773 ; 00774 ; set tick interupt to 889ms for IR RC5 protocal 1/2 digit. 00775 ; an Interupt every 889us /w 8mhz internal osc MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 21 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00776 ; 00777 00778 #define TICK_VALUE D'35' 00779 0004 0020 00780 BANKSEL TMR0 0005 3023 00781 movlw TICK_VALUE 0006 0095 00782 movwf TMR0 00783 ; 00784 ; increment the stobe and duration counters 00785 ; 0007 0AA1 00786 incf dcycle,f 00787 0008 3004 00788 movlw STROBE_LINES 0009 0221 00789 subwf dcycle,w 000A 1803 00790 btfsc STATUS,C 000B 01A1 00791 clrf dcycle 00792 000C 1420 00793 bsf nextf,0 00794 000D 0FA2 00795 incfsz count1,f 000E 2812 00796 goto skip1 00797 000F 0FA3 00798 incfsz count2,f 0010 2812 00799 goto skip1 00800 00801 #ifdef LONGER_DELAY 00802 var count3 00803 incfsz count3,f 00804 goto skip1 00805 #endif 00806 0011 14A0 00807 bsf nextf,1 00808 0012 00809 skip1 00810 0012 0849 00811 movf scount,w ; F22 0013 3E00 00812 addlw 0 ; F23 0014 1903 00813 btfsc STATUS,Z ; F24 0015 282C 00814 goto send_nothing ; F25 00815 0016 1C3A 00816 btfss tx_1,0 ; F26 0017 282A 00817 goto send_zero ; F27 00818 00819 ;-------------------------------------------------------------------------------------- 0018 00820 send_one ; we are slaming the 36K IR siginal, its like a busy wait! 00821 ;-------------------------------------------------------------------------------------- 00822 var repeat 00000024 M repeat equ mem 00000025 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00823 #ifdef GATOR MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 22 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00824 BANKSEL TRISA 00825 movlw b'00011010' ;set A4 & A5 led to output 00826 movwf TRISA 00827 BANKSEL 0 00828 #define IRBIT 4 00829 #define IRPORT PORTA 00830 #else 00831 #ifdef S19 00832 banksel TRISA 00833 movlw b'00011010' ;set A0 & A5 led to output 00834 movwf TRISA 00835 banksel PORTA 00836 #define IRBIT 0 00837 #define IRPORT PORTA 00838 #else 00839 #ifdef C12 00840 BANKSEL TRISB 00841 movlw b'11011011' ;set B2 & B5 led to output 00842 movwf TRISB 00843 BANKSEL PORTB 00844 #define IRBIT 2 00845 #define IRPORT PORTB 00846 #else 00847 #ifdef M8X16 00848 #define IRBIT 1 00849 #define IRPORT PORTC 00850 #else 00851 #ifdef M3X3 00852 setbank1 00853 movlw b'00111001' ;set A1 & A2 led to output 00854 movwf TRISA 00855 setbank0 00856 #define IRBIT 1 00857 #define IRPORT PORTA 00858 #else 00859 #ifdef SRGB 00860 #define IRBIT 1 00861 #define IRPORT PORTA 00862 #else 00863 #define IRBIT 4 00864 #define IRPORT PORTA 00865 #endif 00866 #endif 00867 #endif 00868 #endif 00869 #endif 00870 #endif 00871 0018 018C 00872 clrf IRPORT 0019 160C 00873 bsf IRPORT,IRBIT ; A01 00874 001A 2205 00875 call get_next_tx_bit ; 2 + 11 cycles A04-A16 00876 ; mult_nop d'9' ; A17-A25 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 23 LOC OBJECT CODE LINE SOURCE TEXT VALUE 001B 3001 00877 movlw 01h 001C 220F 00878 call qdelay ; 6 + (1 * 3) = 9 ; A17-A25 001D 0000 00879 nop 00880 001E 301E 00881 movlw 0x1E ; C26 (23) 001F 00A4 00882 movwf repeat ; C27 0020 00883 repeat_loop 0020 120C 00884 bcf IRPORT,IRBIT ; D01 00885 00886 ; mult_nop d'26' ; D02-D27 0021 3007 00887 movlw 07h 0022 220F 00888 call qdelay ; 6 + (7 * 3) = 27 ; D02-D27 00889 0023 160C 00890 bsf IRPORT,IRBIT ; E01 (27) 00891 00892 ; mult_nop d'23' ; E02-E24 0024 3006 00893 movlw 06h ; 6+(6 * 3) = 22 ; E02-E24 0025 220F 00894 call qdelay 00895 0026 0BA4 00896 decfsz repeat,f ; E25 (24) 0027 2820 00897 goto repeat_loop ; E26/E27 00898 0028 120C 00899 bcf IRPORT,IRBIT 0029 2844 00900 goto exit_tx 00901 00902 ;-------------------------------------------------------------------------------------- 002A 00903 send_zero ; we are going to release all the CPU time to the main line for display. 00904 ;-------------------------------------------------------------------------------------- 00905 002A 2205 00906 call get_next_tx_bit ; 2 + 11 cycles A04-A16 002B 282D 00907 goto drive_main_leds 00908 00909 ;-------------------------------------------------------------------------------------- 002C 00910 send_nothing ; Drive the main LEDs. 00911 ;-------------------------------------------------------------------------------------- 00912 00913 002C 21FA 00914 call read_ir_in 00915 #ifdef DEDICATED_BUTTON 00916 call read_button_in 00917 #endif 00918 ; goto drive_main_leds 00919 00920 ;-------------------------------------------------------------------------------------- 002D 00921 drive_main_leds ; Drive the main LEDs. 00922 ;-------------------------------------------------------------------------------------- 00923 var fcount 00000025 M fcount equ mem 00000026 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00924 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 24 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00925 #include 00001 ;-------------------------------------------------------------------------------------- 00002 ; Define LED status storage vars 00003 ;-------------------------------------------------------------------------------------- 00004 00005 #ifndef ROCKET 00006 #ifndef GATOR 00007 #ifndef S19 00008 #ifndef C19 00009 #ifndef SRGB 00010 #ifndef M3X3 00011 #ifndef M8X16 00012 #ifndef RGB_4x4x4 00013 #ifndef C12 00014 var Ar_reg 00000026 M Ar_reg equ mem 00000027 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00015 var Ag_reg 00000027 M Ag_reg equ mem 00000028 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00016 var Ab_reg 00000028 M Ab_reg equ mem 00000029 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00017 var Br_reg 00000029 M Br_reg equ mem 0000002A M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00018 var Bg_reg 0000002A M Bg_reg equ mem 0000002B M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00019 var Bb_reg 0000002B M Bb_reg equ mem 0000002C M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00020 var Cr_reg 0000002C M Cr_reg equ mem 0000002D M mem = mem + 1 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 25 LOC OBJECT CODE LINE SOURCE TEXT VALUE M if (mem >= mem2) M error 'Too much var space used' M endif 00021 var Cg_reg 0000002D M Cg_reg equ mem 0000002E M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00022 var Cb_reg 0000002E M Cb_reg equ mem 0000002F M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00023 var Dr_reg 0000002F M Dr_reg equ mem 00000030 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00024 var Dg_reg 00000030 M Dg_reg equ mem 00000031 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00025 var Db_reg 00000031 M Db_reg equ mem 00000032 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00026 #endif 00027 #endif 00028 #endif 00029 #endif 00030 #endif 00031 #endif 00032 #endif 00033 #endif 00034 #endif 00035 00036 #ifdef BADGE 00037 var Center_reg 00038 #endif 00039 #ifdef M3X3 00040 var A0_A1_reg 00041 var A0_A2_reg 00042 var A0_A4_reg 00043 var A0_A5_reg 00044 var A1_A0_reg 00045 var A1_A2_reg MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 26 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00046 var A1_A4_reg 00047 var A1_A5_reg 00048 var A2_A0_reg 00049 var A2_A1_reg 00050 var A2_A4_reg 00051 var A2_A5_reg 00052 var A4_A0_reg 00053 var A4_A1_reg 00054 var A4_A2_reg 00055 var A4_A5_reg 00056 var A5_A0_reg 00057 var A5_A1_reg 00058 var A5_A2_reg 00059 var A5_A4_reg 00060 #endif 00061 #ifdef S19 00062 var A0_A1_reg 00063 var A0_A2_reg 00064 var A0_A4_reg 00065 var A0_A5_reg 00066 var A1_A0_reg 00067 var A1_A2_reg 00068 var A1_A4_reg 00069 var A1_A5_reg 00070 var A2_A0_reg 00071 var A2_A1_reg 00072 var A2_A4_reg 00073 var A2_A5_reg 00074 var A4_A0_reg 00075 var A4_A1_reg 00076 var A4_A2_reg 00077 var A4_A5_reg 00078 var A5_A0_reg 00079 var A5_A1_reg 00080 var A5_A2_reg 00081 var A5_A4_reg 00082 #endif 00083 #ifdef ROCKET 00084 var A0_A1_reg 00085 var A0_A2_reg 00086 var A0_A4_reg 00087 var A0_A5_reg 00088 var A1_A0_reg 00089 var A1_A2_reg 00090 var A1_A4_reg 00091 var A1_A5_reg 00092 var A2_A0_reg 00093 var A2_A1_reg 00094 var A2_A4_reg 00095 var A2_A5_reg 00096 var A4_A0_reg 00097 var A4_A1_reg 00098 var A4_A2_reg MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 27 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00099 var A4_A5_reg 00100 var A5_A0_reg 00101 var A5_A1_reg 00102 var A5_A2_reg 00103 var A5_A4_reg 00104 #endif 00105 #ifdef BADGE_G2 00106 var A0_A1_reg 00107 var A0_A2_reg 00108 var A0_C0_reg 00109 var A0_C1_reg 00110 var A0_C2_reg 00111 var A1_A0_reg 00112 var A1_A2_reg 00113 var A1_C0_reg 00114 var A1_C1_reg 00115 var A1_C2_reg 00116 var A2_A0_reg 00117 var A2_A1_reg 00118 var A2_C0_reg 00119 var A2_C1_reg 00120 var A2_C2_reg 00121 var C0_A0_reg 00122 var C0_A1_reg 00123 var C0_A2_reg 00124 var C0_C1_reg 00125 var C0_C2_reg 00126 var C1_A0_reg 00127 var C1_A1_reg 00128 var C1_A2_reg 00129 var C1_C0_reg 00130 var C1_C2_reg 00131 var C2_A0_reg 00132 var C2_A1_reg 00133 var C2_A2_reg 00134 var C2_C0_reg 00135 var C2_C1_reg 00136 #endif 00137 #ifdef GATOR 00138 var A0_A1_reg 00139 var A0_A2_reg 00140 var A0_A4_reg 00141 var A0_A5_reg 00142 var A1_A0_reg 00143 var A1_A2_reg 00144 var A1_A4_reg 00145 var A1_A5_reg 00146 var A2_A0_reg 00147 var A2_A1_reg 00148 var A2_A4_reg 00149 var A2_A5_reg 00150 var A4_A0_reg 00151 var A4_A1_reg MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 28 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00152 var A4_A2_reg 00153 var A4_A5_reg 00154 var A5_A0_reg 00155 var A5_A1_reg 00156 var A5_A2_reg 00157 var A5_A4_reg 00158 #endif 00159 #ifdef C19 00160 var_bank2 A0_A1_reg 00161 var_bank2 A0_A2_reg 00162 var_bank2 A0_C0_reg 00163 var_bank2 A0_C1_reg 00164 var_bank2 A0_C2_reg 00165 var_bank2 A0_C4_reg 00166 00167 var_bank2 A1_A0_reg 00168 var_bank2 A1_A2_reg 00169 var_bank2 A1_C0_reg 00170 var_bank2 A1_C1_reg 00171 var_bank2 A1_C2_reg 00172 var_bank2 A1_C4_reg 00173 00174 var_bank2 A2_A0_reg 00175 var_bank2 A2_A1_reg 00176 var_bank2 A2_C0_reg 00177 var_bank2 A2_C1_reg 00178 var_bank2 A2_C2_reg 00179 var_bank2 A2_C4_reg 00180 00181 var_bank2 C0_A0_reg 00182 var_bank2 C0_A1_reg 00183 var_bank2 C0_A2_reg 00184 var_bank2 C0_C1_reg 00185 var_bank2 C0_C2_reg 00186 var_bank2 C0_C4_reg 00187 00188 var_bank2 C1_A0_reg 00189 var_bank2 C1_A1_reg 00190 var_bank2 C1_A2_reg 00191 var_bank2 C1_C0_reg 00192 var_bank2 C1_C2_reg 00193 var_bank2 C1_C4_reg 00194 00195 var_bank2 C2_A0_reg 00196 var_bank2 C2_A1_reg 00197 var_bank2 C2_A2_reg 00198 var_bank2 C2_C0_reg 00199 var_bank2 C2_C1_reg 00200 var_bank2 C2_C4_reg 00201 00202 var_bank2 C4_A0_reg 00203 var_bank2 C4_A1_reg 00204 var_bank2 C4_A2_reg MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 29 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00205 var_bank2 C4_C0_reg 00206 var_bank2 C4_C1_reg 00207 var_bank2 C4_C2_reg 00208 #endif 00209 #ifdef SRGB 00210 ; 00211 ; The shifter pattern needs the colored LEDs defined sequentially 00212 ; 00213 var_bank2 C5_C3_reg ; 01 R 00214 var_bank2 C2_C3_reg ; 02 R 00215 var_bank2 C0_C4_reg ; 03 R 00216 var_bank2 C5_C4_reg ; 04 R 00217 var_bank2 C3_C5_reg ; 05 R 00218 var_bank2 C4_C5_reg ; 06 R 00219 var_bank2 A2_C0_reg ; 07 R 00220 var_bank2 C3_C0_reg ; 08 R 00221 var_bank2 C0_A2_reg ; 09 R 00222 var_bank2 C3_A2_reg ; 10 R 00223 var_bank2 A2_C2_reg ; 11 R 00224 var_bank2 C3_C2_reg ; 12 R 00225 var_bank2 A2_C1_reg ; 13 R 00226 var_bank2 C3_C1_reg ; 14 R 00227 00228 var_bank2 A2_C3_reg ; 01 G 00229 var_bank2 C0_C3_reg ; 02 G 00230 var_bank2 A2_C4_reg ; 03 G 00231 var_bank2 C3_C4_reg ; 04 G 00232 var_bank2 C0_C5_reg ; 05 G 00233 var_bank2 A2_C5_reg ; 06 G 00234 var_bank2 C4_C0_reg ; 07 G 00235 var_bank2 C5_C0_reg ; 08 G 00236 var_bank2 C4_A2_reg ; 09 G 00237 var_bank2 C5_A2_reg ; 10 G 00238 var_bank2 C4_C2_reg ; 11 G 00239 var_bank2 C5_C2_reg ; 12 G 00240 var_bank2 C4_C1_reg ; 13 G 00241 var_bank2 C5_C1_reg ; 14 G 00242 00243 var_bank2 C1_C3_reg ; 01 B ? 00244 var_bank2 C4_C3_reg 00245 var_bank2 C2_C4_reg ; 03 B 00246 var_bank2 C1_C4_reg ; 04 B 00247 var_bank2 C1_C5_reg ; 05 B 00248 var_bank2 C2_C5_reg ; 06 B 00249 var_bank2 C2_C0_reg ; 07 B 00250 var_bank2 C1_C0_reg ; 08 B 00251 var_bank2 C2_A2_reg ; 09 B 00252 var_bank2 C1_A2_reg ; 10 B 00253 var_bank2 C1_C2_reg ; 11 B 00254 var_bank2 C0_C2_reg 00255 var_bank2 C2_C1_reg ; 13 B ? 00256 var_bank2 C0_C1_reg ; 14 B 00257 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 30 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00258 #endif 00259 00260 #ifdef RGB_4x4x4 00261 ; Using Linerar Data Memory address mode. 00262 Led_000R equ 0x2100 00263 Led_000G equ 0x2101 00264 Led_000B equ 0x2102 00265 Led_001R equ 0x2103 00266 Led_001G equ 0x2104 00267 Led_001B equ 0x2105 00268 Led_002R equ 0x2106 00269 Led_002G equ 0x2107 00270 Led_002B equ 0x2108 00271 Led_003R equ 0x2109 00272 Led_003G equ 0x210a 00273 Led_003B equ 0x210b 00274 Led_010R equ 0x210c 00275 Led_010G equ 0x210d 00276 Led_010B equ 0x210e 00277 Led_011R equ 0x210f 00278 Led_011G equ 0x2110 00279 Led_011B equ 0x2111 00280 Led_012R equ 0x2112 00281 Led_012G equ 0x2113 00282 Led_012B equ 0x2114 00283 Led_013R equ 0x2115 00284 Led_013G equ 0x2116 00285 Led_013B equ 0x2117 00286 Led_020R equ 0x2118 00287 Led_020G equ 0x2119 00288 Led_020B equ 0x211a 00289 Led_021R equ 0x211b 00290 Led_021G equ 0x211c 00291 Led_021B equ 0x211d 00292 Led_022R equ 0x211e 00293 Led_022G equ 0x211f 00294 Led_022B equ 0x2120 00295 Led_023R equ 0x2121 00296 Led_023G equ 0x2122 00297 Led_023B equ 0x2123 00298 Led_030R equ 0x2124 00299 Led_030G equ 0x2125 00300 Led_030B equ 0x2126 00301 Led_031R equ 0x2127 00302 Led_031G equ 0x2128 00303 Led_031B equ 0x2129 00304 Led_032R equ 0x212a 00305 Led_032G equ 0x212b 00306 Led_032B equ 0x212c 00307 Led_033R equ 0x212d 00308 Led_033G equ 0x212e 00309 Led_033B equ 0x212f 00310 Led_100R equ 0x2130 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 31 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00311 Led_100G equ 0x2131 00312 Led_100B equ 0x2132 00313 Led_101R equ 0x2133 00314 Led_101G equ 0x2134 00315 Led_101B equ 0x2135 00316 Led_102R equ 0x2136 00317 Led_102G equ 0x2137 00318 Led_102B equ 0x2138 00319 Led_103R equ 0x2139 00320 Led_103G equ 0x213a 00321 Led_103B equ 0x213b 00322 Led_110R equ 0x213c 00323 Led_110G equ 0x213d 00324 Led_110B equ 0x213e 00325 Led_111R equ 0x213f 00326 Led_111G equ 0x2140 00327 Led_111B equ 0x2141 00328 Led_112R equ 0x2142 00329 Led_112G equ 0x2143 00330 Led_112B equ 0x2144 00331 Led_113R equ 0x2145 00332 Led_113G equ 0x2146 00333 Led_113B equ 0x2147 00334 Led_120R equ 0x2148 00335 Led_120G equ 0x2149 00336 Led_120B equ 0x214a 00337 Led_121R equ 0x214b 00338 Led_121G equ 0x214c 00339 Led_121B equ 0x214d 00340 Led_122R equ 0x214e 00341 Led_122G equ 0x214f 00342 Led_122B equ 0x2150 00343 Led_123R equ 0x2151 00344 Led_123G equ 0x2152 00345 Led_123B equ 0x2153 00346 Led_130R equ 0x2154 00347 Led_130G equ 0x2155 00348 Led_130B equ 0x2156 00349 Led_131R equ 0x2157 00350 Led_131G equ 0x2158 00351 Led_131B equ 0x2159 00352 Led_132R equ 0x215a 00353 Led_132G equ 0x215b 00354 Led_132B equ 0x215c 00355 Led_133R equ 0x215d 00356 Led_133G equ 0x215e 00357 Led_133B equ 0x215f 00358 Led_200R equ 0x2160 00359 Led_200G equ 0x2161 00360 Led_200B equ 0x2162 00361 Led_201R equ 0x2163 00362 Led_201G equ 0x2164 00363 Led_201B equ 0x2165 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 32 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00364 Led_202R equ 0x2166 00365 Led_202G equ 0x2167 00366 Led_202B equ 0x2168 00367 Led_203R equ 0x2169 00368 Led_203G equ 0x216a 00369 Led_203B equ 0x216b 00370 Led_210R equ 0x216c 00371 Led_210G equ 0x216d 00372 Led_210B equ 0x216e 00373 Led_211R equ 0x216f 00374 Led_211G equ 0x2170 00375 Led_211B equ 0x2171 00376 Led_212R equ 0x2172 00377 Led_212G equ 0x2173 00378 Led_212B equ 0x2174 00379 Led_213R equ 0x2175 00380 Led_213G equ 0x2176 00381 Led_213B equ 0x2177 00382 Led_220R equ 0x2178 00383 Led_220G equ 0x2179 00384 Led_220B equ 0x217a 00385 Led_221R equ 0x217b 00386 Led_221G equ 0x217c 00387 Led_221B equ 0x217d 00388 Led_222R equ 0x217e 00389 Led_222G equ 0x217f 00390 Led_222B equ 0x2180 00391 Led_223R equ 0x2181 00392 Led_223G equ 0x2182 00393 Led_223B equ 0x2183 00394 Led_230R equ 0x2184 00395 Led_230G equ 0x2185 00396 Led_230B equ 0x2186 00397 Led_231R equ 0x2187 00398 Led_231G equ 0x2188 00399 Led_231B equ 0x2189 00400 Led_232R equ 0x218a 00401 Led_232G equ 0x218b 00402 Led_232B equ 0x218c 00403 Led_233R equ 0x218d 00404 Led_233G equ 0x218e 00405 Led_233B equ 0x218f 00406 Led_300R equ 0x2190 00407 Led_300G equ 0x2191 00408 Led_300B equ 0x2192 00409 Led_301R equ 0x2193 00410 Led_301G equ 0x2194 00411 Led_301B equ 0x2195 00412 Led_302R equ 0x2196 00413 Led_302G equ 0x2197 00414 Led_302B equ 0x2198 00415 Led_303R equ 0x2199 00416 Led_303G equ 0x219a MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 33 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00417 Led_303B equ 0x219b 00418 Led_310R equ 0x219c 00419 Led_310G equ 0x219d 00420 Led_310B equ 0x219e 00421 Led_311R equ 0x219f 00422 Led_311G equ 0x21a0 00423 Led_311B equ 0x21a1 00424 Led_312R equ 0x21a2 00425 Led_312G equ 0x21a3 00426 Led_312B equ 0x21a4 00427 Led_313R equ 0x21a5 00428 Led_313G equ 0x21a6 00429 Led_313B equ 0x21a7 00430 Led_320R equ 0x21a8 00431 Led_320G equ 0x21a9 00432 Led_320B equ 0x21aa 00433 Led_321R equ 0x21ab 00434 Led_321G equ 0x21ac 00435 Led_321B equ 0x21ad 00436 Led_322R equ 0x21ae 00437 Led_322G equ 0x21af 00438 Led_322B equ 0x21b0 00439 Led_323R equ 0x21b1 00440 Led_323G equ 0x21b2 00441 Led_323B equ 0x21b3 00442 Led_330R equ 0x21b4 00443 Led_330G equ 0x21b5 00444 Led_330B equ 0x21b6 00445 Led_331R equ 0x21b7 00446 Led_331G equ 0x21b8 00447 Led_331B equ 0x21b9 00448 Led_332R equ 0x21ba 00449 Led_332G equ 0x21bb 00450 Led_332B equ 0x21bc 00451 Led_333R equ 0x21bd 00452 Led_333G equ 0x21be 00453 Led_333B equ 0x21bf 00454 #endif 00455 00456 #ifdef M8X16 00457 ; Using Linerar Data Memory address mode. 00458 Led_G00 equ 0x20f0 00459 Led_G01 equ 0x20f1 00460 Led_G02 equ 0x20f2 00461 Led_G03 equ 0x20f3 00462 Led_G04 equ 0x20f4 00463 Led_G05 equ 0x20f5 00464 Led_G06 equ 0x20f6 00465 Led_G07 equ 0x20f7 00466 00467 Led_G10 equ 0x20f8 00468 Led_G11 equ 0x20f9 00469 Led_G12 equ 0x20fa MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 34 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00470 Led_G13 equ 0x20fb 00471 Led_G14 equ 0x20fc 00472 Led_G15 equ 0x20fd 00473 Led_G16 equ 0x20fe 00474 Led_G17 equ 0x20ff 00475 00476 Led_G20 equ 0x2100 00477 Led_G21 equ 0x2101 00478 Led_G22 equ 0x2102 00479 Led_G23 equ 0x2103 00480 Led_G24 equ 0x2104 00481 Led_G25 equ 0x2105 00482 Led_G26 equ 0x2106 00483 Led_G27 equ 0x2107 00484 00485 Led_G30 equ 0x2108 00486 Led_G31 equ 0x2109 00487 Led_G32 equ 0x210a 00488 Led_G33 equ 0x210b 00489 Led_G34 equ 0x210c 00490 Led_G35 equ 0x210d 00491 Led_G36 equ 0x210e 00492 Led_G37 equ 0x210f 00493 00494 Led_G40 equ 0x2110 00495 Led_G41 equ 0x2111 00496 Led_G42 equ 0x2112 00497 Led_G43 equ 0x2113 00498 Led_G44 equ 0x2114 00499 Led_G45 equ 0x2115 00500 Led_G46 equ 0x2116 00501 Led_G47 equ 0x2117 00502 00503 Led_G50 equ 0x2118 00504 Led_G51 equ 0x2119 00505 Led_G52 equ 0x211a 00506 Led_G53 equ 0x211b 00507 Led_G54 equ 0x211c 00508 Led_G55 equ 0x211d 00509 Led_G56 equ 0x211e 00510 Led_G57 equ 0x211f 00511 00512 Led_G60 equ 0x2120 00513 Led_G61 equ 0x2121 00514 Led_G62 equ 0x2122 00515 Led_G63 equ 0x2123 00516 Led_G64 equ 0x2124 00517 Led_G65 equ 0x2125 00518 Led_G66 equ 0x2126 00519 Led_G67 equ 0x2127 00520 00521 Led_G70 equ 0x2128 00522 Led_G71 equ 0x2129 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 35 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00523 Led_G72 equ 0x212a 00524 Led_G73 equ 0x212b 00525 Led_G74 equ 0x212c 00526 Led_G75 equ 0x212d 00527 Led_G76 equ 0x212e 00528 Led_G77 equ 0x212f 00529 00530 Led_G80 equ 0x2130 00531 Led_G81 equ 0x2131 00532 Led_G82 equ 0x2132 00533 Led_G83 equ 0x2133 00534 Led_G84 equ 0x2134 00535 Led_G85 equ 0x2135 00536 Led_G86 equ 0x2136 00537 Led_G87 equ 0x2137 00538 00539 Led_G90 equ 0x2138 00540 Led_G91 equ 0x2139 00541 Led_G92 equ 0x213a 00542 Led_G93 equ 0x213b 00543 Led_G94 equ 0x213c 00544 Led_G95 equ 0x213d 00545 Led_G96 equ 0x213e 00546 Led_G97 equ 0x213f 00547 00548 Led_GA0 equ 0x2140 00549 Led_GA1 equ 0x2141 00550 Led_GA2 equ 0x2142 00551 Led_GA3 equ 0x2143 00552 Led_GA4 equ 0x2144 00553 Led_GA5 equ 0x2145 00554 Led_GA6 equ 0x2146 00555 Led_GA7 equ 0x2147 00556 00557 Led_GB0 equ 0x2148 00558 Led_GB1 equ 0x2149 00559 Led_GB2 equ 0x214a 00560 Led_GB3 equ 0x214b 00561 Led_GB4 equ 0x214c 00562 Led_GB5 equ 0x214d 00563 Led_GB6 equ 0x214e 00564 Led_GB7 equ 0x214f 00565 00566 Led_GC0 equ 0x2150 00567 Led_GC1 equ 0x2151 00568 Led_GC2 equ 0x2152 00569 Led_GC3 equ 0x2153 00570 Led_GC4 equ 0x2154 00571 Led_GC5 equ 0x2155 00572 Led_GC6 equ 0x2156 00573 Led_GC7 equ 0x2157 00574 00575 Led_GD0 equ 0x2158 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 36 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00576 Led_GD1 equ 0x2159 00577 Led_GD2 equ 0x215a 00578 Led_GD3 equ 0x215b 00579 Led_GD4 equ 0x215c 00580 Led_GD5 equ 0x215d 00581 Led_GD6 equ 0x215e 00582 Led_GD7 equ 0x215f 00583 00584 Led_GE0 equ 0x2160 00585 Led_GE1 equ 0x2161 00586 Led_GE2 equ 0x2162 00587 Led_GE3 equ 0x2163 00588 Led_GE4 equ 0x2164 00589 Led_GE5 equ 0x2165 00590 Led_GE6 equ 0x2166 00591 Led_GE7 equ 0x2167 00592 00593 Led_GF0 equ 0x2168 00594 Led_GF1 equ 0x2169 00595 Led_GF2 equ 0x216a 00596 Led_GF3 equ 0x216b 00597 Led_GF4 equ 0x216c 00598 Led_GF5 equ 0x216d 00599 Led_GF6 equ 0x216e 00600 Led_GF7 equ 0x216f 00601 00602 Led_R00 equ 0x2170 00603 Led_R01 equ 0x2171 00604 Led_R02 equ 0x2172 00605 Led_R03 equ 0x2173 00606 Led_R04 equ 0x2174 00607 Led_R05 equ 0x2175 00608 Led_R06 equ 0x2176 00609 Led_R07 equ 0x2177 00610 00611 Led_R10 equ 0x2178 00612 Led_R11 equ 0x2179 00613 Led_R12 equ 0x217a 00614 Led_R13 equ 0x217b 00615 Led_R14 equ 0x217c 00616 Led_R15 equ 0x217d 00617 Led_R16 equ 0x217e 00618 Led_R17 equ 0x217f 00619 00620 Led_R20 equ 0x2180 00621 Led_R21 equ 0x2181 00622 Led_R22 equ 0x2182 00623 Led_R23 equ 0x2183 00624 Led_R24 equ 0x2184 00625 Led_R25 equ 0x2185 00626 Led_R26 equ 0x2186 00627 Led_R27 equ 0x2187 00628 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 37 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00629 Led_R30 equ 0x2188 00630 Led_R31 equ 0x2189 00631 Led_R32 equ 0x218a 00632 Led_R33 equ 0x218b 00633 Led_R34 equ 0x218c 00634 Led_R35 equ 0x218d 00635 Led_R36 equ 0x218e 00636 Led_R37 equ 0x218f 00637 00638 Led_R40 equ 0x2190 00639 Led_R41 equ 0x2191 00640 Led_R42 equ 0x2192 00641 Led_R43 equ 0x2193 00642 Led_R44 equ 0x2194 00643 Led_R45 equ 0x2195 00644 Led_R46 equ 0x2196 00645 Led_R47 equ 0x2197 00646 00647 Led_R50 equ 0x2198 00648 Led_R51 equ 0x2199 00649 Led_R52 equ 0x219a 00650 Led_R53 equ 0x219b 00651 Led_R54 equ 0x219c 00652 Led_R55 equ 0x219d 00653 Led_R56 equ 0x219e 00654 Led_R57 equ 0x219f 00655 00656 Led_R60 equ 0x21a0 00657 Led_R61 equ 0x21a1 00658 Led_R62 equ 0x21a2 00659 Led_R63 equ 0x21a3 00660 Led_R64 equ 0x21a4 00661 Led_R65 equ 0x21a5 00662 Led_R66 equ 0x21a6 00663 Led_R67 equ 0x21a7 00664 00665 Led_R70 equ 0x21a8 00666 Led_R71 equ 0x21a9 00667 Led_R72 equ 0x21aa 00668 Led_R73 equ 0x21ab 00669 Led_R74 equ 0x21ac 00670 Led_R75 equ 0x21ad 00671 Led_R76 equ 0x21ae 00672 Led_R77 equ 0x21af 00673 00674 Led_R80 equ 0x21b0 00675 Led_R81 equ 0x21b1 00676 Led_R82 equ 0x21b2 00677 Led_R83 equ 0x21b3 00678 Led_R84 equ 0x21b4 00679 Led_R85 equ 0x21b5 00680 Led_R86 equ 0x21b6 00681 Led_R87 equ 0x21b7 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 38 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00682 00683 Led_R90 equ 0x21b8 00684 Led_R91 equ 0x21b9 00685 Led_R92 equ 0x21ba 00686 Led_R93 equ 0x21bb 00687 Led_R94 equ 0x21bc 00688 Led_R95 equ 0x21bd 00689 Led_R96 equ 0x21be 00690 Led_R97 equ 0x21bf 00691 00692 Led_RA0 equ 0x21c0 00693 Led_RA1 equ 0x21c1 00694 Led_RA2 equ 0x21c2 00695 Led_RA3 equ 0x21c3 00696 Led_RA4 equ 0x21c4 00697 Led_RA5 equ 0x21c5 00698 Led_RA6 equ 0x21c6 00699 Led_RA7 equ 0x21c7 00700 00701 Led_RB0 equ 0x21c8 00702 Led_RB1 equ 0x21c9 00703 Led_RB2 equ 0x21ca 00704 Led_RB3 equ 0x21cb 00705 Led_RB4 equ 0x21cc 00706 Led_RB5 equ 0x21cd 00707 Led_RB6 equ 0x21ce 00708 Led_RB7 equ 0x21cf 00709 00710 Led_RC0 equ 0x21d0 00711 Led_RC1 equ 0x21d1 00712 Led_RC2 equ 0x21d2 00713 Led_RC3 equ 0x21d3 00714 Led_RC4 equ 0x21d4 00715 Led_RC5 equ 0x21d5 00716 Led_RC6 equ 0x21d6 00717 Led_RC7 equ 0x21d7 00718 00719 Led_RD0 equ 0x21d8 00720 Led_RD1 equ 0x21d9 00721 Led_RD2 equ 0x21da 00722 Led_RD3 equ 0x21db 00723 Led_RD4 equ 0x21dc 00724 Led_RD5 equ 0x21dd 00725 Led_RD6 equ 0x21de 00726 Led_RD7 equ 0x21df 00727 00728 Led_RE0 equ 0x21e0 00729 Led_RE1 equ 0x21e1 00730 Led_RE2 equ 0x21e2 00731 Led_RE3 equ 0x21e3 00732 Led_RE4 equ 0x21e4 00733 Led_RE5 equ 0x21e5 00734 Led_RE6 equ 0x21e6 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 39 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00735 Led_RE7 equ 0x21e7 00736 00737 Led_RF0 equ 0x21e8 00738 Led_RF1 equ 0x21e9 00739 Led_RF2 equ 0x21ea 00740 Led_RF3 equ 0x21eb 00741 Led_RF4 equ 0x21ec 00742 Led_RF5 equ 0x21ed 00743 Led_RF6 equ 0x21ee 00744 Led_RF7 equ 0x21ef 00745 #endif 00746 00747 #ifdef C12 00748 var_bank2 A0_A1_reg 00749 var_bank2 A0_A2_reg 00750 ; var_bank2 A0_A3_reg 00751 var_bank2 A0_A4_reg 00752 var_bank2 A0_A5_reg 00753 00754 var_bank2 A1_A0_reg 00755 var_bank2 A1_A2_reg 00756 var_bank2 A1_A3_reg 00757 ; var_bank2 A1_A4_reg 00758 var_bank2 A1_A5_reg 00759 00760 var_bank2 A2_A0_reg 00761 var_bank2 A2_A1_reg 00762 var_bank2 A2_A3_reg 00763 var_bank2 A2_A4_reg 00764 ; var_bank2 A2_A5_reg 00765 00766 ; var_bank2 A3_A0_reg 00767 var_bank2 A3_A1_reg 00768 var_bank2 A3_A2_reg 00769 var_bank2 A3_A4_reg 00770 var_bank2 A3_A5_reg 00771 00772 var_bank2 A4_A0_reg 00773 ; var_bank2 A4_A1_reg 00774 var_bank2 A4_A2_reg 00775 var_bank2 A4_A3_reg 00776 var_bank2 A4_A5_reg 00777 00778 var_bank2 A5_A0_reg 00779 var_bank2 A5_A1_reg 00780 ; var_bank2 A5_A2_reg 00781 var_bank2 A5_A3_reg 00782 var_bank2 A5_A4_reg 00783 00784 var_bank2 B7_B6_reg 00785 var_bank2 B7_B5_reg 00786 ; var_bank2 B7_B4_reg 00787 var_bank2 B7_B3_reg MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 40 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00788 var_bank2 B7_B2_reg 00789 00790 var_bank2 B6_B7_reg 00791 var_bank2 B6_B5_reg 00792 var_bank2 B6_B4_reg 00793 ; var_bank2 B6_B3_reg 00794 var_bank2 B6_B2_reg 00795 00796 var_bank2 B5_B7_reg 00797 var_bank2 B5_B6_reg 00798 var_bank2 B5_B4_reg 00799 var_bank2 B5_B3_reg 00800 ; var_bank2 B5_B2_reg 00801 00802 ; var_bank2 B4_B7_reg 00803 var_bank2 B4_B6_reg 00804 var_bank2 B4_B5_reg 00805 var_bank2 B4_B3_reg 00806 var_bank2 B4_B2_reg 00807 00808 var_bank2 B3_B7_reg 00809 ; var_bank2 B3_B6_reg 00810 var_bank2 B3_B5_reg 00811 var_bank2 B3_B4_reg 00812 var_bank2 B3_B2_reg 00813 00814 var_bank2 B2_B7_reg 00815 var_bank2 B2_B6_reg 00816 ; var_bank2 B2_B5_reg 00817 var_bank2 B2_B4_reg 00818 var_bank2 B2_B3_reg 00819 #endif 00820 00926 00927 #ifndef M8X16 00928 var_all_bank Ax_dir 0000007F M Ax_dir equ mem2 0000007E M mem2 = mem2 - 1 M if (mem >= mem2) M error 'Too much var space used' 00929 #endif 00930 #ifdef C19 00931 var_all_bank Cx_dir 00932 #endif 00933 #ifdef BADGE_G2 00934 var_all_bank Cx_dir 00935 #endif 00936 #ifdef SRGB 00937 var_all_bank Cx_dir 00938 #endif 00939 #ifdef C12 00940 var_all_bank Bx_dir 00941 #endif MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 41 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00942 00943 ; 00944 ; This is the number of times the display logic should cycle before exiting. It's been hand timed from t he 00945 ; start of the interupt to the end to be around 800usec. This leaves 90 usec for the main loop. 00946 ; The 19 stick has an extra display line strobe cycle. 00947 ; 00948 002D 303A 00949 movlw DELAYTIMER 002E 00A5 00950 movwf fcount 00951 00952 #ifdef C19 00953 movlw b'00101000' ;set LED matrix pins to input (tri-stated) 00954 movwf Ax_dir 00955 clrf Cx_dir ;set LED matrix pins to input (tri-stated) 00956 #else 00957 #ifdef D10 00958 movlw b'00101000' ;set LED matrix pins to input (tri-stated) 00959 movwf Ax_dir 00960 #else 00961 #ifdef SRGB 00962 movlw b'00111000' ;set LED matrix pins to input (tri-stated) 00963 movwf Ax_dir 00964 clrf Cx_dir ;set LED matrix pins to input (tri-stated) 00965 #else 00966 #ifdef C12 00967 clrf Ax_dir ;set LED matrix pins to input (tri-stated) 00968 clrf Bx_dir 00969 #else 00970 #ifdef BADGE_G2 00971 movlw b'11111000' ;set LED matrix pins to input (tri-stated) 00972 movwf Ax_dir ; A0,A1,A2 00973 movwf Cx_dir ; C0,C1,C2 00974 #else 00975 #ifndef M8X16 002F 3008 00976 movlw b'00001000' ;set LED matrix pins to input (tri-stated) 0030 00FF 00977 movwf Ax_dir 00978 #endif ; not M8X16 00979 #endif ; BADGE_G2 00980 #endif ; C12 00981 #endif ; SRGB 00982 #endif ; D10 00983 #endif ; C19 00984 00985 0031 209B 00986 call get_state_tbl_hi_address 0032 20A1 00987 call get_state_tbl_low_address 0033 20AF 00988 call go_state_table 0034 21FE 00989 call set_max_state 00990 00991 ; turn off the LEDs DDF 00992 ; clrf PORTA 00993 ; clrf PORTB MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 42 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00994 0035 0821 00995 movf dcycle,w ; testing for 0 0036 1903 00996 btfsc STATUS,Z 0037 2047 00997 call display_cycle0 00998 0038 3001 00999 movlw 0x01 ; testing for 1 0039 0221 01000 subwf dcycle,w 003A 1903 01001 btfsc STATUS,Z 003B 205C 01002 call display_cycle1 01003 003C 3002 01004 movlw 0x02 ; testing for 2 003D 0221 01005 subwf dcycle,w 003E 1903 01006 btfsc STATUS,Z 003F 2071 01007 call display_cycle2 01008 01009 #ifndef RGB2_DOGTAG 0040 3003 01010 movlw 0x03 ; testing for 3 0041 0221 01011 subwf dcycle,w 0042 1903 01012 btfsc STATUS,Z 0043 2086 01013 call display_cycle3 01014 01015 #ifndef BI6 01016 #ifndef RGB4 01017 #ifndef BI6_DOGTAG 01018 movlw 0x04 ; testing for 4 01019 subwf dcycle,w 01020 btfsc STATUS,Z 01021 call display_cycle4 01022 01023 #ifndef GATOR 01024 #ifndef ROCKET 01025 #ifndef S19 01026 #ifndef M3X3 01027 movlw 0x05 ; testing for 5 01028 subwf dcycle,w 01029 btfsc STATUS,Z 01030 call display_cycle5 01031 #ifndef BADGE_G2 01032 #ifndef C12 01033 movlw 0x06 ; testing for 6 01034 subwf dcycle,w 01035 btfsc STATUS,Z 01036 call display_cycle6 01037 #ifndef C19 01038 #ifndef SRGB 01039 movlw 0x07 ; testing for 7 01040 subwf dcycle,w 01041 btfsc STATUS,Z 01042 call display_cycle7 01043 #ifndef RGB_4x4x4 01044 movlw 0x08 ; testing for 8 01045 subwf dcycle,w 01046 btfsc STATUS,Z MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 43 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01047 call display_cycle8 01048 01049 movlw 0x09 ; testing for 9 01050 subwf dcycle,w 01051 btfsc STATUS,Z 01052 call display_cycle9 01053 01054 movlw 0x0a ; testing for 10 01055 subwf dcycle,w 01056 btfsc STATUS,Z 01057 call display_cycle10 01058 01059 movlw 0x0b ; testing for 11 01060 subwf dcycle,w 01061 btfsc STATUS,Z 01062 call display_cycle11 01063 01064 movlw 0x0c ; testing for 12 01065 subwf dcycle,w 01066 btfsc STATUS,Z 01067 call display_cycle12 01068 01069 movlw 0x0d ; testing for 13 01070 subwf dcycle,w 01071 btfsc STATUS,Z 01072 call display_cycle13 01073 01074 movlw 0x0e ; testing for 14 01075 subwf dcycle,w 01076 btfsc STATUS,Z 01077 call display_cycle14 01078 01079 movlw 0x0f ; testing for 15 01080 subwf dcycle,w 01081 btfsc STATUS,Z 01082 call display_cycle15 01083 #endif ; RGB_4x4x4 01084 #endif ; SRGB 01085 #endif ; C19 01086 #endif ; C12 01087 #endif ; BADGE_G2 01088 #endif ; M3X3 01089 #endif ; S19 01090 #endif ; GATOR 01091 #endif ; ROCKET 01092 #endif ; BI6_DOGTAG 01093 #endif ; RGB4 01094 #endif ; BI6 01095 #endif ; RGB2_DOGTAG 01096 ;-------------------------------------------------------------------------------------- 0044 01097 exit_tx 01098 ;-------------------------------------------------------------------------------------- 01099 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 44 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0044 018C 01100 clrf PORTA 01101 #ifndef __12F1822 01102 #ifndef __16F1824 01103 clrf PORTB 01104 #endif 01105 #endif 01106 #ifdef __16F1824 01107 clrf PORTC 01108 #endif 01109 01110 ; clear timer0 interupt 01111 0045 110B 01112 bcf INTCON,TMR0IF 01113 01114 ; restore state, return form interupt 01115 0046 01116 exit_int 0046 0009 01117 retfie ; return from interrupt 01118 01119 01120 01121 01122 #define DEBOUNCE 0x10 01123 01124 01125 01126 #ifdef RGB4 01127 #include 01128 #else 01129 #ifdef D10 01130 #include 01131 #else 01132 #ifdef BI6 01133 ; swapf w_temp,f # should not be here 01134 #include 00001 ;-------------------------------------------------------------------------------------- 0047 00002 display_cycle0 00003 ;-------------------------------------------------------------------------------------- 00004 #ifdef BI6_G2 00005 LedOut Br_reg,Ax_dir,1 ;LED Dr A0-A1 0047 0815 M movfw TMR0 0048 0229 M subwf Br_reg,w 0049 1C03 M btfss STATUS,C 004A 14FF M bsf Ax_dir, 1 00006 LedOut Dr_reg,Ax_dir,2 ;LED Dg A0-A2 004B 0815 M movfw TMR0 004C 022F M subwf Dr_reg,w 004D 1C03 M btfss STATUS,C 004E 157F M bsf Ax_dir, 2 00007 LedOut Dg_reg,Ax_dir,5 ;LED Db A0-A5 004F 0815 M movfw TMR0 0050 0230 M subwf Dg_reg,w 0051 1C03 M btfss STATUS,C MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 45 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0052 16FF M bsf Ax_dir, 5 00008 #else 00009 LedOut Ab_reg,Ax_dir,1 ;LED Dr A0-A1 00010 LedOut Cr_reg,Ax_dir,2 ;LED Dg A0-A2 00011 LedOut Db_reg,Ax_dir,5 ;LED Db A0-A5 00012 #endif 00013 0053 087F 00014 movf Ax_dir,w ;set portA direction 0054 0021 00015 BANKSEL TRISA 0055 008C 00016 movwf TRISA 00017 0056 0020 00018 BANKSEL 0 0057 3001 00019 movlw b'00000001' 0058 008C 00020 movwf PORTA 00021 0059 0BA5 00022 decfsz fcount,f 005A 2847 00023 goto display_cycle0 00024 005B 0008 00025 return 00026 00027 ;-------------------------------------------------------------------------------------- 005C 00028 display_cycle1 00029 ;-------------------------------------------------------------------------------------- 00030 #ifdef BI6_G2 00031 LedOut Ar_reg,Ax_dir,0 ;LED Dr A1-A0 005C 0815 M movfw TMR0 005D 0226 M subwf Ar_reg,w 005E 1C03 M btfss STATUS,C 005F 147F M bsf Ax_dir, 0 00032 LedOut Bg_reg,Ax_dir,2 ;LED Dg A1-A2 0060 0815 M movfw TMR0 0061 022A M subwf Bg_reg,w 0062 1C03 M btfss STATUS,C 0063 157F M bsf Ax_dir, 2 00033 LedOut Cb_reg,Ax_dir,5 ;LED Db A1-A5 0064 0815 M movfw TMR0 0065 022E M subwf Cb_reg,w 0066 1C03 M btfss STATUS,C 0067 16FF M bsf Ax_dir, 5 00034 #else 00035 LedOut Bb_reg,Ax_dir,0 ;LED Dr A1-A0 00036 LedOut Ag_reg,Ax_dir,2 ;LED Dg A1-A2 00037 LedOut Ar_reg,Ax_dir,5 ;LED Db A1-A5 00038 #endif 00039 0068 087F 00040 movf Ax_dir,w ;set portA direction 0069 0021 00041 BANKSEL TRISA 006A 008C 00042 movwf TRISA 00043 006B 0020 00044 BANKSEL 0 006C 3002 00045 movlw b'00000010' 006D 008C 00046 movwf PORTA 00047 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 46 LOC OBJECT CODE LINE SOURCE TEXT VALUE 006E 0BA5 00048 decfsz fcount,f 006F 285C 00049 goto display_cycle1 00050 0070 0008 00051 return 00052 00053 ;-------------------------------------------------------------------------------------- 0071 00054 display_cycle2 00055 ;-------------------------------------------------------------------------------------- 00056 #ifdef BI6_G2 00057 LedOut Cr_reg,Ax_dir,0 ;LED Dr A2-A0 0071 0815 M movfw TMR0 0072 022C M subwf Cr_reg,w 0073 1C03 M btfss STATUS,C 0074 147F M bsf Ax_dir, 0 00058 LedOut Ag_reg,Ax_dir,1 ;LED Dg A2-A1 0075 0815 M movfw TMR0 0076 0227 M subwf Ag_reg,w 0077 1C03 M btfss STATUS,C 0078 14FF M bsf Ax_dir, 1 00059 LedOut Bb_reg,Ax_dir,5 ;LED Db A2-A5 0079 0815 M movfw TMR0 007A 022B M subwf Bb_reg,w 007B 1C03 M btfss STATUS,C 007C 16FF M bsf Ax_dir, 5 00060 #else 00061 LedOut Dr_reg,Ax_dir,0 ;LED Dr A2-A0 00062 LedOut Bg_reg,Ax_dir,1 ;LED Dg A2-A1 00063 LedOut Dg_reg,Ax_dir,5 ;LED Db A2-A5 00064 #endif 00065 007D 087F 00066 movf Ax_dir,w ;set portA direction 007E 0021 00067 BANKSEL TRISA 007F 008C 00068 movwf TRISA 00069 00070 0080 0020 00071 BANKSEL 0 0081 3004 00072 movlw b'00000100' 0082 008C 00073 movwf PORTA 00074 0083 0BA5 00075 decfsz fcount,f 0084 2871 00076 goto display_cycle2 00077 0085 0008 00078 return 00079 00080 ;-------------------------------------------------------------------------------------- 0086 00081 display_cycle3 00082 ;-------------------------------------------------------------------------------------- 00083 #ifdef BI6_G2 00084 LedOut Cg_reg,Ax_dir,0 ;LED Dr A5-A0 0086 0815 M movfw TMR0 0087 022D M subwf Cg_reg,w 0088 1C03 M btfss STATUS,C 0089 147F M bsf Ax_dir, 0 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 47 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00085 LedOut Cb_reg,Ax_dir,2 ;LED Db A5-A2 008A 0815 M movfw TMR0 008B 022E M subwf Cb_reg,w 008C 1C03 M btfss STATUS,C 008D 157F M bsf Ax_dir, 2 00086 LedOut Ab_reg,Ax_dir,1 ;LED Dg A5-A1 008E 0815 M movfw TMR0 008F 0228 M subwf Ab_reg,w 0090 1C03 M btfss STATUS,C 0091 14FF M bsf Ax_dir, 1 00087 #else 00088 LedOut Cb_reg,Ax_dir,0 ;LED Dr A5-A0 00089 LedOut Cg_reg,Ax_dir,2 ;LED Db A5-A2 00090 LedOut Br_reg,Ax_dir,1 ;LED Dg A5-A1 00091 #endif 00092 0092 087F 00093 movf Ax_dir,w ;set portA direction 0093 0021 00094 BANKSEL TRISA 0094 008C 00095 movwf TRISA 00096 00097 00098 #ifdef BADGE 00099 var a_out 00100 00101 BANKSEL a_out 00102 movlw b'00110000' ; Badge Center LED A4-Ground 00103 movwf a_out 00104 movfw TMR0 00105 subwf Center_reg,w 00106 btfss STATUS,C 00107 bcf a_out,4 00108 movfw a_out 00109 movwf PORTA 00110 #else 0095 0020 00111 BANKSEL PORTA 0096 3020 00112 movlw b'00100000' 0097 008C 00113 movwf PORTA 00114 #endif 00115 0098 0BA5 00116 decfsz fcount,f 0099 2886 00117 goto display_cycle3 00118 009A 0008 00119 return 01135 #else 01136 #ifdef GATOR 01137 #include 01138 #else 01139 #ifdef ROCKET 01140 #include 01141 #else 01142 #ifdef S19 01143 #include 01144 #else MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 48 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01145 #ifdef C19 01146 #include 01147 #else 01148 #ifdef M3X3 01149 #include 01150 #else 01151 #ifdef SRGB 01152 #include 01153 #else 01154 #ifdef M8X16 01155 #include 01156 #else 01157 #ifdef C12 01158 #include 01159 #else 01160 #ifdef BI6_DOGTAG 01161 #include 01162 #else 01163 #ifdef RGB2_DOGTAG 01164 #include 01165 #else 01166 #ifdef BADGE_G2 01167 #include 01168 #else 01169 #ifdef RGB_4x4x4 01170 #include 01171 #else 01172 error "unknown board strobe type" 01173 #endif ; RGB_4x4x4 01174 #endif ; BADGE_G2 01175 #endif ; RGB2_DOGTAG 01176 #endif ; BI6_DOGTAG 01177 #endif ; C12 01178 #endif ; M8X16 01179 #endif ; SRGB 01180 #endif ; M3X3 01181 #endif ; S19 01182 #endif ; C19 01183 #endif ; ROCKET 01184 #endif ; GATOR 01185 #endif ; BI6 01186 #endif ; D10 01187 #endif ; RGB4 01188 01189 01190 ;************************************************************************************** 01191 ; 01192 ; State Machine 01193 ; 01194 ;************************************************************************************** 01195 01196 var instate 00000032 M instate equ mem MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 49 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00000033 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01197 var max_instate 00000033 M max_instate equ mem 00000034 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01198 var IR_in 00000034 M IR_in equ mem 00000035 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01199 var command 00000035 M command equ mem 00000036 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01200 var address 00000036 M address equ mem 00000037 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01201 var toggle 00000037 M toggle equ mem 00000038 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01202 var IR_lhalf 00000038 M IR_lhalf equ mem 00000039 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01203 var button 00000039 M button equ mem 0000003A M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01204 #ifdef M3X3 01205 var button0 01206 var button1 01207 var button2 01208 var button3 01209 var button4 01210 #endif MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 50 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01211 var tx_1 0000003A M tx_1 equ mem 0000003B M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01212 var pindex2 0000003B M pindex2 equ mem 0000003C M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01213 var IR_in_good 0000003C M IR_in_good equ mem 0000003D M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01214 var butcount 0000003D M butcount equ mem 0000003E M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01215 01216 ;-------------------------------------------------------------------------------------- 009B 01217 get_state_tbl_hi_address ; 17 cycles 01218 ;-------------------------------------------------------------------------------------- 01219 var tbl2_hi 0000003E M tbl2_hi equ mem 0000003F M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01220 009B 1003 01221 bcf STATUS,0 ; clear carry flag ; 1 009C 0D32 01222 rlf instate,w ; entry = table * 2 ; 2 009D 00BB 01223 movwf pindex2 ; 3 009E 20A8 01224 call table_lookup2 ; 14 (9+2) 009F 00BE 01225 movwf tbl2_hi ; 15 00A0 0008 01226 return ; 16/17 01227 01228 ;-------------------------------------------------------------------------------------- 00A1 01229 get_state_tbl_low_address ; 18 cycles 01230 ;-------------------------------------------------------------------------------------- 01231 var tbl2_low 0000003F M tbl2_low equ mem 00000040 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01232 00A1 1003 01233 bcf STATUS,0 ; clear carry flag (just in case) ; 1 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 51 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00A2 0D32 01234 rlf instate,w ; entry = table * 2 + 1 ; 2 00A3 3E01 01235 addlw 1 ; 3 00A4 00BB 01236 movwf pindex2 ; 4 00A5 20A8 01237 call table_lookup2 ; 15 (9+2) 00A6 00BF 01238 movwf tbl2_low ; 16 00A7 0008 01239 return ; 17/18 01240 01241 ;********************************************************************** 00A8 01242 table_lookup2 ; 9 cycles 01243 ;********************************************************************** 00A8 3080 01244 movlw HIGH state_jump_table ; 1 00A9 008A 01245 movwf PCLATH ; 2 00AA 083B 01246 movf pindex2,w ; 3 00AB 3EB3 01247 addlw LOW state_jump_table ; 4 00AC 1803 01248 btfsc STATUS,0 ; check carry flag ; 5 00AD 0A8A 01249 incf PCLATH,f ; 6 00AE 0082 01250 movwf PCL ; 7 + 2 01251 01252 ;********************************************************************** 00AF 01253 go_state_table ; 18 cycles 01254 ;********************************************************************** 01255 00AF 083E 01256 movf tbl2_hi,w ; 1 00B0 008A 01257 movwf PCLATH ; 2 00B1 083F 01258 movf tbl2_low,w ; 3 00B2 0082 01259 movwf PCL ; 4 01260 01261 ;********************************************************************** 00B3 01262 state_jump_table 01263 ;********************************************************************** 01264 make_state_jump_table d'31' 0000 M local i = 0 M while i <= d'31' 00B3 3480 34F3 M dt HIGH Lstate0, LOW Lstate0 00000001 M i += 1 00B5 3480 34FE M dt HIGH Lstate1, LOW Lstate1 00000002 M i += 1 00B7 3481 3406 M dt HIGH Lstate2, LOW Lstate2 00000003 M i += 1 00B9 3481 340E M dt HIGH Lstate3, LOW Lstate3 00000004 M i += 1 00BB 3481 3416 M dt HIGH Lstate4, LOW Lstate4 00000005 M i += 1 00BD 3481 341E M dt HIGH Lstate5, LOW Lstate5 00000006 M i += 1 00BF 3481 3426 M dt HIGH Lstate6, LOW Lstate6 00000007 M i += 1 00C1 3481 3432 M dt HIGH Lstate7, LOW Lstate7 00000008 M i += 1 00C3 3481 3436 M dt HIGH Lstate8, LOW Lstate8 00000009 M i += 1 00C5 3481 3442 M dt HIGH Lstate9, LOW Lstate9 0000000A M i += 1 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 52 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00C7 3481 3446 M dt HIGH Lstate10, LOW Lstate10 0000000B M i += 1 00C9 3481 3452 M dt HIGH Lstate11, LOW Lstate11 0000000C M i += 1 00CB 3481 3456 M dt HIGH Lstate12, LOW Lstate12 0000000D M i += 1 00CD 3481 3462 M dt HIGH Lstate13, LOW Lstate13 0000000E M i += 1 00CF 3481 3466 M dt HIGH Lstate14, LOW Lstate14 0000000F M i += 1 00D1 3481 3472 M dt HIGH Lstate15, LOW Lstate15 00000010 M i += 1 00D3 3481 3476 M dt HIGH Lstate16, LOW Lstate16 00000011 M i += 1 00D5 3481 3482 M dt HIGH Lstate17, LOW Lstate17 00000012 M i += 1 00D7 3481 3486 M dt HIGH Lstate18, LOW Lstate18 00000013 M i += 1 00D9 3481 3492 M dt HIGH Lstate19, LOW Lstate19 00000014 M i += 1 00DB 3481 3496 M dt HIGH Lstate20, LOW Lstate20 00000015 M i += 1 00DD 3481 34A2 M dt HIGH Lstate21, LOW Lstate21 00000016 M i += 1 00DF 3481 34A6 M dt HIGH Lstate22, LOW Lstate22 00000017 M i += 1 00E1 3481 34B2 M dt HIGH Lstate23, LOW Lstate23 00000018 M i += 1 00E3 3481 34B6 M dt HIGH Lstate24, LOW Lstate24 00000019 M i += 1 00E5 3481 34C2 M dt HIGH Lstate25, LOW Lstate25 0000001A M i += 1 00E7 3481 34C6 M dt HIGH Lstate26, LOW Lstate26 0000001B M i += 1 00E9 3481 34D2 M dt HIGH Lstate27, LOW Lstate27 0000001C M i += 1 00EB 3481 34D6 M dt HIGH Lstate28, LOW Lstate28 0000001D M i += 1 00ED 3481 34E2 M dt HIGH Lstate29, LOW Lstate29 0000001E M i += 1 00EF 3481 34E6 M dt HIGH Lstate30, LOW Lstate30 0000001F M i += 1 00F1 3481 34F2 M dt HIGH Lstate31, LOW Lstate31 00000020 M i += 1 M endw 01265 01266 state_tbl 0, 6, 1, 0 00F3 M Lstate0 M #ifndef MULTIBUTTON M if (0 == 0) 00F3 1039 M bcf button,0 00F4 3030 M movlw 0x30 00F5 00BD M movwf butcount MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 53 LOC OBJECT CODE LINE SOURCE TEXT VALUE M endif M if (0 == 1) M bsf button,0 M endif M #endif 00F6 1834 M btfsc IR_in,0 00F7 28FB M goto Lstate0a M 00F8 3006 M movlw 6 00F9 00B2 M movwf instate M 00FA 29F4 M goto Lcontinue M 00FB M Lstate0a 00FB 3001 M movlw 1 00FC 00B2 M movwf instate M 00FD 29F4 M goto Lcontinue 01267 state_tbl 1, 0, 2, -1 00FE M Lstate1 M #ifndef MULTIBUTTON M if (-1 == 0) M bcf button,0 M movlw 0x30 M movwf butcount M endif M if (-1 == 1) M bsf button,0 M endif M #endif 00FE 1834 M btfsc IR_in,0 00FF 2903 M goto Lstate1a M 0100 3000 M movlw 0 0101 00B2 M movwf instate M 0102 29F4 M goto Lcontinue M 0103 M Lstate1a 0103 3002 M movlw 2 0104 00B2 M movwf instate M 0105 29F4 M goto Lcontinue 01268 state_tbl 2, 0, 3, -1 0106 M Lstate2 M #ifndef MULTIBUTTON M if (-1 == 0) M bcf button,0 M movlw 0x30 M movwf butcount M endif M if (-1 == 1) M bsf button,0 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 54 LOC OBJECT CODE LINE SOURCE TEXT VALUE M endif M #endif 0106 1834 M btfsc IR_in,0 0107 290B M goto Lstate2a M 0108 3000 M movlw 0 0109 00B2 M movwf instate M 010A 29F4 M goto Lcontinue M 010B M Lstate2a 010B 3003 M movlw 3 010C 00B2 M movwf instate M 010D 29F4 M goto Lcontinue 01269 state_tbl 3, 4, 3, -1 010E M Lstate3 M #ifndef MULTIBUTTON M if (-1 == 0) M bcf button,0 M movlw 0x30 M movwf butcount M endif M if (-1 == 1) M bsf button,0 M endif M #endif 010E 1834 M btfsc IR_in,0 010F 2913 M goto Lstate3a M 0110 3004 M movlw 4 0111 00B2 M movwf instate M 0112 29F4 M goto Lcontinue M 0113 M Lstate3a 0113 3003 M movlw 3 0114 00B2 M movwf instate M 0115 29F4 M goto Lcontinue 01270 state_tbl 4, 0, 5, -1 0116 M Lstate4 M #ifndef MULTIBUTTON M if (-1 == 0) M bcf button,0 M movlw 0x30 M movwf butcount M endif M if (-1 == 1) M bsf button,0 M endif M #endif 0116 1834 M btfsc IR_in,0 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 55 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0117 291B M goto Lstate4a M 0118 3000 M movlw 0 0119 00B2 M movwf instate M 011A 29F4 M goto Lcontinue M 011B M Lstate4a 011B 3005 M movlw 5 011C 00B2 M movwf instate M 011D 29F4 M goto Lcontinue 01271 state_tbl 5, 7, 0, -1 011E M Lstate5 M #ifndef MULTIBUTTON M if (-1 == 0) M bcf button,0 M movlw 0x30 M movwf butcount M endif M if (-1 == 1) M bsf button,0 M endif M #endif 011E 1834 M btfsc IR_in,0 011F 2923 M goto Lstate5a M 0120 3007 M movlw 7 0121 00B2 M movwf instate M 0122 29F4 M goto Lcontinue M 0123 M Lstate5a 0123 3000 M movlw 0 0124 00B2 M movwf instate M 0125 29F4 M goto Lcontinue 01272 0126 01273 Lstate6 01274 0126 1834 01275 btfsc IR_in,0 0127 2930 01276 goto Lstate6a 01277 0128 3000 01278 movlw 0 0129 073D 01279 addwf butcount,w 012A 1903 01280 btfsc STATUS,Z 012B 292E 01281 goto Lstate6b 01282 012C 0BBD 01283 decfsz butcount,f 012D 29F4 01284 goto Lcontinue 01285 012E 01286 Lstate6b 01287 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 56 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01288 #ifndef MULTIBUTTON 012E 1439 01289 bsf button,0 01290 #endif 012F 29F4 01291 goto Lcontinue 01292 0130 01293 Lstate6a 0130 01B2 01294 clrf instate 0131 29F4 01295 goto Lcontinue 01296 01297 state2_tbl 7, toggle, 0 0132 M Lstate7 M ; save the 1st half of word 0132 0834 M movf IR_in,w ; save 1st half 0133 00B8 M movwf IR_lhalf 0134 0AB2 M incf instate,f M 0135 29F4 M goto Lcontinue M 0136 M Lstate8 M ; save the 2nd half of word M ; check for protocal error should get 01 or 10 0136 0838 M movf IR_lhalf,w 0137 0634 M xorwf IR_in,w 0138 1D03 M btfss STATUS,Z 0139 293C M goto Lstate8a 013A 01B2 M clrf instate ; error state = zero M 013B 29F4 M goto Lcontinue M M ; set the correct bit in output vars. 013C M Lstate8a 013C 1834 M btfsc IR_in,0 013D 1037 M bcf toggle,0 013E 1C34 M btfss IR_in,0 013F 1437 M bsf toggle,0 M 0140 0AB2 M incf instate,f 0141 29F4 M goto Lcontinue 01298 state2_tbl 9, address, 4 0142 M Lstate9 M ; save the 1st half of word 0142 0834 M movf IR_in,w ; save 1st half 0143 00B8 M movwf IR_lhalf 0144 0AB2 M incf instate,f M 0145 29F4 M goto Lcontinue M 0146 M Lstate10 M ; save the 2nd half of word M ; check for protocal error should get 01 or 10 0146 0838 M movf IR_lhalf,w 0147 0634 M xorwf IR_in,w 0148 1D03 M btfss STATUS,Z MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 57 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0149 294C M goto Lstate10a 014A 01B2 M clrf instate ; error state = zero M 014B 29F4 M goto Lcontinue M M ; set the correct bit in output vars. 014C M Lstate10a 014C 1834 M btfsc IR_in,0 014D 1236 M bcf address,4 014E 1C34 M btfss IR_in,0 014F 1636 M bsf address,4 M 0150 0AB2 M incf instate,f 0151 29F4 M goto Lcontinue 01299 state2_tbl d'11', address, 3 0152 M Lstate11 M ; save the 1st half of word 0152 0834 M movf IR_in,w ; save 1st half 0153 00B8 M movwf IR_lhalf 0154 0AB2 M incf instate,f M 0155 29F4 M goto Lcontinue M 0156 M Lstate12 M ; save the 2nd half of word M ; check for protocal error should get 01 or 10 0156 0838 M movf IR_lhalf,w 0157 0634 M xorwf IR_in,w 0158 1D03 M btfss STATUS,Z 0159 295C M goto Lstate12a 015A 01B2 M clrf instate ; error state = zero M 015B 29F4 M goto Lcontinue M M ; set the correct bit in output vars. 015C M Lstate12a 015C 1834 M btfsc IR_in,0 015D 11B6 M bcf address,3 015E 1C34 M btfss IR_in,0 015F 15B6 M bsf address,3 M 0160 0AB2 M incf instate,f 0161 29F4 M goto Lcontinue 01300 state2_tbl d'13', address, 2 0162 M Lstate13 M ; save the 1st half of word 0162 0834 M movf IR_in,w ; save 1st half 0163 00B8 M movwf IR_lhalf 0164 0AB2 M incf instate,f M 0165 29F4 M goto Lcontinue M 0166 M Lstate14 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 58 LOC OBJECT CODE LINE SOURCE TEXT VALUE M ; save the 2nd half of word M ; check for protocal error should get 01 or 10 0166 0838 M movf IR_lhalf,w 0167 0634 M xorwf IR_in,w 0168 1D03 M btfss STATUS,Z 0169 296C M goto Lstate14a 016A 01B2 M clrf instate ; error state = zero M 016B 29F4 M goto Lcontinue M M ; set the correct bit in output vars. 016C M Lstate14a 016C 1834 M btfsc IR_in,0 016D 1136 M bcf address,2 016E 1C34 M btfss IR_in,0 016F 1536 M bsf address,2 M 0170 0AB2 M incf instate,f 0171 29F4 M goto Lcontinue 01301 state2_tbl d'15', address, 1 0172 M Lstate15 M ; save the 1st half of word 0172 0834 M movf IR_in,w ; save 1st half 0173 00B8 M movwf IR_lhalf 0174 0AB2 M incf instate,f M 0175 29F4 M goto Lcontinue M 0176 M Lstate16 M ; save the 2nd half of word M ; check for protocal error should get 01 or 10 0176 0838 M movf IR_lhalf,w 0177 0634 M xorwf IR_in,w 0178 1D03 M btfss STATUS,Z 0179 297C M goto Lstate16a 017A 01B2 M clrf instate ; error state = zero M 017B 29F4 M goto Lcontinue M M ; set the correct bit in output vars. 017C M Lstate16a 017C 1834 M btfsc IR_in,0 017D 10B6 M bcf address,1 017E 1C34 M btfss IR_in,0 017F 14B6 M bsf address,1 M 0180 0AB2 M incf instate,f 0181 29F4 M goto Lcontinue 01302 state2_tbl d'17', address, 0 0182 M Lstate17 M ; save the 1st half of word 0182 0834 M movf IR_in,w ; save 1st half 0183 00B8 M movwf IR_lhalf MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 59 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0184 0AB2 M incf instate,f M 0185 29F4 M goto Lcontinue M 0186 M Lstate18 M ; save the 2nd half of word M ; check for protocal error should get 01 or 10 0186 0838 M movf IR_lhalf,w 0187 0634 M xorwf IR_in,w 0188 1D03 M btfss STATUS,Z 0189 298C M goto Lstate18a 018A 01B2 M clrf instate ; error state = zero M 018B 29F4 M goto Lcontinue M M ; set the correct bit in output vars. 018C M Lstate18a 018C 1834 M btfsc IR_in,0 018D 1036 M bcf address,0 018E 1C34 M btfss IR_in,0 018F 1436 M bsf address,0 M 0190 0AB2 M incf instate,f 0191 29F4 M goto Lcontinue 01303 state2_tbl d'19', command, 5 0192 M Lstate19 M ; save the 1st half of word 0192 0834 M movf IR_in,w ; save 1st half 0193 00B8 M movwf IR_lhalf 0194 0AB2 M incf instate,f M 0195 29F4 M goto Lcontinue M 0196 M Lstate20 M ; save the 2nd half of word M ; check for protocal error should get 01 or 10 0196 0838 M movf IR_lhalf,w 0197 0634 M xorwf IR_in,w 0198 1D03 M btfss STATUS,Z 0199 299C M goto Lstate20a 019A 01B2 M clrf instate ; error state = zero M 019B 29F4 M goto Lcontinue M M ; set the correct bit in output vars. 019C M Lstate20a 019C 1834 M btfsc IR_in,0 019D 12B5 M bcf command,5 019E 1C34 M btfss IR_in,0 019F 16B5 M bsf command,5 M 01A0 0AB2 M incf instate,f 01A1 29F4 M goto Lcontinue MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 60 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01304 state2_tbl d'21', command, 4 01A2 M Lstate21 M ; save the 1st half of word 01A2 0834 M movf IR_in,w ; save 1st half 01A3 00B8 M movwf IR_lhalf 01A4 0AB2 M incf instate,f M 01A5 29F4 M goto Lcontinue M 01A6 M Lstate22 M ; save the 2nd half of word M ; check for protocal error should get 01 or 10 01A6 0838 M movf IR_lhalf,w 01A7 0634 M xorwf IR_in,w 01A8 1D03 M btfss STATUS,Z 01A9 29AC M goto Lstate22a 01AA 01B2 M clrf instate ; error state = zero M 01AB 29F4 M goto Lcontinue M M ; set the correct bit in output vars. 01AC M Lstate22a 01AC 1834 M btfsc IR_in,0 01AD 1235 M bcf command,4 01AE 1C34 M btfss IR_in,0 01AF 1635 M bsf command,4 M 01B0 0AB2 M incf instate,f 01B1 29F4 M goto Lcontinue 01305 state2_tbl d'23', command, 3 01B2 M Lstate23 M ; save the 1st half of word 01B2 0834 M movf IR_in,w ; save 1st half 01B3 00B8 M movwf IR_lhalf 01B4 0AB2 M incf instate,f M 01B5 29F4 M goto Lcontinue M 01B6 M Lstate24 M ; save the 2nd half of word M ; check for protocal error should get 01 or 10 01B6 0838 M movf IR_lhalf,w 01B7 0634 M xorwf IR_in,w 01B8 1D03 M btfss STATUS,Z 01B9 29BC M goto Lstate24a 01BA 01B2 M clrf instate ; error state = zero M 01BB 29F4 M goto Lcontinue M M ; set the correct bit in output vars. 01BC M Lstate24a 01BC 1834 M btfsc IR_in,0 01BD 11B5 M bcf command,3 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 61 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01BE 1C34 M btfss IR_in,0 01BF 15B5 M bsf command,3 M 01C0 0AB2 M incf instate,f 01C1 29F4 M goto Lcontinue 01306 state2_tbl d'25', command, 2 01C2 M Lstate25 M ; save the 1st half of word 01C2 0834 M movf IR_in,w ; save 1st half 01C3 00B8 M movwf IR_lhalf 01C4 0AB2 M incf instate,f M 01C5 29F4 M goto Lcontinue M 01C6 M Lstate26 M ; save the 2nd half of word M ; check for protocal error should get 01 or 10 01C6 0838 M movf IR_lhalf,w 01C7 0634 M xorwf IR_in,w 01C8 1D03 M btfss STATUS,Z 01C9 29CC M goto Lstate26a 01CA 01B2 M clrf instate ; error state = zero M 01CB 29F4 M goto Lcontinue M M ; set the correct bit in output vars. 01CC M Lstate26a 01CC 1834 M btfsc IR_in,0 01CD 1135 M bcf command,2 01CE 1C34 M btfss IR_in,0 01CF 1535 M bsf command,2 M 01D0 0AB2 M incf instate,f 01D1 29F4 M goto Lcontinue 01307 state2_tbl d'27', command, 1 01D2 M Lstate27 M ; save the 1st half of word 01D2 0834 M movf IR_in,w ; save 1st half 01D3 00B8 M movwf IR_lhalf 01D4 0AB2 M incf instate,f M 01D5 29F4 M goto Lcontinue M 01D6 M Lstate28 M ; save the 2nd half of word M ; check for protocal error should get 01 or 10 01D6 0838 M movf IR_lhalf,w 01D7 0634 M xorwf IR_in,w 01D8 1D03 M btfss STATUS,Z 01D9 29DC M goto Lstate28a 01DA 01B2 M clrf instate ; error state = zero M 01DB 29F4 M goto Lcontinue MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 62 LOC OBJECT CODE LINE SOURCE TEXT VALUE M M ; set the correct bit in output vars. 01DC M Lstate28a 01DC 1834 M btfsc IR_in,0 01DD 10B5 M bcf command,1 01DE 1C34 M btfss IR_in,0 01DF 14B5 M bsf command,1 M 01E0 0AB2 M incf instate,f 01E1 29F4 M goto Lcontinue 01308 state2_tbl d'29', command, 0 01E2 M Lstate29 M ; save the 1st half of word 01E2 0834 M movf IR_in,w ; save 1st half 01E3 00B8 M movwf IR_lhalf 01E4 0AB2 M incf instate,f M 01E5 29F4 M goto Lcontinue M 01E6 M Lstate30 M ; save the 2nd half of word M ; check for protocal error should get 01 or 10 01E6 0838 M movf IR_lhalf,w 01E7 0634 M xorwf IR_in,w 01E8 1D03 M btfss STATUS,Z 01E9 29EC M goto Lstate30a 01EA 01B2 M clrf instate ; error state = zero M 01EB 29F4 M goto Lcontinue M M ; set the correct bit in output vars. 01EC M Lstate30a 01EC 1834 M btfsc IR_in,0 01ED 1035 M bcf command,0 01EE 1C34 M btfss IR_in,0 01EF 1435 M bsf command,0 M 01F0 0AB2 M incf instate,f 01F1 29F4 M goto Lcontinue 01309 01F2 01310 Lstate31 01F2 01B2 01311 clrf instate 01F3 143C 01312 bsf IR_in_good,0 01313 01F4 01314 Lcontinue 01F4 0008 01315 return 01316 01317 ;-------------------------------------------------------------------------------------- 01F5 01318 read_button_in ; 5 cycles 01319 ;-------------------------------------------------------------------------------------- 01320 ; Portability : hardcoded button port 01321 ; 01322 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 63 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01323 #ifndef ENABLE_IR 01324 clrf button 01325 #endif 01326 01327 #ifndef SIM_DEBUG 01328 #ifdef RGB_4x4x4 01329 bcf button,0 ; 1 01330 bcf button,1 ; 1 01331 ; btfss PORTB,3 ; 2 01332 ; bsf button,1 ; 3 01333 btfss PORTB,4 ; 2 01334 bsf button,0 ; 3 01335 #else 01336 #ifdef D10 01337 btfss PORTA,3 ; 2 01338 bsf button,0 ; 3 01339 btfss PORTA,5 ; 2 01340 bsf button,1 ; 3 01341 #else 01342 #ifdef M8X16 01343 bcf button,1 ; 1 01344 btfss PORTC,2 ; 2 01345 bsf button,1 ; 3 01346 #else ; M8X16 01347 #ifndef MULTIBUTTON 01F5 1039 01348 bcf button,0 ; 1 01F6 10B9 01349 bcf button,1 ; 1 01350 #ifdef DEDICATED_BUTTON2 01351 #ifdef SRGB 01352 btfss PORTA,5 ; 2 ; stick has 2 buttons. 01353 bsf button,1 ; 3 01354 btfss PORTA,4 ; 2 01355 bsf button,0 ; 3 01356 #else ; SRGB 01357 btfss PORTC,5 ; 2 ; Dual 12C has 2 buttons. 01358 bsf button,0 ; 3 01359 btfss PORTC,7 ; 2 01360 bsf button,1 ; 3 01361 #endif ; SRGB 01362 #else ; DEDICATED_BUTTON2 01F7 1E8C 01363 btfss PORTA,5 ; 2 01F8 1439 01364 bsf button,0 ; 3 01365 #endif ; not DEDICATED_BUTTON2 01366 #endif ; not MULTIBUTTON 01367 #endif ; not M8x16 01368 #endif ; D10 01369 #endif ; RGB_4x4x4 01370 #endif ; not SIM_DEBUG 01F9 0008 01371 return 01372 01373 ;-------------------------------------------------------------------------------------- 01FA 01374 read_ir_in ; 5 cycles 01375 ;-------------------------------------------------------------------------------------- MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 64 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01FA 1034 01376 bcf IR_in,0 ; 1 01377 #ifndef SIM_DEBUG 01378 #ifdef C12 01379 btfsc PORTC,6 ; 2 01380 #else 01381 #ifdef M8X16 01382 btfsc PORTE,3 ; 2 01383 #else 01384 #ifdef RGB_4x4x4 01385 nop 01386 ; btfsc PORTC,0 ; 2 DDF disable IR IN 01387 #else 01FB 198C 01388 btfsc PORTA,3 ; 2 01389 #endif 01390 #endif 01391 #endif 01392 #endif 01393 01FC 1434 01394 bsf IR_in,0 ; 3 01395 01396 ; movf tx_1,w ; loopback for testing HACK!! ;1 01397 ; xorlw 0x01 ; loopback for testing HACK!! ;2 01398 ; movwf IR_in ; loopback for testing HACK!! ;3 01FD 0008 01399 return ; 4/5 01400 01401 ;-------------------------------------------------------------------------------------- 01FE 01402 set_max_state ; 5-7 cycles 01403 ;-------------------------------------------------------------------------------------- 01FE 0833 01404 movf max_instate,w 01FF 0232 01405 subwf instate,w 0200 1C03 01406 btfss STATUS,C 0201 2A04 01407 goto smi_l1 0202 0832 01408 movf instate,w 0203 00B3 01409 movwf max_instate 0204 01410 smi_l1 0204 0008 01411 return 01412 01413 ;-------------------------------------------------------------------------------------- 0205 01414 get_next_tx_bit ; 11 cycles 01415 ;-------------------------------------------------------------------------------------- 01416 0205 103A 01417 bcf tx_1,0 ;1 0206 03C9 01418 decf scount,f ;2 0207 1003 01419 bcf STATUS, C ; clear carry bit ;3 0208 0CC8 01420 rrf out3,f ;4 0209 0CC7 01421 rrf out2,f ;5 020A 0CC6 01422 rrf out1,f ;6 020B 0CC5 01423 rrf out0,f ;7 020C 1803 01424 btfsc STATUS, C ;8 020D 143A 01425 bsf tx_1,0 ;9 01426 01427 ; movf tx_1,w ; loopback for testing HACK!! 01428 ; xorlw 0x01 ; loopback for testing HACK!! MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 65 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01429 ; movwf tx_1 ; loopback for testing HACK!! 01430 ; mult_nop d'6' ; for debuging 01431 020E 0008 01432 return ;10/11 01433 01434 ;********************************************************************** 020F 01435 qdelay 01436 ;********************************************************************** 01437 var qcount 00000040 M qcount equ mem 00000041 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01438 020F 00C0 01439 movwf qcount 0210 01440 delay_loop2 0210 0BC0 01441 decfsz qcount,1 0211 2A10 01442 goto delay_loop2 0212 0008 01443 return 01444 ;********************************************************************** 0213 01445 rf_command_out 01446 ;********************************************************************** 01447 01448 var out_address 00000041 M out_address equ mem 00000042 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01449 var out_command 00000042 M out_command equ mem 00000043 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01450 var out_toggle 00000043 M out_toggle equ mem 00000044 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01451 var out_pattern 00000044 M out_pattern equ mem 00000045 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01452 var out0 00000045 M out0 equ mem 00000046 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 66 LOC OBJECT CODE LINE SOURCE TEXT VALUE M endif 01453 var out1 00000046 M out1 equ mem 00000047 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01454 var out2 00000047 M out2 equ mem 00000048 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01455 var out3 00000048 M out3 equ mem 00000049 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01456 var scount 00000049 M scount equ mem 0000004A M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01457 0213 01C6 01458 clrf out1 0214 01C7 01459 clrf out2 0215 01C8 01460 clrf out3 01461 01462 ; start flag 0216 30A0 01463 movlw B'10100000' 0217 00C5 01464 movwf out0 01465 01466 01467 ; toggle bit 0218 09C3 01468 comf out_toggle,f ; toggle the toggle flag 0219 1C43 01469 btfss out_toggle,0 021A 1446 01470 bsf out1,0 021B 1843 01471 btfsc out_toggle,0 021C 14C6 01472 bsf out1,1 01473 01474 ; address bits 021D 1E41 01475 btfss out_address,4 021E 1546 01476 bsf out1,2 021F 1A41 01477 btfsc out_address,4 0220 15C6 01478 bsf out1,3 01479 0221 1DC1 01480 btfss out_address,3 0222 1646 01481 bsf out1,4 0223 19C1 01482 btfsc out_address,3 0224 16C6 01483 bsf out1,5 01484 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 67 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0225 1D41 01485 btfss out_address,2 0226 1746 01486 bsf out1,6 0227 1941 01487 btfsc out_address,2 0228 17C6 01488 bsf out1,7 01489 0229 1CC1 01490 btfss out_address,1 022A 1447 01491 bsf out2,0 022B 18C1 01492 btfsc out_address,1 022C 14C7 01493 bsf out2,1 01494 022D 1C41 01495 btfss out_address,0 022E 1547 01496 bsf out2,2 022F 1841 01497 btfsc out_address,0 0230 15C7 01498 bsf out2,3 01499 01500 ; command bits 0231 1EC2 01501 btfss out_command,5 0232 1647 01502 bsf out2,4 0233 1AC2 01503 btfsc out_command,5 0234 16C7 01504 bsf out2,5 01505 0235 1E42 01506 btfss out_command,4 0236 1747 01507 bsf out2,6 0237 1A42 01508 btfsc out_command,4 0238 17C7 01509 bsf out2,7 01510 0239 1DC2 01511 btfss out_command,3 023A 1448 01512 bsf out3,0 023B 19C2 01513 btfsc out_command,3 023C 14C8 01514 bsf out3,1 01515 023D 1D42 01516 btfss out_command,2 023E 1548 01517 bsf out3,2 023F 1942 01518 btfsc out_command,2 0240 15C8 01519 bsf out3,3 01520 0241 1CC2 01521 btfss out_command,1 0242 1648 01522 bsf out3,4 0243 18C2 01523 btfsc out_command,1 0244 16C8 01524 bsf out3,5 01525 0245 1C42 01526 btfss out_command,0 0246 1748 01527 bsf out3,6 0247 1842 01528 btfsc out_command,0 0248 17C8 01529 bsf out3,7 01530 0249 3021 01531 movlw 0x21 024A 00C9 01532 movwf scount 01533 024B 0008 01534 return 01535 01536 #ifdef BIN2LED 01537 ;********************************************************************** MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 68 LOC OBJECT CODE LINE SOURCE TEXT VALUE 024C 01538 bin2led 01539 ;********************************************************************** 01540 var b2l_out_hi 0000004A M b2l_out_hi equ mem 0000004B M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01541 var b2l_out_low 0000004B M b2l_out_low equ mem 0000004C M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01542 var b2l_lcount 0000004C M b2l_lcount equ mem 0000004D M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01543 var b2l_in_red 0000004D M b2l_in_red equ mem 0000004E M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01544 var b2l_in_green 0000004E M b2l_in_green equ mem 0000004F M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01545 024C 01CA 01546 clrf b2l_out_hi 024D 01CB 01547 clrf b2l_out_low 024E 3008 01548 movlw 0x08 024F 00CC 01549 movwf b2l_lcount 0250 01550 b2l_loop 0250 1003 01551 bcf STATUS, C 0251 0CCE 01552 rrf b2l_in_green,f 0252 0DCB 01553 rlf b2l_out_low,f 0253 0DCA 01554 rlf b2l_out_hi,f 0254 0CCD 01555 rrf b2l_in_red,f 0255 0DCB 01556 rlf b2l_out_low,f 0256 0DCA 01557 rlf b2l_out_hi,f 01558 0257 0BCC 01559 decfsz b2l_lcount,f 0258 2A50 01560 goto b2l_loop 0259 0008 01561 return 01562 #endif 01563 #ifdef FLIPBYTE 01564 ;********************************************************************** 01565 flipbyte MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 69 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01566 ;********************************************************************** 01567 var flip_in 01568 var flip_out 01569 var flip_lcount 01570 01571 movwf flip_in 01572 clrf flip_out 01573 movlw 0x08 01574 movwf flip_lcount 01575 fbyte_loop 01576 bcf STATUS, C 01577 rrf flip_in,f 01578 rlf flip_out,f 01579 01580 decfsz flip_lcount,f 01581 goto fbyte_loop 01582 01583 movfw flip_out 01584 return 01585 #endif 01586 01587 ;********************************************************************** 025A 01588 delay 01589 ;********************************************************************** 01590 01591 var delay_count 0000004F M delay_count equ mem 00000050 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01592 01593 ; movlw 0ffh 025A 00CF 01594 movwf delay_count 025B 01595 delay_loop 025B 0000 01596 nop 025C 0BCF 01597 decfsz delay_count,1 025D 2A5B 01598 goto delay_loop 025E 0008 01599 return 01600 01601 ;********************************************************************** 025F 01602 next_pattern 01603 ;********************************************************************** 025F 0AD4 01604 incf pattern,f 0260 0854 01605 movf pattern,w 0261 3C0F 01606 sublw NUM_TAB+1 ; max pattern? 0262 1903 01607 btfsc STATUS,2 ; z bit check 0263 01D4 01608 clrf pattern ; reset to zero 0264 0854 01609 movfw pattern 0265 00C4 01610 movwf out_pattern 0266 01FE 01611 clrf pindex 0267 01FD 01612 clrf pindex1 0268 0008 01613 return MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 70 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01614 01615 ;********************************************************************** 0269 01616 past_pattern 01617 ;********************************************************************** 0269 03D4 01618 decf pattern,f 026A 0854 01619 movf pattern,w 026B 3E01 01620 addlw 1 ; max pattern? 026C 1D03 01621 btfss STATUS,2 ; z bit check 026D 2A71 01622 goto past_exit 026E 300E 01623 movlw NUM_TAB 026F 00D4 01624 movwf pattern 0270 00C4 01625 movwf out_pattern 0271 01626 past_exit 0271 01FE 01627 clrf pindex 0272 01FD 01628 clrf pindex1 0273 0008 01629 return 01630 01631 ;********************************************************************** 0274 01632 set_pattern ;set pattern from IR 01633 ;********************************************************************** 01634 ; extra logic because all the different blinkes talk to each other, but 01635 ; do not have the same number of patterns. So if blinkie "A" sents a 01636 ; pattern 22 to blinkie "B" which only has 10 patterns, Blinkie "B" 01637 ; starts to show pattern 2. (22 % 10 a mod function.) But to make 01638 ; things fair in blinkie wars, it will transmit pattern 22 to other 01639 ; blinkies. 01640 ;********************************************************************** 01641 0274 0835 01642 movfw command 0275 00D4 01643 movwf pattern 0276 00C4 01644 movwf out_pattern 0277 01645 set_loop 0277 3EF1 01646 addlw 0xff-NUM_TAB 0278 1C03 01647 btfss STATUS, C 0279 2A7E 01648 goto set_exit 01649 027A 300E 01650 movlw NUM_TAB 027B 02D4 01651 subwf pattern,f 027C 0854 01652 movfw pattern 027D 2A77 01653 goto set_loop 01654 027E 01655 set_exit 027E 01FE 01656 clrf pindex 027F 01FD 01657 clrf pindex1 0280 0008 01658 return 01659 01660 ;********************************************************************** 0281 01661 strobe_delay 01662 ;********************************************************************** 01663 01664 var strobe_count 00000050 M strobe_count equ mem 00000051 M mem = mem + 1 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 71 LOC OBJECT CODE LINE SOURCE TEXT VALUE M if (mem >= mem2) M error 'Too much var space used' M endif 01665 0281 00D0 01666 movwf strobe_count 0282 01667 strobe_delay1 0282 1020 01668 bcf nextf,0 01669 0283 01670 strobe_delay2 0283 1C20 01671 btfss nextf,0 0284 2A83 01672 goto strobe_delay2 01673 0285 0BD0 01674 decfsz strobe_count,f 0286 2A82 01675 goto strobe_delay1 01676 0287 0008 01677 return 01678 01679 #ifdef M8X16 01680 #include display_pattern_id_8x16.asm 01681 #else 01682 ;********************************************************************** 0288 01683 display_pattern_id 01684 ;********************************************************************** 0288 0A54 01685 incf pattern,w ; W = pattern + 1 01686 #ifdef SRGB 01687 movwf in1 01688 clrf in0 01689 clrf in2 01690 clrf in3 01691 clrf in4 01692 clrf in5 01693 #else 01694 #ifdef C12 01695 call flipbyte 01696 movwf in0 01697 clrf in1 01698 clrf in2 01699 clrf in3 01700 clrf in4 01701 clrf in5 01702 movlw b'01110000' 01703 btfsc demo_mode,0 01704 movwf in1 01705 #else ; everyone else 0289 00D6 01706 movwf in0 01707 #endif ; C12 01708 #endif ; SRGB 01709 01710 ; CDDDEEEE EEEFGGGG 01711 #ifdef ROCKET 01712 call flipbyte 01713 movwf in1 ; save pattern in in0 01714 movwf in2 ; save pattern in in1 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 72 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01715 ; CDDDEEEE EEEFGGGG 01716 ; 12345678 12345678 01717 lslf in2,f 01718 lslf in2,f 01719 lslf in2,f ; shift up 3 bits. 01720 ; CDDDEEEE EEEFGGGG 01721 ; 12345678 45678--- 01722 bcf in2,5 01723 bcf in2,4 ; clear 2 bits (6&7) 01724 ; CDDDEEEE EEEFGGGG 01725 ; 12345678 456----- 01726 lsrf in1,f 01727 lsrf in1,f 01728 lsrf in1,f 01729 lsrf in1,f ; shift down 4 bits. 01730 ; CDDDEEEE EEEFGGGG 01731 ; ----1234 456----- 01732 bcf in1,0 ; clear center running light 01733 ; CDDDEEEE EEEFGGGG 01734 ; ----123- 456----- 01735 clrf in0 01736 01737 #endif ; ROCKET 01738 01739 #ifdef GATOR 01740 call flipbyte 01741 movwf in0 01742 clrf in1 01743 clrf in2 01744 #endif ; GATOR 01745 01746 #ifdef BI6_DOGTAG 01747 movwf b2l_in_red 01748 clrf b2l_in_green 01749 call bin2led 01750 movf b2l_out_hi,w 01751 movwf in0 01752 movf b2l_out_low,w 01753 movwf in1 01754 01755 btfsc demo_mode,0 01756 #ifdef MONO 01757 bsf in1,4 01758 #else 01759 bsf in1,5 01760 #endif 01761 #endif 01762 01763 #ifdef RGB2_DOGTAG 01764 call flipbyte 01765 movwf in0 01766 lslf flip_out,f 01767 lslf flip_out,w MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 73 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01768 movwf in1 01769 #endif 01770 01771 #ifdef S19 01772 call flipbyte 01773 movwf in0 01774 #endif ; S19 01775 01776 #ifdef BI6 01777 #ifdef MONO 01778 call flipbyte 01779 movwf in0 01780 #else 01781 #ifdef D10 01782 call flipbyte 01783 movwf in0 01784 clrf in1 01785 #else 028A 00CE 01786 movwf b2l_in_green 028B 01CD 01787 clrf b2l_in_red 028C 224C 01788 call bin2led 028D 084A 01789 movf b2l_out_hi,w 028E 00D6 01790 movwf in0 028F 084B 01791 movf b2l_out_low,w 0290 00D7 01792 movwf in1 01793 #endif ; D10 01794 #endif ; Mono 01795 #endif ; BI6 01796 01797 #ifdef M3X3 01798 movwf b2l_in_green 01799 clrf b2l_in_red 01800 call bin2led 01801 movf b2l_out_hi,w 01802 movwf in0 01803 movf b2l_out_low,w 01804 movwf in1 01805 #endif ; M3X3 01806 01807 #ifdef C19 01808 ; outer ring hars the pattern number 01809 movwf b2l_in_red 01810 clrf b2l_in_green 01811 call bin2led 01812 movf b2l_out_hi,w 01813 movwf in0 01814 movf b2l_out_low,w 01815 movwf in1 01816 01817 ; center LED turned on 01818 clrf in2 01819 clrf in3 01820 movlw b'00001100' MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 74 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01821 movwf in4 01822 01823 ; middle ring on if demo mode 01824 btfss demo_mode,0 01825 goto skip4 01826 01827 comf in3,f 01828 movlw b'11111100' 01829 movwf in4 01830 skip4 01831 01832 #endif ; C19 01833 01834 #ifdef GATOR 01835 clrf in2 01836 01837 movlw b'10000000' 01838 btfsc demo_mode,0 01839 movwf in2 01840 #endif ; GATOR 01841 01842 #ifdef ROCKET 01843 clrf in0 01844 01845 movlw b'11100000' 01846 btfsc demo_mode,0 01847 movwf in0 01848 #endif ; ROCKET 01849 01850 #ifdef RGB2_DOGTAG 01851 bcf in0,2 01852 btfsc demo_mode,0 01853 bsf in0,2 01854 #endif 01855 01856 01857 #ifdef M3X3 01858 clrf in2 01859 01860 movlw b'11100000' 01861 btfsc demo_mode,0 01862 movwf in2 01863 #endif ; M3X3 01864 01865 #ifdef S19 01866 clrf in1 01867 clrf in2 01868 01869 movlw b'11100000' 01870 btfsc demo_mode,0 01871 movwf in2 01872 #else 01873 #ifdef BI6 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 75 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01874 #ifdef MONO 01875 btfsc demo_mode,0 01876 bsf in0,2 01877 #else ; bicolor 0291 185B 01878 btfsc demo_mode,0 0292 1657 01879 bsf in1,4 01880 #endif ; end Mono/bicolor 01881 #endif ; end BI 01882 #endif ; end S19/BI6 01883 01884 #ifdef RGB4 01885 btfsc demo_mode,0 01886 bsf in1,7 01887 #endif ; RGB4 01888 01889 #ifdef SRGB 01890 movlw b'00111000' 01891 btfsc demo_mode,0 01892 movwf in4 01893 #endif ; SRGB 01894 0293 30FF 01895 movlw 0xFF 0294 235D 01896 call display_1bit 01897 #ifdef RGB_4x4x4 ; temp button change slowdown for 4x4x4 01898 movlw 0xFF 01899 call display_1bit 01900 movlw 0xFF 01901 call display_1bit 01902 #endif 01903 0295 01D6 01904 clrf in0 0296 01D7 01905 clrf in1 0297 01D8 01906 clrf in2 0298 3001 01907 movlw 0x01 0299 235D 01908 call display_1bit 029A 0008 01909 return 01910 #endif ; M8X16 01911 01912 ;********************************************************************** 029B 01913 setup_pattern_table 01914 ;********************************************************************** 01915 var tbl_hi 00000051 M tbl_hi equ mem 00000052 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01916 var tbl_low 00000052 M tbl_low equ mem 00000053 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 76 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01917 var pattern_temp 00000053 M pattern_temp equ mem 00000054 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 01918 ; New code optimized for new pics DDF enhancement 01919 029B 3084 01920 movlw HIGH MasterTable 029C 0087 01921 movwf FSR1H 029D 306A 01922 movlw LOW MasterTable 029E 0086 01923 movwf FSR1L 029F 0A54 01924 incf pattern,w 02A0 00D3 01925 movwf pattern_temp 01926 02A1 01927 loop 02A1 0016 01928 MOVIW FSR1++ 02A2 00D1 01929 movwf tbl_hi 02A3 0016 01930 MOVIW FSR1++ 02A4 00D2 01931 movwf tbl_low 02A5 0BD3 01932 DECFSZ pattern_temp,1 02A6 2AA1 01933 goto loop 01934 02A7 0852 01935 movfw tbl_low 02A8 0086 01936 movwf FSR1L 02A9 0851 01937 movfw tbl_hi 02AA 17D1 01938 bsf tbl_hi,7 ;set bit 7 high (microchip example does not have this?) 02AB 0087 01939 movwf FSR1H 02AC 0008 01940 return 01941 01942 #ifdef DEAD 01943 ;********************************************************************** 01944 setup_pattern_table_old ; obs code now using IND1 to lookup table entries. 01945 ;********************************************************************** 01946 var tbl_hi 01947 var tbl_low 01948 var temp_high 01949 ; 01950 ; Set the pattern (table) 01951 ; 01952 movlw HIGH MasterTable 01953 movwf tbl_hi 01954 movlw LOW MasterTable 01955 movwf tbl_low 01956 01957 ; get the high address for the pattern table 01958 bcf STATUS,0 ; clear carry flag 01959 rlf pattern,w ; entry = table * 2 01960 movwf pindex 01961 bcf INTCON, GIE ; disable INTs 01962 call table_lookup 01963 bsf INTCON, GIE ; enable INTs 01964 movwf temp_high ; can't put it in tbl_high yet MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 77 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01965 01966 ; get the low address for the pattern table 01967 bsf STATUS,0 ; set carry 01968 rlf pattern,w ; entry = table * 2 + 1 01969 movwf pindex 01970 bcf INTCON, GIE ; disable INTs 01971 call table_lookup 01972 bsf INTCON, GIE ; enable INTs 01973 movwf tbl_low 01974 01975 movf temp_high,w 01976 movwf tbl_hi 01977 01978 sreturn 01979 return 01980 #endif 01981 ;********************************************************************** 02AD 01982 get_next_pattern_entry 01983 ;********************************************************************** 01984 ; 01985 ; rewrite for new chips using indirect addressing of program flash DDF BUG!! 01986 ; 01987 01988 01989 #ifndef NOEEPROM 01990 ; if hi address is 0xf0 pattern is in eeprom. 02AD 30F0 01991 movlw 0xf0 02AE 0251 01992 subwf tbl_hi,w 02AF 1D03 01993 btfss STATUS,Z 02B0 2AB8 01994 goto in_mem 01995 01996 ; table in eeprom 02B1 0852 01997 movfw tbl_low 02B2 077E 01998 addwf pindex,w 01999 02B3 22CD 02000 call read_eeprom 02001 02B4 0FFE 02002 incfsz pindex,f 02B5 2AB9 02003 goto greturn1 02B6 0AFD 02004 incf pindex1,f 02B7 2AB9 02005 goto greturn1 02006 #endif 02007 02008 ; table in program memory 02009 02B8 02010 in_mem 02011 02B8 0016 02012 MOVIW FSR1++ 02013 02B9 02014 greturn1 02B9 0008 02015 return 02016 02017 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 78 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02018 #ifdef DEAD 02019 ;********************************************************************** 02020 get_next_pattern_entry_old ; obs code now using IND1 to lookup table entries. 02021 ;********************************************************************** 02022 var pclath_save 02023 var temp2 02024 02025 #ifndef NOEEPROM 02026 ; if hi address is 0x21 pattern is in eeprom ; This could be F000 now DDF BUG!! 02027 movlw 0xf0 02028 subwf tbl_hi,w 02029 btfss STATUS,Z 02030 goto glabel1 02031 02032 ; table in eeprom 02033 movfw tbl_low 02034 addwf pindex,w 02035 02036 call read_eeprom 02037 02038 goto greturn 02039 #endif 02040 02041 ; table in program memory 02042 02043 glabel1 02044 02045 bcf INTCON, GIE ; disable INTs 02046 movfw PCLATH 02047 movwf pclath_save 02048 02049 movfw tbl_hi 02050 addwf pindex1,w 02051 movwf offset_hi 02052 02053 bcf STATUS,C 02054 movfw tbl_low 02055 addwf pindex,w 02056 movwf offset_low 02057 02058 btfsc STATUS,C 02059 incf offset_hi,f 02060 call jump_address 02061 02062 movwf temp2 02063 movfw pclath_save 02064 movwf PCLATH 02065 movfw temp2 02066 bsf INTCON, GIE ; enable INTs 02067 02068 greturn 02069 incfsz pindex,f 02070 goto gskip MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 79 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02071 incf pindex1,f 02072 gskip 02073 return 02074 #endif 02075 02076 #ifndef NOEEPROM 02077 ;********************************************************************** 02BA 02078 write_eeprom 02079 ; expects EEPROM address and data in pindex and input 02080 ; makes sure previous write (if any) has completed before proceeding 02081 ;********************************************************************** 02BA 0023 02082 BANKSEL EECON1 02083 02BB 1895 02084 btfsc EECON1,WR ;wait for WR to clear 02BC 2ABB 02085 goto $-1 02086 02BD 138B 02087 bcf INTCON, GIE ; disable INTs 02BE 1515 02088 bsf EECON1,WREN ;enable writes 02BF 0023 02089 BANKSEL EEADR 02C0 087E 02090 movf pindex,w ;set address 02C1 0091 02091 movwf EEADR 02C2 087C 02092 movf input,w ;set data 02C3 0093 02093 movwf EEDAT 02C4 0023 02094 BANKSEL EECON1 02C5 3055 02095 movlw 0x55 ;EECON2 = 0x55 ;unlock sequence 02C6 0096 02096 movwf EECON2 02C7 30AA 02097 movlw 0xAA ;EECON2 = 0xAA ;unlock sequence 02C8 0096 02098 movwf EECON2 02C9 1495 02099 bsf EECON1,WR ;initiate a write cycle 02CA 178B 02100 bsf INTCON, GIE ; enable INT 02101 02CB 0020 02102 MOVLB 0x00 02CC 0008 02103 return 02104 02105 02106 ;********************************************************************** 02CD 02107 read_eeprom 02108 ; expects EEPROM address in W 02109 ; returns EEPROM data in W 02110 ; makes sure previous write (if any) has completed before proceeding 02111 ;********************************************************************** 02CD 138B 02112 bcf INTCON, GIE ; disable INTs 02113 02CE 0023 02114 BANKSEL EECON1 02CF 1895 02115 btfsc EECON1,WR ;wait for WR to clear 02D0 2ACF 02116 goto $-1 02117 02D1 1115 02118 bcf EECON1,WREN ;disable writes 02D2 0023 02119 BANKSEL EEADR 02D3 0091 02120 movwf EEADR ;EEADR = W 02D4 0023 02121 BANKSEL EECON1 02D5 1395 02122 bcf EECON1,7 ;clear EEPGD 02D6 1415 02123 bsf EECON1,RD ;initiate a read cycle MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 80 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02D7 0023 02124 BANKSEL EEDAT 02D8 0813 02125 movf EEDAT,w ;W = EEDAT 02126 02D9 0020 02127 BANKSEL INTCON 02DA 178B 02128 bsf INTCON, GIE ; enable INT 02DB 0008 02129 return 02130 #endif 02131 02132 ;********************************************************************** 02DC 02133 read_demo_mode 02134 ;********************************************************************** 02135 #ifndef NOEEPROM 02DC 306C 02136 movlw LOW demo_store 02DD 22CD 02137 call read_eeprom 02138 #else 02139 movlw 0x00 02140 #endif 02DE 00DB 02141 movwf demo_mode 02DF 0008 02142 return 02143 02144 ;********************************************************************** 02E0 02145 toggle_demo 02146 ;********************************************************************** 02E0 22DC 02147 call read_demo_mode 02148 #ifndef NOEEPROM 02E1 1C5B 02149 btfss demo_mode,0 ; 02E2 2AE5 02150 goto tdemo_on 02151 02152 ; toggle off 02E3 105B 02153 bcf demo_mode,0 02E4 2AE6 02154 goto tdemo_cont 02155 02E5 02156 tdemo_on 02E5 145B 02157 bsf demo_mode,0 02158 02E6 02159 tdemo_cont 02E6 306C 02160 movlw LOW demo_store 02E7 00FE 02161 movwf pindex 02E8 085B 02162 movfw demo_mode 02E9 00FC 02163 movwf input 02EA 22BA 02164 call write_eeprom 02165 02EB 2288 02166 call display_pattern_id 02EC 2288 02167 call display_pattern_id 02168 #endif 02ED 0008 02169 return 02170 02171 02172 ;********************************************************************** 02EE 02173 pattern_driver 02174 ;********************************************************************** 02175 02176 var pattern MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 81 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00000054 M pattern equ mem 00000055 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 02177 var tbltype 00000055 M tbltype equ mem 00000056 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 02178 var in0 00000056 M in0 equ mem 00000057 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 02179 var in1 00000057 M in1 equ mem 00000058 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 02180 var in2 00000058 M in2 equ mem 00000059 M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 02181 #ifndef BADGE_G2 02182 #ifndef RGB2_DOGTAG 02183 #ifndef BI6 02184 #ifndef RGB4 02185 #ifndef BI6_DOGTAG 02186 #ifndef GATOR 02187 #ifndef ROCKET 02188 #ifndef S19 02189 #ifndef M3X3 02190 var in3 02191 #ifndef BADGE 02192 var in4 02193 var in5 02194 #ifndef C12 02195 var in6 02196 var in7 02197 var in8 02198 var in9 02199 #ifndef C19 02200 var ina 02201 var inb 02202 var inc 02203 var ind 02204 var ine MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 82 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02205 var inf 02206 var in10 02207 var in11 02208 var in12 02209 #ifndef SRGB 02210 var in13 02211 var in14 02212 var in15 02213 var in16 02214 #ifndef RBG_4x4x4 02215 var in17 02216 var in18 02217 var in19 02218 var in1a 02219 var in1b 02220 var in1c 02221 var in1d 02222 var in1e 02223 var in1f 02224 #ifndef M8X16 02225 #endif ; M8X16 02226 #endif ; SRGB 02227 #endif ; RBG_4x4x4 02228 #endif ; C19 02229 #endif ; C12 02230 #endif ; BADGE 02231 #endif ; M3X3 02232 #endif ; S19 02233 #endif ; ROCKET 02234 #endif ; GATOR 02235 #endif ; BI6_DOGTAG 02236 #endif ; RGB4 02237 #endif ; BI6 02238 #endif ; RGB2_DOGTAG 02239 #endif ; BADGE_G2 02240 02241 02242 var speed 00000059 M speed equ mem 0000005A M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 02243 var pspeed 0000005A M pspeed equ mem 0000005B M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 02244 var demo_mode 0000005B M demo_mode equ mem 0000005C M mem = mem + 1 M if (mem >= mem2) MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 83 LOC OBJECT CODE LINE SOURCE TEXT VALUE M error 'Too much var space used' M endif 02245 var psize 0000005C M psize equ mem 0000005D M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 02246 02247 ; need to be able to access from page1 & page2 for eeprom read/write 02248 var_all_bank pindex ; pattern index 0000007E M pindex equ mem2 0000007D M mem2 = mem2 - 1 M if (mem >= mem2) M error 'Too much var space used' 02249 var_all_bank pindex1 ; pattern index 0000007D M pindex1 equ mem2 0000007C M mem2 = mem2 - 1 M if (mem >= mem2) M error 'Too much var space used' 02250 var_all_bank input 0000007C M input equ mem2 0000007B M mem2 = mem2 - 1 M if (mem >= mem2) M error 'Too much var space used' 02251 02EE 02252 ptop 02253 02EE 229B 02254 call setup_pattern_table 02255 02EF 01FE 02256 clrf pindex 02F0 01FD 02257 clrf pindex1 02258 02259 ; load the table type (Currently only 1 type) 02F1 22AD 02260 call get_next_pattern_entry 02F2 00D5 02261 movwf tbltype 02F3 13D5 02262 bcf tbltype,7 ; using top bit for demo mode. 02263 02264 ; load the speed (someday this will be a table type 1 only thing.) 02F4 22AD 02265 call get_next_pattern_entry 02F5 00DA 02266 movwf pspeed 02F6 0ADA 02267 incf pspeed,f ; adjust so 0 is fastest, not treated like speed 256 02268 02269 ; load the table size 02F7 22AD 02270 call get_next_pattern_entry ;4rgb 02F8 00DC 02271 movwf psize ;4rgb 02272 02F9 02273 ploop0 02274 ; 02275 ; Check for IR command in 02276 ; 02F9 1C3C 02277 btfss IR_in_good,0 02FA 2B17 02278 goto button_check MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 84 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02279 02FB 02280 blinkie_check 02FB 3007 02281 movlw 0x07 ; blinkines use address 0x07 (Experimental) 02FC 0236 02282 subwf address,w 02FD 1D03 02283 btfss STATUS,Z 02FE 2B02 02284 goto remote_check 02285 02FF 2274 02286 call set_pattern 0300 01BC 02287 clrf IR_in_good 0301 2AEE 02288 goto ptop 02289 0302 02290 remote_check 0302 08B6 02291 movf address,f ; remote giving "0" for address (TV)? 0303 1D03 02292 btfss STATUS,Z 0304 2B17 02293 goto button_check 02294 0305 3020 02295 movlw 0x20 ; remote curser right (pattern ++) 0306 0235 02296 subwf command,w 0307 1903 02297 btfsc STATUS,Z 0308 225F 02298 call next_pattern 02299 0309 3021 02300 movlw 0x21 ; remote curser left (pattern --) 030A 0235 02301 subwf command,w 030B 1903 02302 btfsc STATUS,Z 030C 2269 02303 call past_pattern 02304 030D 3000 02305 movlw 0x00 ; remote "0" key (pattern = 0) 030E 0235 02306 subwf command,w 030F 1903 02307 btfsc STATUS,Z 0310 01D4 02308 clrf pattern 02309 0311 300C 02310 movlw 0x0c ; remote on/off key (togle demo mode!) 0312 0235 02311 subwf command,w 0313 1903 02312 btfsc STATUS,Z 0314 22E0 02313 call toggle_demo 02314 0315 01BC 02315 clrf IR_in_good 0316 2AEE 02316 goto ptop 02317 0317 02318 button_check 02319 ; ploop1 02320 0317 0839 02321 movfw button ; if any putton pressed show pattern id 0318 1903 02322 btfsc STATUS,Z 0319 2B29 02323 goto ploop2 02324 031A 2288 02325 call display_pattern_id 031B 2288 02326 call display_pattern_id 02327 031C 02328 ploop1a 02329 02330 #ifdef M3X3 02331 movlw 0x03 ; if button 3 & 4 presses MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 85 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02332 subwf button,w 02333 btfsc STATUS,Z 02334 goto mode_loop 02335 02336 movlw 0x0C ; if button 1 & 2 presses 02337 subwf button,w 02338 btfsc STATUS,Z 02339 call toggle_demo 02340 02341 #endif 02342 02343 #ifdef M8X16 02344 movlw 0x03 ; if both buttons pressed 02345 subwf button,w 02346 btfsc STATUS,Z 02347 call toggle_demo 02348 #endif 02349 #ifdef C12 02350 movlw 0x03 ; if both buttons pressed 02351 subwf button,w 02352 btfsc STATUS,Z 02353 call toggle_demo 02354 #endif 02355 02356 031C 1839 02357 btfsc button,0 ; if button 3 pressed inc pattern 031D 2B21 02358 goto ploop1up 02359 031E 18B9 02360 btfsc button,1 ; if button 4 pressed dec pattern 031F 2B25 02361 goto ploop1down 02362 0320 2AEE 02363 goto ptop 02364 0321 02365 ploop1up 0321 225F 02366 call next_pattern 0322 2288 02367 call display_pattern_id 0323 2288 02368 call display_pattern_id 0324 2B1C 02369 goto ploop1a 02370 0325 02371 ploop1down 0325 2269 02372 call past_pattern 0326 2288 02373 call display_pattern_id 0327 2288 02374 call display_pattern_id 0328 2B1C 02375 goto ploop1a 0329 02376 ploop2 02377 02378 #ifdef PATTERN1 0329 3001 02379 movlw 0x01 ; pattern1 032A 0255 02380 subwf tbltype,w 032B 1903 02381 btfsc STATUS,Z 032C 2344 02382 call table_type_1 02383 #endif 02384 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 86 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02385 #ifdef PATTERN2 02386 movlw 0x02 ; pattern2 02387 subwf tbltype,w 02388 btfsc STATUS,Z 02389 call table_type_2 02390 #endif 02391 02392 #ifdef PATTERN3 032D 3003 02393 movlw 0x03 ; pattern3 032E 0255 02394 subwf tbltype,w 032F 1903 02395 btfsc STATUS,Z 0330 234E 02396 call table_type_3 02397 #endif 02398 02399 #ifdef PATTERN4 02400 movlw 0x04 ; pattern4 02401 subwf tbltype,w 02402 btfsc STATUS,Z 02403 call table_type_4 02404 #endif 02405 02406 #ifdef PATTERN5 02407 movlw 0x05 ; pattern5 02408 subwf tbltype,w 02409 btfsc STATUS,Z 02410 call table_type_5 02411 #endif 02412 02413 #ifdef PATTERN6 02414 movlw 0x06 ; pattern6 02415 subwf tbltype,w 02416 btfsc STATUS,Z 02417 call table_type_6 02418 #endif 02419 02420 #ifdef PATTERN7 02421 movlw 0x07 ; pattern7 02422 subwf tbltype,w 02423 btfsc STATUS,Z 02424 call table_type_7 02425 #endif 02426 02427 #ifdef PATTERN8 02428 movlw 0x08 ; pattern8 02429 subwf tbltype,w 02430 btfsc STATUS,Z 02431 call table_type_8 02432 #endif 02433 02434 #ifdef PATTERN9 02435 movlw 0x09 ; pattern9 02436 subwf tbltype,w 02437 btfsc STATUS,Z MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 87 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02438 call table_type_9 02439 #endif 02440 02441 #ifdef PATTERN10 02442 movlw 0x0A ; pattern10 02443 subwf tbltype,w 02444 btfsc STATUS,Z 02445 call table_type_10 02446 #endif 02447 02448 #ifdef PATTERN11 02449 movlw 0x0B ; pattern11 02450 subwf tbltype,w 02451 btfsc STATUS,Z 02452 call table_type_11 02453 #endif 02454 02455 #ifdef PATTERN12 02456 movlw 0x0C ; pattern12 02457 subwf tbltype,w 02458 btfsc STATUS,Z 02459 call table_type_12 02460 #endif 02461 02462 #ifdef PATTERN13 02463 movlw 0x0D ; pattern13 02464 subwf tbltype,w 02465 btfsc STATUS,Z 02466 call table_type_13 02467 #endif 02468 02469 #ifdef PATTERN14 02470 movlw 0x0E ; pattern14 02471 subwf tbltype,w 02472 btfsc STATUS,Z 02473 call table_type_14 02474 #endif 02475 02476 #ifdef PATTERN15 02477 movlw 0x0F ; pattern15 02478 subwf tbltype,w 02479 btfsc STATUS,Z 02480 call table_type_15 02481 #endif 02482 02483 #ifdef PATTERN16 02484 movlw 0x10 ; pattern16 02485 subwf tbltype,w 02486 MOVLP high table_type_16 02487 btfsc STATUS,Z 02488 call table_type_16 02489 MOVLP high pattern_driver 02490 #endif MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 88 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02491 02492 #ifdef PATTERN17 02493 movlw 0x11 ; pattern17 02494 subwf tbltype,w 02495 btfsc STATUS,Z 02496 call table_type_17 02497 #endif 02498 02499 #ifdef PATTERN18 02500 movlw 0x12 ; pattern18 02501 subwf tbltype,w 02502 MOVLP high table_type_18 02503 btfsc STATUS,Z 02504 call table_type_18 02505 MOVLP high pattern_driver 02506 #endif 02507 02508 #ifdef PATTERN19 02509 movlw 0x13 ; pattern19 02510 subwf tbltype,w 02511 MOVLP high table_type_19 02512 btfsc STATUS,Z 02513 call table_type_19 02514 MOVLP high pattern_driver 02515 #endif 02516 02517 #ifdef PATTERN20 02518 movlw 0x14 ; pattern20 02519 subwf tbltype,w 02520 MOVLP high table_type_20 02521 btfsc STATUS,Z 02522 call table_type_20 02523 MOVLP high pattern_driver 02524 #endif 02525 02526 #ifdef PATTERN21 02527 movlw 0x15 ; pattern21 02528 subwf tbltype,w 02529 MOVLP high table_type_21 02530 btfsc STATUS,Z 02531 call table_type_21 02532 MOVLP high pattern_driver 02533 #endif 02534 02535 #ifdef PATTERN22 02536 movlw 0x16 ; pattern22 02537 subwf tbltype,w 02538 PAGESEL table_type_22 02539 btfsc STATUS,Z 02540 call table_type_22 02541 PAGESEL pattern_driver 02542 #endif 02543 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 89 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02544 #ifdef PATTERN23 02545 movlw 0x17 ; pattern23 02546 subwf tbltype,w 02547 PAGESEL table_type_23 02548 btfsc STATUS,Z 02549 call table_type_23 02550 PAGESEL pattern_driver 02551 #endif 02552 02553 #ifdef PATTERN24 02554 movlw 0x18 ; pattern24 02555 subwf tbltype,w 02556 PAGESEL table_type_24 02557 btfsc STATUS,Z 02558 call table_type_24 02559 PAGESEL pattern_driver 02560 #endif 02561 02562 #ifdef PATTERN25 02563 movlw 0x19 ; pattern25 02564 subwf tbltype,w 02565 PAGESEL table_type_25 02566 btfsc STATUS,Z 02567 call table_type_25 02568 PAGESEL pattern_driver 02569 #endif 02570 02571 #ifdef PATTERN26 02572 movlw 0x1a ; pattern26 02573 subwf tbltype,w 02574 PAGESEL table_type_26 02575 btfsc STATUS,Z 02576 goto table_type_26 ; to save stack we use "goto" to pattern_return 02577 PAGESEL pattern_driver 02578 #endif 02579 02580 #ifdef PATTERN27 02581 movlw 0x1b ; pattern27 02582 subwf tbltype,w 02583 PAGESEL table_type_27 02584 btfsc STATUS,Z 02585 goto table_type_27 ; to save stack we use "goto" to pattern_return 02586 PAGESEL pattern_driver 02587 #endif 02588 02589 #ifdef PATTERN28 02590 movlw 0x1c ; pattern28 02591 subwf tbltype,w 02592 btfsc STATUS,Z 02593 ca/ll table_type_28 02594 #endif 02595 02596 #ifdef PATTERN29 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 90 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02597 movlw 0x1d ; pattern29 02598 subwf tbltype,w 02599 btfsc STATUS,Z 02600 call table_type_29 02601 #endif 02602 02603 #ifdef PATTERN30 02604 movlw 0x1e ; pattern30 02605 subwf tbltype,w 02606 btfsc STATUS,Z 02607 call table_type_30 02608 #endif 02609 #ifdef PATTERN31 02610 movlw 0x1f ; pattern31 02611 subwf tbltype,w 02612 btfsc STATUS,Z 02613 call table_type_31 02614 #endif 02615 #ifdef PATTERN32 02616 movlw 0x20 ; pattern32 02617 subwf tbltype,w 02618 btfsc STATUS,Z 02619 call table_type_32 02620 #endif 02621 0331 02622 pattern_return 02623 02624 ; make sure we are not sending a IR signel 0331 0849 02625 movf scount,w ; F22 0332 3E00 02626 addlw 0 ; F23 0333 1D03 02627 btfss STATUS,Z ; F24 0334 2B41 02628 goto ploop3 02629 02630 ; count down till net IR signel 0335 1CA0 02631 btfss nextf,1 0336 2B41 02632 goto ploop3 02633 0337 10A0 02634 bcf nextf,1 0338 1C5B 02635 btfss demo_mode,0 0339 2B3C 02636 goto ploop2a 02637 033A 225F 02638 call next_pattern 033B 2AEE 02639 goto ptop 02640 033C 02641 ploop2a 02642 ; send an IR signel 02643 #ifdef ENABLE_IR 033C 3007 02644 movlw 0x07 ; address 0x07 "Experimental" 033D 00C1 02645 movwf out_address 033E 0844 02646 movfw out_pattern 033F 00C2 02647 movwf out_command ; copy out_pettern 02648 0340 2213 02649 call rf_command_out MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 91 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02650 #endif 02651 0341 02652 ploop3 0341 0BDC 02653 decfsz psize,f ;check for end of pattern (4rgb) 0342 2AF9 02654 goto ploop0 02655 0343 2AEE 02656 goto ptop 02657 02658 02659 #ifdef PATTERN1 02660 #include pattern_01.asm 00001 ;********************************************************************** 00002 ; Copyright (C) 2005,2006,2007 Dwayne Forsyth 00003 ; 00004 ; This program is free software; you can redistribute it and/or 00005 ; modify it under the terms of the GNU General Public License 00006 ; as published by the Free Software Foundation; either version 2 00007 ; of the License, or (at your option) any later version. 00008 ; 00009 ; This program is distributed in the hope that it will be useful, 00010 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 ; GNU General Public License for more details. 00013 ; 00014 ; You should have received a copy of the GNU General Public License 00015 ; along with this program; if not, write to the 00016 ; 00017 ; Free Software Foundation, Inc. 00018 ; 51 Franklin Street, Fifth Floor 00019 ; Boston, MA 02110-1301, USA. 00020 ; 00021 ;********************************************************************** 00022 00023 ;********************************************************************** 0344 00024 table_type_1 00025 ;********************************************************************** 00026 ; 76543210 <-- bits 00027 ; AABBCCDD <-- LEDs 00028 ; 01010101 <-- stays on for 1 unit - b'01' 00029 ; 10101010 <-- stays on for 2 units - b'10' 00030 ; 11111111 <-- stays on for 3 units - b'11' 00031 00032 ; in0 red 00033 ; in1 green 00034 ; in2 blu 00035 0344 22AD 00036 call get_next_pattern_entry 0345 00D6 00037 movwf in0 00038 0346 22AD 00039 call get_next_pattern_entry 0347 00D7 00040 movwf in1 00041 0348 22AD 00042 call get_next_pattern_entry ;4rgb MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 92 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0349 00D8 00043 movwf in2 ;4rgb 00044 034A 085A 00045 movf pspeed,w 034B 00D9 00046 movwf speed 034C 2385 00047 call display_2bit 00048 034D 0008 00049 return 00050 02661 #endif 02662 #ifdef PATTERN2 02663 #include pattern_02.asm 02664 #endif 02665 #ifdef PATTERN3 02666 #include pattern_03.asm 00001 ;********************************************************************** 00002 ; Copyright (C) 2005,2006,2007 Dwayne Forsyth 00003 ; 00004 ; This program is free software; you can redistribute it and/or 00005 ; modify it under the terms of the GNU General Public License 00006 ; as published by the Free Software Foundation; either version 2 00007 ; of the License, or (at your option) any later version. 00008 ; 00009 ; This program is distributed in the hope that it will be useful, 00010 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 ; GNU General Public License for more details. 00013 ; 00014 ; You should have received a copy of the GNU General Public License 00015 ; along with this program; if not, write to the 00016 ; 00017 ; Free Software Foundation, Inc. 00018 ; 51 Franklin Street, Fifth Floor 00019 ; Boston, MA 02110-1301, USA. 00020 ; 00021 ;********************************************************************** 00022 00023 ;********************************************************************** 034E 00024 table_type_3 00025 ;********************************************************************** 00026 ; 00027 ; 2 bytes 00028 ; 00029 ; RRRRGGGG BBBBCDDD 00030 ; 00031 ; RRRR = bit of red LEDs to turn on 00032 ; GGGG = bit of red LEDs to turn on 00033 ; BBBB = bit of red LEDs to turn on 00034 ; CDDD = a repeat counter. 00035 ; 00036 ; For badge blinkies 00037 ; C is 13th LED 00038 ; DDD = is repeat count 00039 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 93 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00040 var p2count 0000005D M p2count equ mem 0000005E M mem = mem + 1 M if (mem >= mem2) M error 'Too much var space used' M endif 00041 034E 22AD 00042 call get_next_pattern_entry 034F 00D6 00043 movwf in0 00044 0350 22AD 00045 call get_next_pattern_entry 0351 00D7 00046 movwf in1 00047 00048 #ifdef BADGE 00049 movlw b'00000111' 00050 #else 0352 300F 00051 movlw b'00001111' 00052 #endif 0353 0557 00053 andwf in1,w 0354 00DD 00054 movwf p2count 0355 0ADD 00055 incf p2count,f 0356 0DDD 00056 rlf p2count,f 0357 0DDD 00057 rlf p2count,f 00058 0358 00059 p2loop 0358 085A 00060 movfw pspeed 0359 235D 00061 call display_1bit 00062 035A 0BDD 00063 decfsz p2count,f 035B 2B58 00064 goto p2loop 00065 035C 0008 00066 return 00067 00068 02667 #endif 02668 #ifdef PATTERN4 02669 #include pattern_04.asm 02670 #endif 02671 #ifdef PATTERN5 02672 #include pattern_05.asm 02673 #endif 02674 #ifdef PATTERN6 02675 #include pattern_06.asm 02676 #endif 02677 02678 #define BRIGHT1 0x40 02679 #define BRIGHT2 0xA0 02680 02681 #ifdef PATTERN7 02682 #include pattern_07.asm 02683 #endif 02684 #ifdef PATTERN19 02685 #include pattern_19.asm MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 94 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02686 #endif 02687 #ifdef PATTERN8 02688 #include pattern_08.asm 02689 #endif 02690 #ifdef PATTERN9 02691 #include pattern_09.asm 02692 #endif 02693 #ifdef PATTERN10 02694 #include pattern_10.asm 02695 #endif 02696 #ifdef PATTERN11 02697 #include pattern_11.asm 02698 #endif 02699 02700 #ifdef RANDOM 02701 02702 ;********************************************************************** 02703 gen_random 02704 ;********************************************************************** 02705 02706 var random 02707 02708 RLF random,W 02709 RLF random,W 02710 BTFSC random,4 02711 XORLW 1 02712 BTFSC random,5 02713 XORLW 1 02714 BTFSC random,3 02715 XORLW 1 02716 MOVWF random 02717 return 02718 #endif 02719 02720 #ifdef PATTERN12 02721 #include pattern_12.asm 02722 #endif 02723 #ifdef PATTERN13 02724 #include pattern_13.asm 02725 #endif 02726 #ifdef PATTERN14 02727 #include pattern_14.asm 02728 #endif 02729 #ifdef PATTERN15 02730 #include pattern_15.asm 02731 #endif 02732 #ifdef PATTERN17 02733 #include pattern_17.asm 02734 #endif 02735 #ifdef PATTERN22 02736 #include pattern_22.asm 02737 #endif 02738 #ifdef PATTERN23 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 95 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02739 #include pattern_23.asm 02740 #endif 02741 02742 #ifdef M8X16 02743 ;********************************************************************** 02744 shift_left 02745 ;********************************************************************** 02746 ; 02747 ; shift the in1f->in1e->in1d->....->in1->in0 02748 ; 02749 02750 02751 movlw LOW in0 ; shift down in1f->in0 02752 movwf FSR0L 02753 movlw HIGH in0 02754 movwf FSR0H 02755 02756 movlw 0x1f 02757 movwf fcount1 02758 02759 t23_loop 02760 02761 MOVIW INDF0++ ; inc INDFO (don't use W) 02762 MOVIW INDF0-- ; get W, dec INDF0 02763 MOVWI INDF0++ ; put W, inc INDF0 02764 02765 decfsz fcount1,f 02766 goto t23_loop 02767 02768 return 02769 #endif 02770 02771 #ifdef PATTERN24 02772 #include "pattern_24.asm" 02773 #endif 02774 #ifdef PATTERN25 02775 #include "pattern_25.asm" 02776 #endif 02777 #ifdef PATTERN26 02778 #include "pattern_26.asm" 02779 #endif 02780 #ifdef PATTERN28 02781 #include "pattern_28.asm" 02782 #endif 02783 #ifdef PATTERN29 02784 #include "pattern_29.asm" 02785 #endif 02786 #ifdef PATTERN30 02787 #include "pattern_30.asm" 02788 #endif 02789 #ifdef PATTERN31 02790 #include "pattern_31.asm" 02791 #endif MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 96 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02792 #ifdef PATTERN31 02793 #include "pattern_32.asm" 02794 #endif 02795 02796 #ifdef DISPLAY_1BIT_A 02797 #include display_1bit_a.asm ; Mono 6 circle / mono badge / mono 6 dogtag 02798 #endif 02799 #ifdef DISPLAY_1BIT_B 02800 #include display_1bit_b.asm ; Bicolor 19 circle / mono 19 circle/ mono 19 circle 02801 #endif 02802 #ifdef DISPLAY_1BIT_C 02803 #include display_1bit_c.asm ; 4RGB / bicolor 6 circle / Bicolor Badge / bicolor 6 dogtag / 2RGB dogtag 00001 ;********************************************************************** 035D 00002 display_1bit ; 12 LEDs, BI6 & 4RGB Badge LED add center (IR) for 13 00003 ;********************************************************************** 00004 035D 00D9 00005 movwf speed ;w has the speed/delay 00006 035E 01A6 00007 clrf Ar_reg 035F 1BD6 00008 btfsc in0,7 0360 09A6 00009 comf Ar_reg,f 00010 0361 01A7 00011 clrf Ag_reg 0362 19D6 00012 btfsc in0,3 0363 09A7 00013 comf Ag_reg,f 00014 0364 01A8 00015 clrf Ab_reg 0365 1BD7 00016 btfsc in1,7 0366 09A8 00017 comf Ab_reg,f 00018 0367 01A9 00019 clrf Br_reg 0368 1B56 00020 btfsc in0,6 0369 09A9 00021 comf Br_reg,f 00022 036A 01AA 00023 clrf Bg_reg 036B 1956 00024 btfsc in0,2 036C 09AA 00025 comf Bg_reg,f 00026 036D 01AB 00027 clrf Bb_reg 036E 1B57 00028 btfsc in1,6 036F 09AB 00029 comf Bb_reg,f 00030 0370 01AC 00031 clrf Cr_reg 0371 1AD6 00032 btfsc in0,5 0372 09AC 00033 comf Cr_reg,f 00034 0373 01AD 00035 clrf Cg_reg 0374 18D6 00036 btfsc in0,1 0375 09AD 00037 comf Cg_reg,f 00038 0376 01AE 00039 clrf Cb_reg 0377 1AD7 00040 btfsc in1,5 0378 09AE 00041 comf Cb_reg,f MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 97 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00042 0379 01AF 00043 clrf Dr_reg 037A 1A56 00044 btfsc in0,4 037B 09AF 00045 comf Dr_reg,f 00046 037C 01B0 00047 clrf Dg_reg 037D 1856 00048 btfsc in0,0 037E 09B0 00049 comf Dg_reg,f 00050 037F 01B1 00051 clrf Db_reg 0380 1A57 00052 btfsc in1,4 0381 09B1 00053 comf Db_reg,f 00054 00055 #ifdef BADGE 00056 clrf Center_reg 00057 btfsc in1,3 00058 comf Center_reg,f 00059 #endif 00060 0382 0859 00061 movf speed,w 0383 2281 00062 call strobe_delay 00063 0384 0008 00064 return 00065 02804 #endif 02805 #ifdef DISPLAY_1BIT_D 02806 #include display_1bit_d.asm ; mono 19 Stick 02807 #endif 02808 #ifdef DISPLAY_1BIT_GATOR 02809 #include display_1bit_gator.asm ; gator 02810 #endif 02811 #ifdef DISPLAY_1BIT_ROCKET 02812 #include display_1bit_rocket.asm ; rocket 02813 #endif 02814 #ifdef DISPLAY_1BIT_BADGE_G2 02815 #include display_1bit_badge_g2.asm ; badge G2 02816 #endif 02817 #ifdef DISPLAY_1BIT_F 02818 #include display_1bit_f.asm ; bicolor 3x3 matrix / mono 3x3 matrix 02819 #endif 02820 #ifdef DISPLAY_1BIT_8x16 02821 #include display_1bit_8x16.asm ; 16x8x2 matrix 02822 #endif 02823 #ifdef DISPLAY_1BIT_H 02824 #include display_1bit_h.asm ; bicolor & mono 12 LED circle / bicolor & mono 24 LED sphere 02825 #endif 02826 #ifdef DISPLAY_1BIT_I 02827 #include display_1bit_i.asm ; D10 02828 #endif 02829 #ifdef DISPLAY_1BIT_4x4x4 02830 #include display_1bit_4x4x4.asm ; 4x4x4 cube 02831 #endif 02832 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 98 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02833 #ifdef DISPLAY_2BIT_A ; Mono 6 circle / mono badge / mono 6 dogtag 02834 #include display_2bit_a 02835 #endif 02836 02837 #ifdef DISPLAY_2BIT_C 02838 #include display_2bit_c ; 4RGB / D10 / bicolor 6 circle / Bicolor Badge / bicolor 6 dogtag 00001 ;********************************************************************** 0385 00002 display_2bit 00003 ;********************************************************************** 0385 0859 00004 movf speed,w ;enter here if repeat count is in speed 0386 00005 display_w_2bit ;enter here if repeat count is in W reg 00006 00007 ; 76543210 <-- bits 00008 ; AABBCCDD <-- LEDs 00009 ; 01010101 <-- stays on for 1 unit - b'01' 00010 ; 10101010 <-- stays on for 2 units - b'10' 00011 ; 11111111 <-- stays on for 3 units - b'11' 00012 00013 ; in0 red 00014 ; in1 green 00015 ; in2 blue 00016 0386 01A6 00017 clrf Ar_reg 0387 3040 00018 movlw BRIGHT1 0388 1B56 00019 btfsc in0,6 0389 07A6 00020 addwf Ar_reg,f 038A 30A0 00021 movlw BRIGHT2 038B 1BD6 00022 btfsc in0,7 038C 07A6 00023 addwf Ar_reg,f 00024 038D 01A7 00025 clrf Ag_reg 038E 3040 00026 movlw BRIGHT1 038F 1B57 00027 btfsc in1,6 0390 07A7 00028 addwf Ag_reg,f 0391 30A0 00029 movlw BRIGHT2 0392 1BD7 00030 btfsc in1,7 0393 07A7 00031 addwf Ag_reg,f 00032 0394 01A8 00033 clrf Ab_reg 0395 3040 00034 movlw BRIGHT1 0396 1B58 00035 btfsc in2,6 0397 07A8 00036 addwf Ab_reg,f 0398 30A0 00037 movlw BRIGHT2 0399 1BD8 00038 btfsc in2,7 039A 07A8 00039 addwf Ab_reg,f 00040 039B 01A9 00041 clrf Br_reg 039C 3040 00042 movlw BRIGHT1 039D 1A56 00043 btfsc in0,4 039E 07A9 00044 addwf Br_reg,f 039F 30A0 00045 movlw BRIGHT2 03A0 1AD6 00046 btfsc in0,5 03A1 07A9 00047 addwf Br_reg,f MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 99 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00048 03A2 01AA 00049 clrf Bg_reg 03A3 3040 00050 movlw BRIGHT1 03A4 1A57 00051 btfsc in1,4 03A5 07AA 00052 addwf Bg_reg,f 03A6 30A0 00053 movlw BRIGHT2 03A7 1AD7 00054 btfsc in1,5 03A8 07AA 00055 addwf Bg_reg,f 00056 03A9 01AB 00057 clrf Bb_reg 03AA 3040 00058 movlw BRIGHT1 03AB 1A58 00059 btfsc in2,4 03AC 07AB 00060 addwf Bb_reg,f 03AD 30A0 00061 movlw BRIGHT2 03AE 1AD8 00062 btfsc in2,5 03AF 07AB 00063 addwf Bb_reg,f 00064 03B0 01AC 00065 clrf Cr_reg 03B1 3040 00066 movlw BRIGHT1 03B2 1956 00067 btfsc in0,2 03B3 07AC 00068 addwf Cr_reg,f 03B4 30A0 00069 movlw BRIGHT2 03B5 19D6 00070 btfsc in0,3 03B6 07AC 00071 addwf Cr_reg,f 00072 03B7 01AD 00073 clrf Cg_reg 03B8 3040 00074 movlw BRIGHT1 03B9 1957 00075 btfsc in1,2 03BA 07AD 00076 addwf Cg_reg,f 03BB 30A0 00077 movlw BRIGHT2 03BC 19D7 00078 btfsc in1,3 03BD 07AD 00079 addwf Cg_reg,f 00080 03BE 01AE 00081 clrf Cb_reg 03BF 3040 00082 movlw BRIGHT1 03C0 1958 00083 btfsc in2,2 03C1 07AE 00084 addwf Cb_reg,f 03C2 30A0 00085 movlw BRIGHT2 03C3 19D8 00086 btfsc in2,3 03C4 07AE 00087 addwf Cb_reg,f 00088 03C5 01AF 00089 clrf Dr_reg 03C6 3040 00090 movlw BRIGHT1 03C7 1856 00091 btfsc in0,0 03C8 07AF 00092 addwf Dr_reg,f 03C9 30A0 00093 movlw BRIGHT2 03CA 18D6 00094 btfsc in0,1 03CB 07AF 00095 addwf Dr_reg,f 00096 03CC 01B0 00097 clrf Dg_reg 03CD 3040 00098 movlw BRIGHT1 03CE 1857 00099 btfsc in1,0 03CF 07B0 00100 addwf Dg_reg,f MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 100 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03D0 30A0 00101 movlw BRIGHT2 03D1 18D7 00102 btfsc in1,1 03D2 07B0 00103 addwf Dg_reg,f 00104 03D3 01B1 00105 clrf Db_reg 03D4 3040 00106 movlw BRIGHT1 03D5 1858 00107 btfsc in2,0 03D6 07B1 00108 addwf Db_reg,f 03D7 30A0 00109 movlw BRIGHT2 03D8 18D8 00110 btfsc in2,1 03D9 07B1 00111 addwf Db_reg,f 00112 00113 #ifdef BADGE 00114 clrf Center_reg 00115 movlw BRIGHT1 00116 btfsc in3,6 00117 addwf Center_reg,f 00118 movlw BRIGHT2 00119 btfsc in3,7 00120 addwf Center_reg,f 00121 #endif 00122 03DA 0859 00123 movf speed,w 03DB 2281 00124 call strobe_delay 03DC 0859 00125 movf speed,w 03DD 2281 00126 call strobe_delay 03DE 0859 00127 movf speed,w 03DF 2281 00128 call strobe_delay 00129 03E0 0008 00130 return 00131 02839 #endif 02840 02841 #define BRIGHT1H 0xA0 02842 #define BRIGHT2H 0x40 02843 02844 #ifdef DISPLAY_2BIT_D 02845 #include display_2bit_d ; mono 19 Stick 02846 #endif 02847 02848 #ifdef DISPLAY_2BIT_E 02849 #include display_2bit_e ; mono 19 circle 02850 #endif 02851 02852 #ifdef DISPLAY_1BIT_E 02853 #include display_1bit_e ; RGB Stick Anode / cathode 02854 #endif 02855 02856 ;********************************************************************** 02857 ; IR Tester 02858 ;********************************************************************** 03E1 02859 IR_Tester 03E1 3000 02860 movlw b'00000000' ; Red Eye! MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 101 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03E2 00D6 02861 movwf in0 03E3 3000 02862 movlw b'00000000' 03E4 00D7 02863 movwf in1 03E5 3080 02864 movlw b'10000000' 03E6 00D8 02865 movwf in2 02866 03E7 30FF 02867 movlw 0xff 03E8 235D 02868 call display_1bit 02869 03E9 3000 02870 movlw b'00000000' 03EA 00D8 02871 movwf in2 02872 03EB 30FF 02873 movlw 0xff 03EC 235D 02874 call display_1bit 02875 03ED 3080 02876 movlw b'10000000' 03EE 00D8 02877 movwf in2 02878 03EF 30FF 02879 movlw 0xff 03F0 235D 02880 call display_1bit 02881 03F1 3000 02882 movlw b'00000000' 03F2 00D8 02883 movwf in2 02884 03F3 30FF 02885 movlw 0xff 03F4 235D 02886 call display_1bit 02887 03F5 3080 02888 movlw b'10000000' 03F6 00D8 02889 movwf in2 02890 03F7 30FF 02891 movlw 0xff 03F8 235D 02892 call display_1bit 02893 02894 03F9 02895 itop 03F9 3002 02896 movlw 0x02 03FA 0232 02897 subwf instate,w 03FB 1C03 02898 btfss STATUS,C 03FC 0103 02899 clrw 03FD 00D6 02900 movwf in0 02901 03FE 3000 02902 movlw 0x00 03FF 00D7 02903 movwf in1 02904 0400 3001 02905 movlw 0x01 0401 235D 02906 call display_1bit 02907 02908 ; 02909 ; Check for push button 02910 ; 0402 02911 ibutton 0402 0839 02912 movf button,w 0403 1903 02913 btfsc STATUS,Z MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 102 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0404 2C15 02914 goto iloop1 0405 01B3 02915 clrf max_instate 0406 01B2 02916 clrf instate 02917 0407 0849 02918 movf scount,w ; if sending an IR command ignore button 0408 3E00 02919 addlw 0 ; not sure if needed 0409 1D03 02920 btfss STATUS,Z 040A 2C02 02921 goto ibutton 02922 040B 0839 02923 movf button,w ; 2st 8 bits are the buttons 040C 00D7 02924 movwf in1 040D 01D6 02925 clrf in0 ; next 8 are zero 02926 ; movlw 0x80 02927 ; movwf in2 ; led 17 is on 02928 02929 #ifdef M8X16 02930 movfw button 02931 movwf in3 02932 #endif 02933 040E 3001 02934 movlw 0x01 040F 235D 02935 call display_1bit 02936 02937 ; send an IR signel 0410 01C1 02938 clrf out_address ; address 0x00 "TV remote" 02939 02940 #ifdef M3X3 02941 02942 movlw 0x03 ; if button 3 & 4 presses 02943 subwf button,w 02944 btfsc STATUS,Z 02945 goto mode_loop 02946 02947 btfsc button,0 ; if button 3 pressed 02948 goto send_chan_up 02949 02950 btfsc button,1 ; if button 4 pressed 02951 goto send_chan_down 02952 02953 btfsc button,2 ; if button 1 pressed 02954 goto send_vol_up 02955 02956 btfsc button,3 ; if button 2 pressed 02957 goto send_vol_down 02958 02959 btfsc button,4 ; if button 5 pressed 02960 goto send_on_off 02961 02962 send_chan_up 02963 movlw 0x20 02964 movwf out_command ; code 0x0c (on/off) 02965 call rf_command_out 02966 goto ibutton MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 103 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02967 02968 send_chan_down 02969 movlw 0x21 02970 movwf out_command ; code 0x0c (on/off) 02971 call rf_command_out 02972 goto ibutton 02973 02974 send_vol_up 02975 movlw 0x10 02976 movwf out_command ; code 0x0c (on/off) 02977 call rf_command_out 02978 goto ibutton 02979 02980 send_vol_down 02981 movlw 0x11 02982 movwf out_command ; code 0x0c (on/off) 02983 call rf_command_out 02984 goto ibutton 02985 02986 #endif 02987 0411 02988 send_on_off 0411 300C 02989 movlw 0x0c 0412 00C2 02990 movwf out_command ; code 0x0c (on/off) 0413 2213 02991 call rf_command_out 0414 2C02 02992 goto ibutton 02993 02994 02995 ; 02996 ; Check for IR Command 02997 ; 0415 02998 iloop1 0415 1C3C 02999 btfss IR_in_good,0 0416 2BF9 03000 goto itop 0417 01BC 03001 clrf IR_in_good 03002 03003 ; flash all LEDs Red 0418 30F0 03004 movlw 0xF0 0419 00D6 03005 movwf in0 041A 01D7 03006 clrf in1 03007 041B 307F 03008 movlw 0x7f 041C 235D 03009 call display_1bit 03010 03011 ; flash all LEDs off 041D 01D6 03012 clrf in0 041E 01D7 03013 clrf in1 03014 041F 303F 03015 movlw 0x3f 0420 235D 03016 call display_1bit 03017 03018 ; flash all LEDs Red 0421 30F0 03019 movlw 0xF0 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 104 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0422 00D6 03020 movwf in0 0423 01D7 03021 clrf in1 03022 0424 307F 03023 movlw 0x7f 0425 235D 03024 call display_1bit 03025 03026 ; display command and address 0426 0835 03027 movf command,w 0427 00D6 03028 movwf in0 0428 0836 03029 movf address,w 0429 00D7 03030 movwf in1 03031 042A 30FF 03032 movlw 0xff 042B 235D 03033 call display_1bit 042C 30FF 03034 movlw 0xff 042D 235D 03035 call display_1bit 042E 01B3 03036 clrf max_instate 042F 01B2 03037 clrf instate 03038 0430 2BF9 03039 goto itop 03040 03041 #ifdef M3X3 03042 #include m3x3_dice.asm 03043 #endif 03044 03045 ; 03046 ; M A I N 03047 ; 03048 ;********************************************************************** 0431 03049 main 03050 ;********************************************************************** 0431 018C 03051 clrf PORTA 0432 0195 03052 clrf TMR0 0433 01D4 03053 clrf pattern 03054 ; movlw 0x0c 03055 ; movwf pattern 0434 01C9 03056 clrf scount 0435 01B7 03057 clrf toggle 0436 01B6 03058 clrf address 0437 01B5 03059 clrf command 0438 01B8 03060 clrf IR_lhalf 0439 01B2 03061 clrf instate 043A 01B3 03062 clrf max_instate 043B 01BC 03063 clrf IR_in_good 043C 01A1 03064 clrf dcycle 043D 3004 03065 movlw 0x04 043E 00A1 03066 movwf dcycle 043F 01A2 03067 clrf count1 0440 01A3 03068 clrf count2 0441 01B9 03069 clrf button 03070 #ifdef PATTERN2 03071 clrf delay1 03072 clrf fad MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 105 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03073 clrf color 03074 #endif 03075 #ifndef C12 03076 #ifndef C19 03077 #ifndef M3X3 03078 #ifdef MONO 03079 clrf Br_reg 03080 clrf Bg_reg 03081 clrf Bb_reg 03082 clrf Dr_reg 03083 clrf Dg_reg 03084 clrf Db_reg 03085 #endif 03086 #endif 03087 #endif 03088 #endif 03089 03090 #ifdef RGB_4x4x4 03091 ;********************************************************************** 03092 ; Init for RGB 4x4x4 cube 03093 ;********************************************************************** 03094 03095 ; +------------- PLL enable (1) 03096 ; |++++--------- 8MHZ/32MHZ (1110) IRCF<3:0> 03097 ; ||||| ++------ Internal OSC (1x) 03098 ; ||||| || 03099 movlw b'11110000' ;switch to 32 MHz clock, if PLL is set on in config1, bit 7 ignored. 03100 ; movlw b'01111000' ;switch to 16 MHz clock 03101 ; movlw b'01110000' ;switch to 8 MHz clock, if PLL is set on in config1 must be OFF 03102 BANKSEL OSCCON 03103 movwf OSCCON 03104 03105 ; set up TMR0 & pullups 03106 ; +---------- disable pullups (1) 03107 ; |+--------- interrupt edge select (don't care) 03108 ; ||+-------- TMR0 source = internal clock (0) TMR0CS 03109 ; |||+------- TMR0 source edge select (don't care) TMR0SE 03110 ; ||||+------ assign prescaler to TMR0 (0) PSA 03111 ; |||||+++--- prescaler set to 8X (010) PS 03112 ; |||||||| 03113 movlw b'00000010' 03114 BANKSEL OPTION_REG 03115 movwf OPTION_REG 03116 03117 ;set port A is the 8 bit buss driving the LED matrix 03118 BANKSEL ANSELA 03119 clrf ANSELA ;set pins to digital 03120 BANKSEL LATA 03121 clrf LATA 03122 BANKSEL TRISA 03123 clrf TRISA 03124 03125 ;Port B has MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 106 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03126 ; * an board to board I2C bus B1 and B2 (need a 18F chips) 03127 ; * IR LED on B0 03128 ; * switches on B3 and B4 03129 BANKSEL LATB 03130 clrf LATB 03131 BANKSEL ANSELB 03132 clrf ANSELB 03133 BANKSEL TRISB 03134 movlw b'00011000' 03135 movwf TRISB 03136 BANKSEL WPUB 03137 clrf WPUB 03138 bsf WPUB,4 ; enable pullup B4 03139 bsf WPUB,5 ; enable pullup B5 03140 03141 BANKSEL PORTB 03142 bsf PORTB,0 ; IR LED on 03143 03144 ;Port C has 03145 BANKSEL TRISC 03146 ; +------------- C7 extra to header 03147 ; |+------------ C6 extra to header 03148 ; ||+----------- C5 SDO output (0) 03149 ; |||+---------- C4 SDI Input (1) 03150 ; ||||+--------- C3 SCK output (0) 03151 ; |||||+-------- C2 LED data strobe output (0) 03152 ; ||||||+------- C1 LEDs on/off output (0) 03153 ; |||||||+------ C0 IR detector input 03154 movlw b'00010001' 03155 movwf TRISC ; C7,C6,C5,C1,C0 output 03156 03157 03158 movwf TRISE ; E3 input 03159 03160 BANKSEL APFCON 03161 bsf APFCON,SSSEL ; master SPI mode (1) 03162 03163 BANKSEL SSPCON1 03164 ; +------------- WCOL no collision (0) 03165 ; |+------------ SSPOV no overflow (0) 03166 ; ||+----------- SSPEN SPI (1) 03167 ; |||+---------- CKP clock polarity (0) 03168 ; ||||++++------ SSPM Focs/4 (0000) 03169 movlw b'00100000' 03170 movwf SSPCON1 03171 03172 BANKSEL SSPCON3 03173 03174 ; +++----------- i2c stuff (xxx) 03175 ; |||+---------- BOEN (1) 03176 ; ||||++++------ i2c stuff (xxxx) 03177 03178 movlw b'00110000' MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 107 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03179 03180 movwf SSPCON1 03181 03182 BANKSEL SSPSTAT 03183 ; +------------- SMP Sample time (1) 03184 ; |+------------ CKE clocking (0) 03185 ; ||++++++------ read only (xxxxxx) 03186 03187 movlw b'10000000' 03188 movwf SSPSTAT 03189 03190 BANKSEL PORTC 03191 bcf PORTC,1 ; Turn LEDs on 03192 03193 movlw LOW in0 ; shift down in1f->in0 03194 movwf FSR0L 03195 movlw HIGH in0 03196 movwf FSR0H 03197 03198 movlw 0x18 03199 movwf fcount1 03200 03201 movlw 0xFF 03202 loop_set_on 03203 movwi FSR0++ 03204 03205 decfsz fcount1,f 03206 goto loop_set_on 03207 03208 bsf INTCON,TMR0IE 03209 bsf INTCON,GIE 03210 03211 movlw 0xff 03212 call display_1bit 03213 movlw 0xff 03214 call display_1bit 03215 03216 #else 03217 #ifdef M8X16 03218 ;********************************************************************** 03219 ; Init for M8X16 03220 ;********************************************************************** 03221 03222 ; +------------- PPL disable (0) 03223 ; |++++--------- OSC 8MHZ (1110) 03224 ; ||||| ++------ System Clock Internal (1x) 03225 ; ||||| || 03226 movlw b'01110010' ;switch to 8 MHz clock 03227 BANKSEL OSCCON 03228 movwf OSCCON 03229 03230 ; set up TMR0 & pullups 03231 ; +---------- disable pullups (1) MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 108 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03232 ; |+--------- interrupt edge select (don't care) 03233 ; ||+-------- TMR0 source = internal clock (0) 03234 ; |||+------- TMR0 source edge select (don't care) 03235 ; ||||+------ assign prescaler to TMR0 (0) 03236 ; |||||+++--- prescaler set to 8X (010) 03237 ; |||||||| 03238 movlw b'10000010' 03239 BANKSEL OPTION_REG 03240 movwf OPTION_REG 03241 03242 ; portA 03243 BANKSEL ANSELA 03244 clrf ANSELA ;set pins to digital 03245 BANKSEL LATA 03246 clrf LATA 03247 03248 BANKSEL TRISA 03249 clrf TRISA ; all A output 03250 03251 ; PortB 03252 BANKSEL LATB 03253 clrf LATB 03254 BANKSEL ANSELB 03255 clrf ANSELB 03256 03257 BANKSEL TRISB 03258 clrf TRISB ; all B output 03259 03260 ; PortC 03261 ; C2 - Button2 03262 ; C1 - IR out 03263 ; C3/C4 - I2C 03264 ; C0,C5,C6,C7 - strobe select output 03265 03266 BANKSEL LATC 03267 clrf LATC 03268 03269 BANKSEL TRISC 03270 movlw b'00011100' 03271 movwf TRISC ; C7,C6,C5,C1,C0 output 03272 03273 ; PortE 03274 ; E1 - IR/Button 03275 BANKSEL LATE 03276 clrf LATE 03277 03278 ; BANKSEL ANSELE ; not available on 16F1936 03279 ; clrf ANSELE 03280 03281 BANKSEL TRISE 03282 movlw b'00000001' 03283 movwf TRISE ; E3 input 03284 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 109 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03285 03286 BANKSEL button 03287 clrf button 03288 03289 movlw 0x1D 03290 movwf random 03291 03292 ; enable timer0 interupt 03293 03294 bsf INTCON,TMR0IE 03295 bsf INTCON,GIE 03296 03297 ; flash all LEDs on This kills some time, allowing us to sample the button and IR-Rx 03298 03299 movlw LOW in0 03300 movwf FSR0L 03301 movlw HIGH in0 03302 movwf FSR0H 03303 03304 BANKSEL fcount1 03305 movlw 0x20 03306 movwf fcount1 03307 03308 movlw 0xFF 03309 loop_set_on 03310 movwi FSR0++ 03311 03312 decfsz fcount1,f 03313 goto loop_set_on 03314 03315 movlw 0xff ; allways flash once 03316 call display_1bit 03317 movlw 0xff 03318 call display_1bit 03319 03320 03321 03322 ; Trun all the LEDs off 03323 03324 movlw LOW in0 ; shift down in1f->in0 03325 movwf FSR0L 03326 movlw HIGH in0 03327 movwf FSR0H 03328 03329 movlw 0x20 03330 movwf fcount1 03331 03332 movlw 0x00 03333 loop_set_off 03334 movwi FSR0++ 03335 03336 decfsz fcount1,f 03337 goto loop_set_off MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 110 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03338 03339 movlw 0xff 03340 call display_1bit 03341 movlw 0xff 03342 call display_1bit 03343 movlw 0xff 03344 call display_1bit 03345 03346 call read_demo_mode 03347 03348 movfw button 03349 movwf in1 03350 movlw 0xff 03351 call display_1bit 03352 movlw 0xff 03353 call display_1bit 03354 03355 goto pattern_driver 03356 03357 #else 03358 ;********************************************************************** 03359 ; Other Inits 03360 ;********************************************************************** 03361 0442 0021 03362 BANKSEL OSCCON 03363 #ifdef __16F1938 03364 ; +------------- PLL enable (1) 03365 ; |++++--------- 8MHZ/32MHZ (1110) 03366 ; ||||| ++------ Internal OSC (1x) 03367 ; ||||| || 03368 movlw b'01110000' ;switch to 32 MHz clock, PLL is set on in config1, bit 7 ignored. 03369 #else 03370 #ifdef __16F1936 03371 03372 ; +------------- PPL disable (0) 03373 ; |++++--------- OSC 8MHZ (1110) 03374 ; ||||| ++------ System Clock Internal (1x) 03375 ; ||||| || 03376 movlw b'01110010' ;switch to 8 MHz clock 03377 #else 0443 3072 03378 movlw b'01110010' ;switch to 8 MHz clock 03379 #endif 03380 #endif 03381 0444 0099 03382 movwf OSCCON 03383 03384 #ifdef __12F1822 0445 0023 03385 BANKSEL ANSELA 0446 018C 03386 clrf ANSELA ;set pins to digital 03387 03388 #else 03389 #ifdef __16F1824 03390 BANKSEL ANSELA MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 111 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03391 clrf ANSELA ;set pins to digital 03392 BANKSEL LATA 03393 clrf LATA 03394 03395 03396 BANKSEL ANSELC 03397 clrf ANSELC 03398 BANKSEL LATC 03399 clrf LATC 03400 #else 03401 #ifdef __16F1936 03402 BANKSEL ANSELA 03403 clrf ANSELA ;set pins to digital 03404 BANKSEL LATA 03405 clrf LATA 03406 03407 BANKSEL LATB 03408 clrf LATB 03409 BANKSEL ANSELB 03410 clrf ANSELB 03411 #else 03412 BANKSEL ANSEL 03413 clrf ANSEL ;set pins to digital 03414 #endif 03415 #endif 03416 03417 #endif 03418 03419 0447 0021 03420 BANKSEL OPTION_REG 03421 03422 ; set up TMR0 & pullups 03423 ; +---------- disable pullups (1) 03424 ; |+--------- interrupt edge select (don't care) 03425 ; ||+-------- TMR0 source = internal clock (0) 03426 ; |||+------- TMR0 source edge select (don't care) 03427 ; ||||+------ assign prescaler to TMR0 (0) 03428 ; |||||+++--- prescaler set to 8X (010) 03429 ; |||||||| 0448 3082 03430 movlw b'10000010' 0449 0095 03431 movwf OPTION_REG 03432 03433 #ifdef C19 03434 ; enable pullups on portA 03435 bcf OPTION_REG,NOT_WPUEN 03436 03437 ; input on A5 03438 BANKSEL WPUA 03439 clrf WPUA ; disable all pullups 03440 bsf WPUA,5 ; enable pullup A5 03441 BANKSEL WPUC 03442 clrf WPUC ; disable all pullups 03443 #endif MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 112 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03444 03445 #ifdef RGB2_DOGTAG 03446 ; enable pullups on portA 03447 BANKSEL OPTION_REG 03448 bcf OPTION_REG,NOT_WPUEN 03449 03450 ; input on A3 03451 BANKSEL WPUA 03452 clrf WPUA ; disable all pullups 03453 bsf WPUA,3 ; enable pullup A3 03454 #endif 03455 03456 #ifdef BI6_DOGTAG 03457 ; enable pullups on portA 03458 BANKSEL OPTION_REG 03459 bcf OPTION_REG,NOT_WPUEN 03460 03461 ; input on A3 03462 BANKSEL WPUA 03463 clrf WPUA ; disable all pullups 03464 bsf WPUA,3 ; enable pullup A3 03465 #endif 03466 03467 #ifdef SRGB 03468 ; enable pullups on portA 03469 bcf OPTION_REG,NOT_RAPU 03470 03471 ; input on A5 03472 clrf WPUA ; disable all pullups 03473 bsf WPUA,5 ; enable pullup A5 03474 bsf WPUA,4 ; enable pullup A4 03475 #endif 03476 03477 #ifdef C12 03478 ; BANKSEL OPTION_REG 03479 ; bsf OPTION_REG, NOT_RBPU 03480 ; 03481 ; input C7,C5 buttons 03482 ; input C6 IR. 03483 BANKSEL TRISC 03484 movlw b'11100000' 03485 movwf TRISC ; C7,C6,C5 input 03486 #endif 03487 03488 #ifdef GATOR 03489 ; 03490 ; input A3 IR. 03491 BANKSEL TRISA 03492 movlw b'00001000' 03493 movwf TRISA ; A3 Input 03494 #endif 03495 03496 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 113 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03497 #ifdef D10 03498 ; A0,A1,A2,A4 - LEDs 03499 ; A3,A5 Push Button 03500 BANKSEL TRISA 03501 movlw b'00101000' 03502 movwf TRISA 03503 03504 ; enable pullups on portA 03505 BANKSEL OPTION_REG 03506 bcf OPTION_REG,NOT_RAPU 03507 03508 ; input on A5 03509 BANKSEL WPUA 03510 clrf WPUA ; disable all pullups 03511 bsf WPUA,5 ; enable pullup A5 03512 bsf WPUA,3 ; enable pullup A3 03513 03514 BANKSEL CMCON0 03515 movlw 0x07 03516 movwf CMCON0 03517 03518 BANKSEL ANSEL 03519 clrf ANSEL ;set pins to digital 03520 #endif 03521 03522 044A 0020 03523 BANKSEL button 044B 01B9 03524 clrf button 03525 03526 #ifdef RANDOM 03527 movlw 0x1D 03528 movwf random 03529 #endif 03530 03531 ; enable timer0 interupt 03532 #ifdef __16F1938 03533 bsf INTCON,TMR0IE 03534 #else 03535 #ifdef __16F1936 03536 bsf INTCON,TMR0IE 03537 #else 044C 168B 03538 bsf INTCON,T0IE 03539 #endif 03540 #endif 044D 178B 03541 bsf INTCON,GIE 03542 03543 ; flash all LEDs on This kills some time, allowing us to sample the button and IR-Rx 03544 044E 30FF 03545 movlw b'11111111' 03546 ; movlw b'01000000' 03547 044F 00D6 03548 movwf in0 0450 00D7 03549 movwf in1 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 114 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0451 00D8 03550 movwf in2 03551 #ifdef C19 03552 movwf in3 03553 movwf in4 03554 #endif 03555 #ifdef SRGB 03556 movwf in3 03557 movwf in4 03558 movwf in5 03559 #endif 03560 03561 03562 #ifdef C12a ; going to flash the config1 value! 03563 movfw config1 03564 movwf fcount1 ; flash 1 - mono single, 2 - mono dual 3 - bi single or 4 - bi dual 03565 incf fcount1,f 03566 03567 flash_loop 03568 movlw b'10101010' 03569 movwf in0 03570 movwf in1 03571 movwf in2 03572 movwf in3 03573 movwf in4 03574 03575 movlw 0xff 03576 call display_1bit 03577 movlw 0xff 03578 call display_1bit 03579 03580 movlw b'01010101' 03581 movwf in0 03582 movwf in1 03583 movwf in2 03584 movwf in3 03585 movwf in4 03586 03587 movlw 0xff 03588 call display_1bit 03589 movlw 0xff 03590 call display_1bit 03591 03592 decfsz fcount1,f 03593 goto flash_loop 03594 03595 movlw b'11111111' 03596 movwf in0 03597 movwf in1 03598 movwf in2 03599 movwf in3 03600 movwf in4 03601 03602 #endif MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 115 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03603 03604 0452 30FF 03605 movlw 0xff ; allways flash once 0453 235D 03606 call display_1bit 0454 30FF 03607 movlw 0xff 0455 235D 03608 call display_1bit 03609 03610 #ifdef M3X3 ; have to wait for the IR to go high, and the buttons to de-bounce on 3x3 po werup 03611 movlw 0xff 03612 call display_1bit 03613 movlw 0xff 03614 call display_1bit 03615 #endif 03616 03617 03618 ; Trun all the LEDs off 03619 0456 01D6 03620 clrf in0 0457 01D7 03621 clrf in1 0458 01D8 03622 clrf in2 03623 #ifdef C19 03624 clrf in3 03625 clrf in4 03626 #endif 03627 #ifdef SRGB 03628 clrf in3 03629 clrf in4 03630 clrf in5 03631 #endif 03632 0459 30FF 03633 movlw 0xff 045A 235D 03634 call display_1bit 045B 30FF 03635 movlw 0xff 045C 235D 03636 call display_1bit 045D 30FF 03637 movlw 0xff 045E 235D 03638 call display_1bit 03639 045F 22DC 03640 call read_demo_mode 03641 0460 0839 03642 movfw button 0461 00D7 03643 movwf in1 0462 30FF 03644 movlw 0xff 0463 235D 03645 call display_1bit 0464 30FF 03646 movlw 0xff 0465 235D 03647 call display_1bit 03648 03649 #endif ; M8X16 03650 #endif ; 4x4x4 RGB 03651 03652 #ifndef M3X3 03653 ; if button pressed durring powerup run IR_Tester 03654 ; else run pattern driver MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 116 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03655 ; 0466 1C39 03656 btfss button,0 0467 2AEE 03657 goto pattern_driver 0468 22E0 03658 call toggle_demo 03659 #ifdef ENABLE_IR 0469 2BE1 03660 goto IR_Tester 03661 #else 03662 goto pattern_driver 03663 #endif 03664 #else 03665 #inclue m3x3_menu.asm 03666 #endif 03667 03668 #ifdef DEAD 03669 ;********************************************************************** 03670 table_lookup_old ; obs code now using IND1 to lookup table entries. 03671 ;********************************************************************** 03672 movf tbl_hi,w 03673 movwf PCLATH 03674 movf pindex,w 03675 addwf tbl_low,w 03676 btfsc STATUS,0 ; check carry flag 03677 incf PCLATH,f 03678 movwf PCL 03679 03680 ;********************************************************************** 03681 jump_address_old ; obs code now using IND1 to lookup table entries. 03682 ;********************************************************************** 03683 ; Portability : clean 03684 ; 03685 var offset_hi 03686 var offset_low 03687 03688 movf PCLATH,w 03689 movwf pclath_save 03690 movf offset_hi,w 03691 movwf PCLATH 03692 03693 movf offset_low, w 03694 movwf PCL 03695 #endif 03696 03697 ;********************************************************************** 046A 03698 MasterTable 03699 ;********************************************************************** 03700 make_mtab NUM_TAB 0000 M local i = 0 M while i <= NUM_TAB 046A 3484 3488 M dt HIGH table0, LOW table0 00000001 M i += 1 046C 3484 34AB M dt HIGH table1, LOW table1 00000002 M i += 1 046E 3484 34B4 M dt HIGH table2, LOW table2 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 117 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00000003 M i += 1 0470 3484 34ED M dt HIGH table3, LOW table3 00000004 M i += 1 0472 3485 345C M dt HIGH table4, LOW table4 00000005 M i += 1 0474 3485 3495 M dt HIGH table5, LOW table5 00000006 M i += 1 0476 3485 349C M dt HIGH table6, LOW table6 00000007 M i += 1 0478 3485 34AB M dt HIGH table7, LOW table7 00000008 M i += 1 047A 3485 34BA M dt HIGH table8, LOW table8 00000009 M i += 1 047C 3485 34C9 M dt HIGH table9, LOW table9 0000000A M i += 1 047E 3485 34E2 M dt HIGH table10, LOW table10 0000000B M i += 1 0480 3485 34F5 M dt HIGH table11, LOW table11 0000000C M i += 1 0482 34F0 3400 M dt HIGH table12, LOW table12 0000000D M i += 1 0484 34F0 3439 M dt HIGH table13, LOW table13 0000000E M i += 1 0486 34F0 344E M dt HIGH table14, LOW table14 0000000F M i += 1 M endw 03701 03702 03703 #ifdef PATTERN16 03704 #define BRIGHT1_lo 0x04 03705 #define BRIGHT2_lo 0x0A 03706 #define BRIGHT1_hi 0x40 03707 #define BRIGHT2_hi 0xA0 03708 03709 ;********************************************************************** 03710 table_type_16 03711 ;********************************************************************** 03712 ; 03713 ; 1 bytes 03714 ; 03715 ; ABBCCCCC 03716 ; 03717 ; A = shire Right/Left 03718 ; BB = two bit intensity to shift on 03719 ; CCCCC = Number of shifts to loop 03720 ; 03721 ; if CCCCC = 0x11111, specical case: turn all LEDs off. 03722 03723 var t7count 03724 var t17_loop 03725 03726 pageselw get_next_pattern_entry 03727 call get_next_pattern_entry MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 118 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03728 movwf in0 03729 03730 call get_next_pattern_entry 03731 movwf in1 03732 pageselw table_type_16 03733 03734 movlw b'00011111' 03735 andwf in0,w 03736 movwf t7count 03737 03738 movlw b'00011111' ; if shiftcount is 31, then clear all LEDs 03739 subwf t7count,w 03740 btfss STATUS,Z 03741 goto t7_loop_red 03742 03743 clrf in0 ; quick way to clear all the LEDS. 03744 clrf in1 03745 clrf in2 03746 clrf in3 03747 clrf in4 03748 clrf in5 03749 pageselw display_1bit 03750 call display_1bit 03751 pageselw table_type_16 03752 goto t7_return 03753 03754 t7_loop_red 03755 btfsc in0,7 03756 goto t7_set19_red 03757 03758 call red_up 03759 goto t7_loop_green 03760 03761 t7_set19_red 03762 03763 call red_down 03764 03765 t7_loop_green 03766 btfsc in0,6 03767 goto t7_set19_green 03768 03769 call green_up 03770 03771 goto t7_loop_blue 03772 ; 03773 ; set LED 19 03774 t7_set19_green 03775 03776 call green_down 03777 03778 t7_loop_blue 03779 03780 btfsc in0,5 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 119 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03781 goto t7_set19_blue 03782 03783 call blue_up 03784 03785 goto t7_cont 03786 ; 03787 ; set LED 19 03788 t7_set19_blue 03789 call blue_dowm 03790 t7_cont 03791 pageselw strobe_delay 03792 movf pspeed,w 03793 call strobe_delay 03794 pageselw t7_cont 03795 ; 03796 ; This is a quick hack, because without this button presses are not seen for minutes 03797 ; This early exit might impact the pattern getting displayed. 03798 ; 03799 btfsc button,0 ; if putton pressed show pattern id 03800 goto t7_return 03801 03802 btfsc IR_in_good,0 03803 goto t7_return 03804 03805 decfsz t7count,f 03806 goto t7_loop_red 03807 03808 t7_return 03809 return 03810 03811 ;********************************************************************** 03812 red_up 03813 ;********************************************************************** 03814 03815 movlw 0x0d 03816 movwf t17_loop 03817 03818 movlw A2_C1_reg ; index = 13 R 03819 movwf FSR 03820 03821 red_up_loop 03822 movfw INDF ; load R [index] 03823 incf FSR,f ; index ++ 03824 movwf INDF ; store R [index] 03825 03826 decf FSR,f ; index - 2 03827 decf FSR,f 03828 03829 decfsz t17_loop,f 03830 goto red_up_loop 03831 ; 03832 ; 01 Red 03833 ; MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 120 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03834 incf FSR,f 03835 clrf INDF 03836 movlw BRIGHT1 03837 btfsc in1,6 03838 addwf INDF,f ;01 03839 movlw BRIGHT2 03840 btfsc in1,7 03841 addwf INDF,f ;01 03842 03843 return 03844 03845 ;********************************************************************** 03846 red_down 03847 ;********************************************************************** 03848 03849 movlw 0x0d 03850 movwf t17_loop 03851 03852 movlw C2_C3_reg ; index = 02 R 03853 movwf FSR 03854 03855 red_down_loop 03856 movfw INDF ; load R [index] 03857 decf FSR,f ; index - 1 03858 movwf INDF ; store R [index] 03859 03860 incf FSR,f ; index + 2 03861 incf FSR,f 03862 03863 decfsz t17_loop,f 03864 goto red_down_loop 03865 ; 03866 ; 14 Red 03867 ; 03868 decf FSR,f 03869 clrf INDF 03870 movlw BRIGHT1 03871 btfsc in1,6 03872 addwf INDF,f ;01 03873 movlw BRIGHT2 03874 btfsc in1,7 03875 addwf INDF,f ;01 03876 03877 return 03878 03879 ;********************************************************************** 03880 green_up 03881 ;********************************************************************** 03882 03883 movlw 0x0d 03884 movwf t17_loop 03885 03886 movlw C4_C1_reg ; index = 13 G MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 121 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03887 movwf FSR 03888 03889 green_up_loop 03890 movfw INDF ; load G [index] 03891 incf FSR,f ; index ++ 03892 movwf INDF ; store G [index] 03893 03894 decf FSR,f ; index - 2 03895 decf FSR,f 03896 03897 decfsz t17_loop,f 03898 goto green_up_loop 03899 ; 03900 ; 01 Green 03901 ; 03902 incf FSR,f 03903 clrf INDF 03904 movlw BRIGHT1 03905 btfsc in1,4 03906 addwf INDF,f ;01 03907 movlw BRIGHT2 03908 btfsc in1,5 03909 addwf INDF,f ;01 03910 03911 return 03912 03913 ;********************************************************************** 03914 green_down 03915 ;********************************************************************** 03916 03917 movlw 0x0d 03918 movwf t17_loop 03919 03920 movlw C0_C3_reg ; index = 02 Green 03921 movwf FSR 03922 03923 green_down_loop 03924 movfw INDF ; load R [index] 03925 decf FSR,f ; index - 1 03926 movwf INDF ; store R [index] 03927 03928 incf FSR,f ; index + 2 03929 incf FSR,f 03930 03931 decfsz t17_loop,f 03932 goto green_down_loop 03933 ; 03934 ; 14 Green 03935 ; 03936 decf FSR,f 03937 clrf INDF 03938 movlw BRIGHT1 03939 btfsc in1,4 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 122 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03940 addwf INDF,f ;01 03941 movlw BRIGHT2 03942 btfsc in1,5 03943 addwf INDF,f ;01 03944 03945 return 03946 03947 03948 ;********************************************************************** 03949 blue_up 03950 ;********************************************************************** 03951 03952 movlw 0x0d 03953 movwf t17_loop 03954 03955 movlw C2_C1_reg ; index = 13 G 03956 movwf FSR 03957 03958 blue_up_loop 03959 movfw INDF ; load G [index] 03960 incf FSR,f ; index ++ 03961 movwf INDF ; store G [index] 03962 03963 decf FSR,f ; index - 2 03964 decf FSR,f 03965 03966 decfsz t17_loop,f 03967 goto blue_up_loop 03968 ; 03969 ; 01 blue 03970 ; 03971 incf FSR,f 03972 clrf INDF 03973 movlw BRIGHT1 03974 btfsc in1,2 03975 addwf INDF,f ;01 03976 movlw BRIGHT2 03977 btfsc in1,3 03978 addwf INDF,f ;01 03979 03980 return 03981 03982 03983 ;********************************************************************** 03984 blue_dowm 03985 ;********************************************************************** 03986 03987 movlw 0x0d 03988 movwf t17_loop 03989 03990 movlw C4_C3_reg ; index = 02 Blue 03991 movwf FSR 03992 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 123 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03993 blue_down_loop 03994 movfw INDF ; load R [index] 03995 decf FSR,f ; index - 1 03996 movwf INDF ; store R [index] 03997 03998 incf FSR,f ; index + 2 03999 incf FSR,f 04000 04001 decfsz t17_loop,f 04002 goto blue_down_loop 04003 ; 04004 ; 14 Green 04005 ; 04006 decf FSR,f 04007 clrf INDF 04008 movlw BRIGHT1 04009 btfsc in1,2 04010 addwf INDF,f ;01 04011 movlw BRIGHT2 04012 btfsc in1,3 04013 addwf INDF,f ;01 04014 04015 return 04016 #endif 04017 04018 ; 04019 ; These are down here for memory placement 04020 ; 04021 04022 #ifdef DISPLAY_1BIT_E 04023 #include display_1bit_e_part2 ; RGB Stick Anode / cathode 04024 #endif 04025 04026 #ifdef PATTERN17 04027 #include pattern_17_part2.asm 04028 #endif 04029 04030 #ifdef PATTERN18 04031 #include pattern_18.asm 04032 #endif 04033 04034 #ifdef PATTERN20 04035 #include pattern_20.asm 04036 #endif 04037 04038 #ifdef PATTERN21 04039 #include pattern_21.asm 04040 #endif 04041 04042 #ifdef C12 04043 ORG 0x800 04044 #endif 04045 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 124 LOC OBJECT CODE LINE SOURCE TEXT VALUE 04046 #ifdef PATTERN27 04047 #include "pattern_27.asm" 04048 #endif 04049 04050 ; 04051 ; These are the pattern tables 04052 ; 04053 04054 04055 #ifdef RGB4 04056 #include 04057 #endif 04058 04059 #ifdef SRGB 04060 #include 04061 #endif 04062 04063 #ifdef BI6 04064 #ifdef MONO 04065 #ifdef BADGE 04066 #include 04067 #else 04068 #include 04069 #endif 04070 #else 04071 #ifdef BADGE 04072 #include 04073 #else 04074 #include 00001 ;********************************************************************** 00002 ; Copyright (C) 2005,2006,2007 Dwayne Forsyth 00003 ; 00004 ; This program is free software; you can redistribute it and/or 00005 ; modify it under the terms of the GNU General Public License 00006 ; as published by the Free Software Foundation; either version 2 00007 ; of the License, or (at your option) any later version. 00008 ; 00009 ; This program is distributed in the hope that it will be useful, 00010 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 ; GNU General Public License for more details. 00013 ; 00014 ; You should have received a copy of the GNU General Public License 00015 ; along with this program; if not, write to the 00016 ; 00017 ; Free Software Foundation, Inc. 00018 ; 51 Franklin Street, Fifth Floor 00019 ; Boston, MA 02110-1301, USA. 00020 ; 00021 ;********************************************************************** 00022 00023 start_pattern 3,0x60 M MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 125 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0488 M table0 M if (3 == 1) || (3 == 6) || (3 == 0x15) || (3 == 0x1c)|| (3 == 0x1d)||(3 == 0 x01e) M leng = (endpat0-$-3)/3 ;tbltype1,speed,length M else M if (3 == 3) || (3 == 0x0b) || (3 == 0x10) || (3 == 0x13) || (3 == 0x14)|| (3 == 0x18) 00000010 M leng = (endpat0-$-3)/2 ;tbltype1,speed,length M else M if (3 == 9) || (3 == 0x0e) M leng =(endpat0-$-3)/5 ;tbltype1,speed,length M else M if (3 == 0x0a) M leng =(endpat0-$-3)/4 ;tbltype1,speed,length M else M if (3 == 0x0d) M leng =(endpat0-$-3)/(9+1) ;tbltype1,speed,length M else M if (3 == 0x0f) || (3 == 0x12)|| (3 == 0x17)||(3 == 0x1b) M leng =(endpat0-$-3)/(6) ;tbltype1,speed,length M else M if (3 == 0x11) M leng = (endpat0-$-3)/(9+4) ;tbltype1,speed,length M else M if (3 == 0x16) || (3 == 0x1a) M leng = (endpat0-$-3)/0x20 ;tbltype1,speed,length M else M if (3 == 0x1f) M leng = (endpat0-$-3)/0x18 ;tbltype1,speed,length M else M if (3 == 0x20) M leng = (endpat0-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat0-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif M expand M if ($ < 0x2100) 0488 3403 3460 3410 M dt 3,0x60,(leng) M else M de 3,0x60,(leng) M endif 00024 048B 34AA 34A0 00025 dt b'10101010',b'10100000' 048D 3455 3450 00026 dt b'01010101',b'01010000' MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 126 LOC OBJECT CODE LINE SOURCE TEXT VALUE 048F 34FF 34F0 00027 dt b'11111111',b'11110000' 0491 3400 3400 00028 dt b'00000000',b'00000000' 00029 0493 3480 3400 00030 dt b'10000000',b'00000000' 0495 3440 3400 00031 dt b'01000000',b'00000000' 0497 3420 3400 00032 dt b'00100000',b'00000000' 0499 3410 3400 00033 dt b'00010000',b'00000000' 049B 3408 3400 00034 dt b'00001000',b'00000000' 049D 3404 3400 00035 dt b'00000100',b'00000000' 049F 3402 3400 00036 dt b'00000010',b'00000000' 04A1 3401 3400 00037 dt b'00000001',b'00000000' 04A3 3400 3480 00038 dt b'00000000',b'10000000' 04A5 3400 3440 00039 dt b'00000000',b'01000000' 04A7 3400 3420 00040 dt b'00000000',b'00100000' 04A9 3400 3410 00041 dt b'00000000',b'00010000' 00042 end_pattern 04AB M endpat0 00000001 M patternc = patternc + 1 00043 00044 00045 ;********************************************************************** 00046 ; DF1 - retro 00047 ;********************************************************************** 00048 00049 start_pattern 3, 0x30 M 04AB M table1 M if (3 == 1) || (3 == 6) || (3 == 0x15) || (3 == 0x1c)|| (3 == 0x1d)||(3 == 0 x01e) M leng = (endpat1-$-3)/3 ;tbltype1,speed,length M else M if (3 == 3) || (3 == 0x0b) || (3 == 0x10) || (3 == 0x13) || (3 == 0x14)|| (3 == 0x18) 00000003 M leng = (endpat1-$-3)/2 ;tbltype1,speed,length M else M if (3 == 9) || (3 == 0x0e) M leng =(endpat1-$-3)/5 ;tbltype1,speed,length M else M if (3 == 0x0a) M leng =(endpat1-$-3)/4 ;tbltype1,speed,length M else M if (3 == 0x0d) M leng =(endpat1-$-3)/(9+1) ;tbltype1,speed,length M else M if (3 == 0x0f) || (3 == 0x12)|| (3 == 0x17)||(3 == 0x1b) M leng =(endpat1-$-3)/(6) ;tbltype1,speed,length M else M if (3 == 0x11) M leng = (endpat1-$-3)/(9+4) ;tbltype1,speed,length M else M if (3 == 0x16) || (3 == 0x1a) M leng = (endpat1-$-3)/0x20 ;tbltype1,speed,length M else MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 127 LOC OBJECT CODE LINE SOURCE TEXT VALUE M if (3 == 0x1f) M leng = (endpat1-$-3)/0x18 ;tbltype1,speed,length M else M if (3 == 0x20) M leng = (endpat1-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat1-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif M expand M if ($ < 0x2100) 04AB 3403 3430 3403 M dt 3,0x30,(leng) M else M de 3,0x30,(leng) M endif 04AE 3441 3400 00050 dt 0x41, 0x00 ; 1 04B0 3410 3440 00051 dt 0x10, 0x40 ; 2 04B2 3404 3410 00052 dt 0x04, 0x10 ; 3 00053 end_pattern 04B4 M endpat1 00000002 M patternc = patternc + 1 00054 00055 ;********************************************************************** 00056 ; fade in/out: white, red, green, blue, yellow, cyan, violet 00057 ;********************************************************************** 00058 start_pattern 1, 0x30 M 04B4 M table2 M if (1 == 1) || (1 == 6) || (1 == 0x15) || (1 == 0x1c)|| (1 == 0x1d)||(1 == 0 x01e) 00000012 M leng = (endpat2-$-3)/3 ;tbltype1,speed,length M else M if (1 == 3) || (1 == 0x0b) || (1 == 0x10) || (1 == 0x13) || (1 == 0x14)|| (1 == 0x18) M leng = (endpat2-$-3)/2 ;tbltype1,speed,length M else M if (1 == 9) || (1 == 0x0e) M leng =(endpat2-$-3)/5 ;tbltype1,speed,length M else M if (1 == 0x0a) M leng =(endpat2-$-3)/4 ;tbltype1,speed,length M else M if (1 == 0x0d) M leng =(endpat2-$-3)/(9+1) ;tbltype1,speed,length M else MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 128 LOC OBJECT CODE LINE SOURCE TEXT VALUE M if (1 == 0x0f) || (1 == 0x12)|| (1 == 0x17)||(1 == 0x1b) M leng =(endpat2-$-3)/(6) ;tbltype1,speed,length M else M if (1 == 0x11) M leng = (endpat2-$-3)/(9+4) ;tbltype1,speed,length M else M if (1 == 0x16) || (1 == 0x1a) M leng = (endpat2-$-3)/0x20 ;tbltype1,speed,length M else M if (1 == 0x1f) M leng = (endpat2-$-3)/0x18 ;tbltype1,speed,length M else M if (1 == 0x20) M leng = (endpat2-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat2-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif M expand M if ($ < 0x2100) 04B4 3401 3430 3412 M dt 1,0x30,(leng) M else M de 1,0x30,(leng) M endif 00059 ; R c B 04B7 34FF 341B 3400 00060 dt b'11111111',b'00011011',b'00000000' ; red -> yellow 04BA 34FE 346F 3400 00061 dt b'11111110',b'01101111',b'00000000' 04BD 34F9 34BF 3400 00062 dt b'11111001',b'10111111',b'00000000' 04C0 34E4 34FF 3400 00063 dt b'11100100',b'11111111',b'00000000' ; yellow -> green 04C3 3490 34FF 3401 00064 dt b'10010000',b'11111111',b'00000001' 04C6 3440 34FF 3406 00065 dt b'01000000',b'11111111',b'00000110' 04C9 3400 34FF 341B 00066 dt b'00000000',b'11111111',b'00011011' ; green -> cyan 04CC 3400 34FE 346F 00067 dt b'00000000',b'11111110',b'01101111' 04CF 3400 34F9 34BF 00068 dt b'00000000',b'11111001',b'10111111' 04D2 3400 34E4 34FF 00069 dt b'00000000',b'11100100',b'11111111' ; cyan -> blue 04D5 3401 3490 34FF 00070 dt b'00000001',b'10010000',b'11111111' 04D8 3406 3440 34FF 00071 dt b'00000110',b'01000000',b'11111111' 04DB 341B 3400 34FF 00072 dt b'00011011',b'00000000',b'11111111' ; blue -> violet 04DE 346F 3400 34FE 00073 dt b'01101111',b'00000000',b'11111110' 04E1 34BF 3400 34F9 00074 dt b'10111111',b'00000000',b'11111001' 04E4 34FF 3400 34E4 00075 dt b'11111111',b'00000000',b'11100100' ; violet -> red 04E7 34FF 3401 3490 00076 dt b'11111111',b'00000001',b'10010000' 04EA 34FF 3406 3440 00077 dt b'11111111',b'00000110',b'01000000' 00078 end_pattern 04ED M endpat2 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 129 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00000003 M patternc = patternc + 1 00079 00080 ;********************************************************************** 00081 ; red chase fad up, green chase fad up 00082 ;********************************************************************** 00083 start_pattern 1, 0x30 M 04ED M table3 M if (1 == 1) || (1 == 6) || (1 == 0x15) || (1 == 0x1c)|| (1 == 0x1d)||(1 == 0 x01e) 00000024 M leng = (endpat3-$-3)/3 ;tbltype1,speed,length M else M if (1 == 3) || (1 == 0x0b) || (1 == 0x10) || (1 == 0x13) || (1 == 0x14)|| (1 == 0x18) M leng = (endpat3-$-3)/2 ;tbltype1,speed,length M else M if (1 == 9) || (1 == 0x0e) M leng =(endpat3-$-3)/5 ;tbltype1,speed,length M else M if (1 == 0x0a) M leng =(endpat3-$-3)/4 ;tbltype1,speed,length M else M if (1 == 0x0d) M leng =(endpat3-$-3)/(9+1) ;tbltype1,speed,length M else M if (1 == 0x0f) || (1 == 0x12)|| (1 == 0x17)||(1 == 0x1b) M leng =(endpat3-$-3)/(6) ;tbltype1,speed,length M else M if (1 == 0x11) M leng = (endpat3-$-3)/(9+4) ;tbltype1,speed,length M else M if (1 == 0x16) || (1 == 0x1a) M leng = (endpat3-$-3)/0x20 ;tbltype1,speed,length M else M if (1 == 0x1f) M leng = (endpat3-$-3)/0x18 ;tbltype1,speed,length M else M if (1 == 0x20) M leng = (endpat3-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat3-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif M expand M if ($ < 0x2100) MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 130 LOC OBJECT CODE LINE SOURCE TEXT VALUE 04ED 3401 3430 3424 M dt 1,0x30,(leng) M else M de 1,0x30,(leng) M endif 00084 ; R c B 04F0 3440 3400 3400 00085 dt b'01000000',b'00000000',b'00000000' ; low Red 04F3 3444 3400 3400 00086 dt b'01000100',b'00000000',b'00000000' ; 04F6 3444 3440 3400 00087 dt b'01000100',b'01000000',b'00000000' ; 04F9 3444 3444 3400 00088 dt b'01000100',b'01000100',b'00000000' ; 04FC 3444 3444 3440 00089 dt b'01000100',b'01000100',b'01000000' ; 04FF 3444 3444 3444 00090 dt b'01000100',b'01000100',b'01000100' ; 0502 3484 3444 3444 00091 dt b'10000100',b'01000100',b'01000100' ; Med Red 0505 3488 3444 3444 00092 dt b'10001000',b'01000100',b'01000100' ; 0508 3488 3484 3444 00093 dt b'10001000',b'10000100',b'01000100' ; 050B 3488 3488 3444 00094 dt b'10001000',b'10001000',b'01000100' ; 050E 3488 3488 3484 00095 dt b'10001000',b'10001000',b'10000100' ; 0511 3488 3488 3488 00096 dt b'10001000',b'10001000',b'10001000' ; 0514 34C8 3488 3488 00097 dt b'11001000',b'10001000',b'10001000' ; Hi Red 0517 34CC 3488 3488 00098 dt b'11001100',b'10001000',b'10001000' ; 051A 34CC 34C8 3488 00099 dt b'11001100',b'11001000',b'10001000' ; 051D 34CC 34CC 3488 00100 dt b'11001100',b'11001100',b'10001000' ; 0520 34CC 34CC 34C8 00101 dt b'11001100',b'11001100',b'11001000' ; 0523 34CC 34CC 34CC 00102 dt b'11001100',b'11001100',b'11001100' ; 0526 34DC 34CC 34CC 00103 dt b'11011100',b'11001100',b'11001100' ; Low Green 0529 34DD 34CC 34CC 00104 dt b'11011101',b'11001100',b'11001100' ; 052C 34DD 34DC 34CC 00105 dt b'11011101',b'11011100',b'11001100' ; 052F 34DD 34DD 34CC 00106 dt b'11011101',b'11011101',b'11001100' ; 0532 34DD 34DD 34DC 00107 dt b'11011101',b'11011101',b'11011100' ; 0535 34DD 34DD 34DD 00108 dt b'11011101',b'11011101',b'11011101' ; 0538 34ED 34DD 34DD 00109 dt b'11101101',b'11011101',b'11011101' ; Med Green 053B 34EE 34DD 34DD 00110 dt b'11101110',b'11011101',b'11011101' ; 053E 34EE 34ED 34DD 00111 dt b'11101110',b'11101101',b'11011101' ; 0541 34EE 34EE 34DD 00112 dt b'11101110',b'11101110',b'11011101' ; 0544 34EE 34EE 34ED 00113 dt b'11101110',b'11101110',b'11101101' ; 0547 34EE 34EE 34EE 00114 dt b'11101110',b'11101110',b'11101110' ; 054A 34FE 34EE 34EE 00115 dt b'11111110',b'11101110',b'11101110' ; High Green 054D 34FF 34EE 34EE 00116 dt b'11111111',b'11101110',b'11101110' ; 0550 34FF 34FE 34EE 00117 dt b'11111111',b'11111110',b'11101110' ; 0553 34FF 34FF 34FE 00118 dt b'11111111',b'11111111',b'11111110' ; 0556 34FF 34FF 34FE 00119 dt b'11111111',b'11111111',b'11111110' ; 0559 34FF 34FF 34FF 00120 dt b'11111111',b'11111111',b'11111111' ; 00121 00122 end_pattern 055C M endpat3 00000004 M patternc = patternc + 1 00123 00124 ;********************************************************************** 00125 ; fad up/down 00126 ;********************************************************************** 00127 start_pattern 1, 0x30 M 055C M table4 M if (1 == 1) || (1 == 6) || (1 == 0x15) || (1 == 0x1c)|| (1 == 0x1d)||(1 == 0 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 131 LOC OBJECT CODE LINE SOURCE TEXT VALUE x01e) 00000012 M leng = (endpat4-$-3)/3 ;tbltype1,speed,length M else M if (1 == 3) || (1 == 0x0b) || (1 == 0x10) || (1 == 0x13) || (1 == 0x14)|| (1 == 0x18) M leng = (endpat4-$-3)/2 ;tbltype1,speed,length M else M if (1 == 9) || (1 == 0x0e) M leng =(endpat4-$-3)/5 ;tbltype1,speed,length M else M if (1 == 0x0a) M leng =(endpat4-$-3)/4 ;tbltype1,speed,length M else M if (1 == 0x0d) M leng =(endpat4-$-3)/(9+1) ;tbltype1,speed,length M else M if (1 == 0x0f) || (1 == 0x12)|| (1 == 0x17)||(1 == 0x1b) M leng =(endpat4-$-3)/(6) ;tbltype1,speed,length M else M if (1 == 0x11) M leng = (endpat4-$-3)/(9+4) ;tbltype1,speed,length M else M if (1 == 0x16) || (1 == 0x1a) M leng = (endpat4-$-3)/0x20 ;tbltype1,speed,length M else M if (1 == 0x1f) M leng = (endpat4-$-3)/0x18 ;tbltype1,speed,length M else M if (1 == 0x20) M leng = (endpat4-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat4-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif M expand M if ($ < 0x2100) 055C 3401 3430 3412 M dt 1,0x30,(leng) M else M de 1,0x30,(leng) M endif 00128 ; R c B 055F 3444 3444 3444 00129 dt b'01000100',b'01000100',b'01000100' ; 0562 3488 3488 3488 00130 dt b'10001000',b'10001000',b'10001000' ; 0565 34CC 34CC 34CC 00131 dt b'11001100',b'11001100',b'11001100' ; 0568 3488 3488 3488 00132 dt b'10001000',b'10001000',b'10001000' ; MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 132 LOC OBJECT CODE LINE SOURCE TEXT VALUE 056B 3444 3444 3444 00133 dt b'01000100',b'01000100',b'01000100' ; 056E 3400 3400 3400 00134 dt b'00000000',b'00000000',b'00000000' ; 0571 3411 3411 3411 00135 dt b'00010001',b'00010001',b'00010001' ; 0574 3422 3422 3422 00136 dt b'00100010',b'00100010',b'00100010' ; 0577 3433 3433 3433 00137 dt b'00110011',b'00110011',b'00110011' ; 057A 3422 3422 3422 00138 dt b'00100010',b'00100010',b'00100010' ; 057D 3411 3411 3411 00139 dt b'00010001',b'00010001',b'00010001' ; 0580 3400 3400 3400 00140 dt b'00000000',b'00000000',b'00000000' ; 0583 3455 3455 3455 00141 dt b'01010101',b'01010101',b'01010101' ; 0586 34AA 34AA 34AA 00142 dt b'10101010',b'10101010',b'10101010' ; 0589 34FF 34FF 34FF 00143 dt b'11111111',b'11111111',b'11111111' ; 058C 34AA 34AA 34AA 00144 dt b'10101010',b'10101010',b'10101010' ; 058F 3455 3455 3455 00145 dt b'01010101',b'01010101',b'01010101' ; 0592 3400 3400 3400 00146 dt b'00000000',b'00000000',b'00000000' ; 00147 end_pattern 0595 M endpat4 00000005 M patternc = patternc + 1 00148 00149 00150 00151 00152 ;********************************************************************** 00153 ;table2 ; DF2 - xmas 00154 ;********************************************************************** 00155 00156 start_pattern 3, 0x30 M 0595 M table5 M if (3 == 1) || (3 == 6) || (3 == 0x15) || (3 == 0x1c)|| (3 == 0x1d)||(3 == 0 x01e) M leng = (endpat5-$-3)/3 ;tbltype1,speed,length M else M if (3 == 3) || (3 == 0x0b) || (3 == 0x10) || (3 == 0x13) || (3 == 0x14)|| (3 == 0x18) 00000002 M leng = (endpat5-$-3)/2 ;tbltype1,speed,length M else M if (3 == 9) || (3 == 0x0e) M leng =(endpat5-$-3)/5 ;tbltype1,speed,length M else M if (3 == 0x0a) M leng =(endpat5-$-3)/4 ;tbltype1,speed,length M else M if (3 == 0x0d) M leng =(endpat5-$-3)/(9+1) ;tbltype1,speed,length M else M if (3 == 0x0f) || (3 == 0x12)|| (3 == 0x17)||(3 == 0x1b) M leng =(endpat5-$-3)/(6) ;tbltype1,speed,length M else M if (3 == 0x11) M leng = (endpat5-$-3)/(9+4) ;tbltype1,speed,length M else M if (3 == 0x16) || (3 == 0x1a) M leng = (endpat5-$-3)/0x20 ;tbltype1,speed,length MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 133 LOC OBJECT CODE LINE SOURCE TEXT VALUE M else M if (3 == 0x1f) M leng = (endpat5-$-3)/0x18 ;tbltype1,speed,length M else M if (3 == 0x20) M leng = (endpat5-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat5-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif M expand M if ($ < 0x2100) 0595 3403 3430 3402 M dt 3,0x30,(leng) M else M de 3,0x30,(leng) M endif 0598 3466 3460 00157 dt 0x66, 0x60 ; 1 059A 3499 3490 00158 dt 0x99, 0x90 ; 2 00159 end_pattern 059C M endpat5 00000006 M patternc = patternc + 1 00160 00161 ;********************************************************************** 00162 ;table3 ; DF3 - train 00163 ;********************************************************************** 00164 00165 start_pattern 3, 0x30 M 059C M table6 M if (3 == 1) || (3 == 6) || (3 == 0x15) || (3 == 0x1c)|| (3 == 0x1d)||(3 == 0 x01e) M leng = (endpat6-$-3)/3 ;tbltype1,speed,length M else M if (3 == 3) || (3 == 0x0b) || (3 == 0x10) || (3 == 0x13) || (3 == 0x14)|| (3 == 0x18) 00000006 M leng = (endpat6-$-3)/2 ;tbltype1,speed,length M else M if (3 == 9) || (3 == 0x0e) M leng =(endpat6-$-3)/5 ;tbltype1,speed,length M else M if (3 == 0x0a) M leng =(endpat6-$-3)/4 ;tbltype1,speed,length M else M if (3 == 0x0d) M leng =(endpat6-$-3)/(9+1) ;tbltype1,speed,length MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 134 LOC OBJECT CODE LINE SOURCE TEXT VALUE M else M if (3 == 0x0f) || (3 == 0x12)|| (3 == 0x17)||(3 == 0x1b) M leng =(endpat6-$-3)/(6) ;tbltype1,speed,length M else M if (3 == 0x11) M leng = (endpat6-$-3)/(9+4) ;tbltype1,speed,length M else M if (3 == 0x16) || (3 == 0x1a) M leng = (endpat6-$-3)/0x20 ;tbltype1,speed,length M else M if (3 == 0x1f) M leng = (endpat6-$-3)/0x18 ;tbltype1,speed,length M else M if (3 == 0x20) M leng = (endpat6-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat6-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif M expand M if ($ < 0x2100) 059C 3403 3430 3406 M dt 3,0x30,(leng) M else M de 3,0x30,(leng) M endif 059F 3464 3400 00166 dt 0x64, 0x00 ; 1 05A1 3419 3400 00167 dt 0x19, 0x00 ; 2 05A3 3406 3440 00168 dt 0x06, 0x40 ; 3 05A5 3401 3490 00169 dt 0x01, 0x90 ; 4 05A7 3440 3460 00170 dt 0x40, 0x60 ; 5 05A9 3490 3410 00171 dt 0x90, 0x10 ; 6 00172 end_pattern 05AB M endpat6 00000007 M patternc = patternc + 1 00173 00174 ;********************************************************************** 00175 ;table4 ; DF4 - half 00176 ;********************************************************************** 00177 00178 start_pattern 3, 0x30 M 05AB M table7 M if (3 == 1) || (3 == 6) || (3 == 0x15) || (3 == 0x1c)|| (3 == 0x1d)||(3 == 0 x01e) M leng = (endpat7-$-3)/3 ;tbltype1,speed,length MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 135 LOC OBJECT CODE LINE SOURCE TEXT VALUE M else M if (3 == 3) || (3 == 0x0b) || (3 == 0x10) || (3 == 0x13) || (3 == 0x14)|| (3 == 0x18) 00000006 M leng = (endpat7-$-3)/2 ;tbltype1,speed,length M else M if (3 == 9) || (3 == 0x0e) M leng =(endpat7-$-3)/5 ;tbltype1,speed,length M else M if (3 == 0x0a) M leng =(endpat7-$-3)/4 ;tbltype1,speed,length M else M if (3 == 0x0d) M leng =(endpat7-$-3)/(9+1) ;tbltype1,speed,length M else M if (3 == 0x0f) || (3 == 0x12)|| (3 == 0x17)||(3 == 0x1b) M leng =(endpat7-$-3)/(6) ;tbltype1,speed,length M else M if (3 == 0x11) M leng = (endpat7-$-3)/(9+4) ;tbltype1,speed,length M else M if (3 == 0x16) || (3 == 0x1a) M leng = (endpat7-$-3)/0x20 ;tbltype1,speed,length M else M if (3 == 0x1f) M leng = (endpat7-$-3)/0x18 ;tbltype1,speed,length M else M if (3 == 0x20) M leng = (endpat7-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat7-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif M expand M if ($ < 0x2100) 05AB 3403 3430 3406 M dt 3,0x30,(leng) M else M de 3,0x30,(leng) M endif 05AE 345A 3490 00179 dt 0x5A, 0x90 ; 1 05B0 346A 3450 00180 dt 0x6A, 0x50 ; 2 05B2 34A9 3450 00181 dt 0xA9, 0x50 ; 3 05B4 34A5 3460 00182 dt 0xA5, 0x60 ; 4 05B6 3495 34A0 00183 dt 0x95, 0xA0 ; 5 05B8 3456 34A0 00184 dt 0x56, 0xA0 ; 6 00185 end_pattern MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 136 LOC OBJECT CODE LINE SOURCE TEXT VALUE 05BA M endpat7 00000008 M patternc = patternc + 1 00186 00187 ;********************************************************************** 00188 ;table5 ; DF5 - passing 00189 ;********************************************************************** 00190 00191 start_pattern 3, 0x10 M 05BA M table8 M if (3 == 1) || (3 == 6) || (3 == 0x15) || (3 == 0x1c)|| (3 == 0x1d)||(3 == 0 x01e) M leng = (endpat8-$-3)/3 ;tbltype1,speed,length M else M if (3 == 3) || (3 == 0x0b) || (3 == 0x10) || (3 == 0x13) || (3 == 0x14)|| (3 == 0x18) 00000006 M leng = (endpat8-$-3)/2 ;tbltype1,speed,length M else M if (3 == 9) || (3 == 0x0e) M leng =(endpat8-$-3)/5 ;tbltype1,speed,length M else M if (3 == 0x0a) M leng =(endpat8-$-3)/4 ;tbltype1,speed,length M else M if (3 == 0x0d) M leng =(endpat8-$-3)/(9+1) ;tbltype1,speed,length M else M if (3 == 0x0f) || (3 == 0x12)|| (3 == 0x17)||(3 == 0x1b) M leng =(endpat8-$-3)/(6) ;tbltype1,speed,length M else M if (3 == 0x11) M leng = (endpat8-$-3)/(9+4) ;tbltype1,speed,length M else M if (3 == 0x16) || (3 == 0x1a) M leng = (endpat8-$-3)/0x20 ;tbltype1,speed,length M else M if (3 == 0x1f) M leng = (endpat8-$-3)/0x18 ;tbltype1,speed,length M else M if (3 == 0x20) M leng = (endpat8-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat8-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 137 LOC OBJECT CODE LINE SOURCE TEXT VALUE M expand M if ($ < 0x2100) 05BA 3403 3410 3406 M dt 3,0x10,(leng) M else M de 3,0x10,(leng) M endif 05BD 3442 3400 00192 dt 0x42, 0x00 ; 1 05BF 3418 3400 00193 dt 0x18, 0x00 ; 2 05C1 3424 3400 00194 dt 0x24, 0x00 ; 3 05C3 3481 3400 00195 dt 0x81, 0x00 ; 4 05C5 3400 3460 00196 dt 0x00, 0x60 ; 5 05C7 3400 3490 00197 dt 0x00, 0x90 ; 6 00198 end_pattern 05C9 M endpat8 00000009 M patternc = patternc + 1 00199 00200 ;********************************************************************** 00201 ;table6 ; DF6 - rpm 00202 ;********************************************************************** 00203 00204 start_pattern 3, 0x30 M 05C9 M table9 M if (3 == 1) || (3 == 6) || (3 == 0x15) || (3 == 0x1c)|| (3 == 0x1d)||(3 == 0 x01e) M leng = (endpat9-$-3)/3 ;tbltype1,speed,length M else M if (3 == 3) || (3 == 0x0b) || (3 == 0x10) || (3 == 0x13) || (3 == 0x14)|| (3 == 0x18) 0000000B M leng = (endpat9-$-3)/2 ;tbltype1,speed,length M else M if (3 == 9) || (3 == 0x0e) M leng =(endpat9-$-3)/5 ;tbltype1,speed,length M else M if (3 == 0x0a) M leng =(endpat9-$-3)/4 ;tbltype1,speed,length M else M if (3 == 0x0d) M leng =(endpat9-$-3)/(9+1) ;tbltype1,speed,length M else M if (3 == 0x0f) || (3 == 0x12)|| (3 == 0x17)||(3 == 0x1b) M leng =(endpat9-$-3)/(6) ;tbltype1,speed,length M else M if (3 == 0x11) M leng = (endpat9-$-3)/(9+4) ;tbltype1,speed,length M else M if (3 == 0x16) || (3 == 0x1a) M leng = (endpat9-$-3)/0x20 ;tbltype1,speed,length M else M if (3 == 0x1f) M leng = (endpat9-$-3)/0x18 ;tbltype1,speed,length M else M if (3 == 0x20) MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 138 LOC OBJECT CODE LINE SOURCE TEXT VALUE M leng = (endpat9-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat9-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif M expand M if ($ < 0x2100) 05C9 3403 3430 340B M dt 3,0x30,(leng) M else M de 3,0x30,(leng) M endif 05CC 3440 3400 00205 dt 0x40, 0x00 ; 1 05CE 3450 3400 00206 dt 0x50, 0x00 ; 2 05D0 3454 3400 00207 dt 0x54, 0x00 ; 3 05D2 3457 3400 00208 dt 0x57, 0x00 ; 4 05D4 3457 34C0 00209 dt 0x57, 0xC0 ; 5 05D6 3457 34E0 00210 dt 0x57, 0xE0 ; 6 05D8 3457 34C0 00211 dt 0x57, 0xC0 ; 7 05DA 3457 3400 00212 dt 0x57, 0x00 ; 8 05DC 3450 3400 00213 dt 0x50, 0x00 ; 9 05DE 3440 3400 00214 dt 0x40, 0x00 ; 10 05E0 3400 3404 00215 dt 0x00, 0x04 ; 11/12/13/14 00216 end_pattern 05E2 M endpat9 0000000A M patternc = patternc + 1 00217 00218 ;********************************************************************** 00219 ;table7 ; DF7 - right 00220 ;********************************************************************** 00221 00222 start_pattern 3, 0x30 M 05E2 M table10 M if (3 == 1) || (3 == 6) || (3 == 0x15) || (3 == 0x1c)|| (3 == 0x1d)||(3 == 0 x01e) M leng = (endpat10-$-3)/3 ;tbltype1,speed,length M else M if (3 == 3) || (3 == 0x0b) || (3 == 0x10) || (3 == 0x13) || (3 == 0x14)|| (3 == 0x18) 00000008 M leng = (endpat10-$-3)/2 ;tbltype1,speed,length M else M if (3 == 9) || (3 == 0x0e) M leng =(endpat10-$-3)/5 ;tbltype1,speed,length M else M if (3 == 0x0a) MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 139 LOC OBJECT CODE LINE SOURCE TEXT VALUE M leng =(endpat10-$-3)/4 ;tbltype1,speed,length M else M if (3 == 0x0d) M leng =(endpat10-$-3)/(9+1) ;tbltype1,speed,length M else M if (3 == 0x0f) || (3 == 0x12)|| (3 == 0x17)||(3 == 0x1b) M leng =(endpat10-$-3)/(6) ;tbltype1,speed,length M else M if (3 == 0x11) M leng = (endpat10-$-3)/(9+4) ;tbltype1,speed,length M else M if (3 == 0x16) || (3 == 0x1a) M leng = (endpat10-$-3)/0x20 ;tbltype1,speed,length M else M if (3 == 0x1f) M leng = (endpat10-$-3)/0x18 ;tbltype1,speed,length M else M if (3 == 0x20) M leng = (endpat10-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat10-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif M expand M if ($ < 0x2100) 05E2 3403 3430 3408 M dt 3,0x30,(leng) M else M de 3,0x30,(leng) M endif 05E5 3400 3400 00223 dt 0x00, 0x00 ; 1 05E7 3400 3450 00224 dt 0x00, 0x50 ; 2 05E9 3441 3400 00225 dt 0x41, 0x00 ; 3 05EB 3414 3400 00226 dt 0x14, 0x00 ; 4 05ED 3400 3400 00227 dt 0x00, 0x00 ; 5 05EF 3400 34A0 00228 dt 0x00, 0xA0 ; 6 05F1 3482 3400 00229 dt 0x82, 0x00 ; 7 05F3 3428 3400 00230 dt 0x28, 0x00 ; 8 00231 end_pattern 05F5 M endpat10 0000000B M patternc = patternc + 1 00232 00233 ;********************************************************************** 00234 ;table8 ; DF8 - down 00235 ;********************************************************************** 00236 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 140 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00237 start_pattern 3, 0x10 M 05F5 M table11 M if (3 == 1) || (3 == 6) || (3 == 0x15) || (3 == 0x1c)|| (3 == 0x1d)||(3 == 0 x01e) M leng = (endpat11-$-3)/3 ;tbltype1,speed,length M else M if (3 == 3) || (3 == 0x0b) || (3 == 0x10) || (3 == 0x13) || (3 == 0x14)|| (3 == 0x18) 00000007 M leng = (endpat11-$-3)/2 ;tbltype1,speed,length M else M if (3 == 9) || (3 == 0x0e) M leng =(endpat11-$-3)/5 ;tbltype1,speed,length M else M if (3 == 0x0a) M leng =(endpat11-$-3)/4 ;tbltype1,speed,length M else M if (3 == 0x0d) M leng =(endpat11-$-3)/(9+1) ;tbltype1,speed,length M else M if (3 == 0x0f) || (3 == 0x12)|| (3 == 0x17)||(3 == 0x1b) M leng =(endpat11-$-3)/(6) ;tbltype1,speed,length M else M if (3 == 0x11) M leng = (endpat11-$-3)/(9+4) ;tbltype1,speed,length M else M if (3 == 0x16) || (3 == 0x1a) M leng = (endpat11-$-3)/0x20 ;tbltype1,speed,length M else M if (3 == 0x1f) M leng = (endpat11-$-3)/0x18 ;tbltype1,speed,length M else M if (3 == 0x20) M leng = (endpat11-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat11-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif M expand M if ($ < 0x2100) 05F5 3403 3410 3407 M dt 3,0x10,(leng) M else M de 3,0x10,(leng) M endif 05F8 3440 3400 00238 dt 0x40, 0x00 ; 1 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 141 LOC OBJECT CODE LINE SOURCE TEXT VALUE 05FA 34D0 3410 00239 dt 0xD0, 0x10 ; 2 05FC 34B4 3470 00240 dt 0xB4, 0x70 ; 3 05FE 342D 34E0 00241 dt 0x2D, 0xE0 ; 4 0600 340B 3480 00242 dt 0x0B, 0x80 ; 5 0602 3402 3400 00243 dt 0x02, 0x00 ; 6 0604 3400 3402 00244 dt 0x00, 0x02 ; 7/8/9 00245 end_pattern 0606 M endpat11 0000000C M patternc = patternc + 1 00246 00247 ;********************************************************************** 00248 ; EEPROM ;test pattern for 4RGB with 2 bits of luminance per LED 00249 ;********************************************************************** 00250 #ifdef __12F1822 F000 00251 org 0xF000 00252 #else 00253 org 0x2100 ; data EEPROM locatio 00254 #endif 00255 00256 ;********************************************************************** 00257 ; fade around 00258 ;********************************************************************** 00259 start_pattern 1, 0x30 M F000 M table12 M if (1 == 1) || (1 == 6) || (1 == 0x15) || (1 == 0x1c)|| (1 == 0x1d)||(1 == 0 x01e) 00000012 M leng = (endpat12-$-3)/3 ;tbltype1,speed,length M else M if (1 == 3) || (1 == 0x0b) || (1 == 0x10) || (1 == 0x13) || (1 == 0x14)|| (1 == 0x18) M leng = (endpat12-$-3)/2 ;tbltype1,speed,length M else M if (1 == 9) || (1 == 0x0e) M leng =(endpat12-$-3)/5 ;tbltype1,speed,length M else M if (1 == 0x0a) M leng =(endpat12-$-3)/4 ;tbltype1,speed,length M else M if (1 == 0x0d) M leng =(endpat12-$-3)/(9+1) ;tbltype1,speed,length M else M if (1 == 0x0f) || (1 == 0x12)|| (1 == 0x17)||(1 == 0x1b) M leng =(endpat12-$-3)/(6) ;tbltype1,speed,length M else M if (1 == 0x11) M leng = (endpat12-$-3)/(9+4) ;tbltype1,speed,length M else M if (1 == 0x16) || (1 == 0x1a) M leng = (endpat12-$-3)/0x20 ;tbltype1,speed,length M else M if (1 == 0x1f) M leng = (endpat12-$-3)/0x18 ;tbltype1,speed,length MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 142 LOC OBJECT CODE LINE SOURCE TEXT VALUE M else M if (1 == 0x20) M leng = (endpat12-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat12-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif M expand M if ($ < 0x2100) M dt 1,0x30,(leng) M else F000 0001 0030 0012 M de 1,0x30,(leng) M endif 00260 ; 1R 2R 3R 4R 5R 6R F003 34C0 3400 3400 00261 dt b'11000000',b'00000000',b'00000000' F006 3484 3400 3400 00262 dt b'10000100',b'00000000',b'00000000' F009 3448 3400 3400 00263 dt b'01001000',b'00000000',b'00000000' F00C 340C 3400 3400 00264 dt b'00001100',b'00000000',b'00000000' F00F 3408 3440 3400 00265 dt b'00001000',b'01000000',b'00000000' F012 3404 3480 3400 00266 dt b'00000100',b'10000000',b'00000000' F015 3400 34C0 3400 00267 dt b'00000000',b'11000000',b'00000000' F018 3400 3484 3400 00268 dt b'00000000',b'10000100',b'00000000' F01B 3400 3448 3400 00269 dt b'00000000',b'01001000',b'00000000' F01E 3400 340C 3400 00270 dt b'00000000',b'00001100',b'00000000' F021 3400 3408 3440 00271 dt b'00000000',b'00001000',b'01000000' F024 3400 3404 3480 00272 dt b'00000000',b'00000100',b'10000000' F027 3400 3400 34C0 00273 dt b'00000000',b'00000000',b'11000000' F02A 3400 3400 3484 00274 dt b'00000000',b'00000000',b'10000100' F02D 3400 3400 3448 00275 dt b'00000000',b'00000000',b'01001000' F030 3400 3400 340C 00276 dt b'00000000',b'00000000',b'00001100' F033 3440 3400 3408 00277 dt b'01000000',b'00000000',b'00001000' F036 3480 3400 3404 00278 dt b'10000000',b'00000000',b'00000100' 00279 end_pattern F039 M endpat12 0000000D M patternc = patternc + 1 00280 00281 ;********************************************************************** 00282 ; fade up/down 00283 ;********************************************************************** 00284 start_pattern 0x01, 0x30 M F039 M table13 M if (0x01 == 1) || (0x01 == 6) || (0x01 == 0x15) || (0x01 == 0x1c)|| (0x01 == 0x1d)||(0x01 == 0 x01e) 00000006 M leng = (endpat13-$-3)/3 ;tbltype1,speed,length MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 143 LOC OBJECT CODE LINE SOURCE TEXT VALUE M else M if (0x01 == 3) || (0x01 == 0x0b) || (0x01 == 0x10) || (0x01 == 0x13) || (0x01 == 0x14)|| (0x01 == 0x18) M leng = (endpat13-$-3)/2 ;tbltype1,speed,length M else M if (0x01 == 9) || (0x01 == 0x0e) M leng =(endpat13-$-3)/5 ;tbltype1,speed,length M else M if (0x01 == 0x0a) M leng =(endpat13-$-3)/4 ;tbltype1,speed,length M else M if (0x01 == 0x0d) M leng =(endpat13-$-3)/(9+1) ;tbltype1,speed,length M else M if (0x01 == 0x0f) || (0x01 == 0x12)|| (0x01 == 0x17)||(0x01 == 0x1b) M leng =(endpat13-$-3)/(6) ;tbltype1,speed,length M else M if (0x01 == 0x11) M leng = (endpat13-$-3)/(9+4) ;tbltype1,speed,length M else M if (0x01 == 0x16) || (0x01 == 0x1a) M leng = (endpat13-$-3)/0x20 ;tbltype1,speed,length M else M if (0x01 == 0x1f) M leng = (endpat13-$-3)/0x18 ;tbltype1,speed,length M else M if (0x01 == 0x20) M leng = (endpat13-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat13-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif M expand M if ($ < 0x2100) M dt 0x01,0x30,(leng) M else F039 0001 0030 0006 M de 0x01,0x30,(leng) M endif 00285 ; 1R 2R 3R 4R 5R 6R F03C 3400 3400 3400 00286 dt b'00000000',b'00000000',b'00000000' F03F 3455 3455 3455 00287 dt b'01010101',b'01010101',b'01010101' F042 34AA 34AA 34AA 00288 dt b'10101010',b'10101010',b'10101010' F045 34FF 34FF 34FF 00289 dt b'11111111',b'11111111',b'11111111' F048 34AA 34AA 34AA 00290 dt b'10101010',b'10101010',b'10101010' F04B 3455 3455 3455 00291 dt b'01010101',b'01010101',b'01010101' MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 144 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00292 end_pattern F04E M endpat13 0000000E M patternc = patternc + 1 00293 00294 ;********************************************************************** 00295 ; fade up/down 00296 ;********************************************************************** 00297 start_pattern 0x01, 0x30 M F04E M table14 M if (0x01 == 1) || (0x01 == 6) || (0x01 == 0x15) || (0x01 == 0x1c)|| (0x01 == 0x1d)||(0x01 == 0 x01e) 00000006 M leng = (endpat14-$-3)/3 ;tbltype1,speed,length M else M if (0x01 == 3) || (0x01 == 0x0b) || (0x01 == 0x10) || (0x01 == 0x13) || (0x01 == 0x14)|| (0x01 == 0x18) M leng = (endpat14-$-3)/2 ;tbltype1,speed,length M else M if (0x01 == 9) || (0x01 == 0x0e) M leng =(endpat14-$-3)/5 ;tbltype1,speed,length M else M if (0x01 == 0x0a) M leng =(endpat14-$-3)/4 ;tbltype1,speed,length M else M if (0x01 == 0x0d) M leng =(endpat14-$-3)/(9+1) ;tbltype1,speed,length M else M if (0x01 == 0x0f) || (0x01 == 0x12)|| (0x01 == 0x17)||(0x01 == 0x1b) M leng =(endpat14-$-3)/(6) ;tbltype1,speed,length M else M if (0x01 == 0x11) M leng = (endpat14-$-3)/(9+4) ;tbltype1,speed,length M else M if (0x01 == 0x16) || (0x01 == 0x1a) M leng = (endpat14-$-3)/0x20 ;tbltype1,speed,length M else M if (0x01 == 0x1f) M leng = (endpat14-$-3)/0x18 ;tbltype1,speed,length M else M if (0x01 == 0x20) M leng = (endpat14-$-3)/0x19 ;tbltype1,speed,length M else M leng =(endpat14-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 145 LOC OBJECT CODE LINE SOURCE TEXT VALUE M expand M if ($ < 0x2100) M dt 0x01,0x30,(leng) M else F04E 0001 0030 0006 M de 0x01,0x30,(leng) M endif 00298 ; 1R 2R 3R 4R 5R 6R F051 3433 3433 3433 00299 dt b'00110011',b'00110011',b'00110011' F054 3466 3466 3466 00300 dt b'01100110',b'01100110',b'01100110' F057 3499 34AA 34AA 00301 dt b'10011001',b'10101010',b'10101010' F05A 34CC 34CC 34CC 00302 dt b'11001100',b'11001100',b'11001100' F05D 3499 34AA 34AA 00303 dt b'10011001',b'10101010',b'10101010' F060 3466 3466 3466 00304 dt b'01100110',b'01100110',b'01100110' 00305 end_pattern F063 M endpat14 0000000F M patternc = patternc + 1 00306 00307 ;********************************************************************** 00308 ;table10 ; DF3 - fast spin 00309 ;********************************************************************** 00310 00311 start_pattern 5, 0x10 M F063 M table15 M if (5 == 1) || (5 == 6) || (5 == 0x15) || (5 == 0x1c)|| (5 == 0x1d)||(5 == 0 x01e) M leng = (endpat15-$-3)/3 ;tbltype1,speed,length M else M if (5 == 3) || (5 == 0x0b) || (5 == 0x10) || (5 == 0x13) || (5 == 0x14)|| (5 == 0x18) M leng = (endpat15-$-3)/2 ;tbltype1,speed,length M else M if (5 == 9) || (5 == 0x0e) M leng =(endpat15-$-3)/5 ;tbltype1,speed,length M else M if (5 == 0x0a) M leng =(endpat15-$-3)/4 ;tbltype1,speed,length M else M if (5 == 0x0d) M leng =(endpat15-$-3)/(9+1) ;tbltype1,speed,length M else M if (5 == 0x0f) || (5 == 0x12)|| (5 == 0x17)||(5 == 0x1b) M leng =(endpat15-$-3)/(6) ;tbltype1,speed,length M else M if (5 == 0x11) M leng = (endpat15-$-3)/(9+4) ;tbltype1,speed,length M else M if (5 == 0x16) || (5 == 0x1a) M leng = (endpat15-$-3)/0x20 ;tbltype1,speed,length M else M if (5 == 0x1f) M leng = (endpat15-$-3)/0x18 ;tbltype1,speed,length M else MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 146 LOC OBJECT CODE LINE SOURCE TEXT VALUE M if (5 == 0x20) M leng = (endpat15-$-3)/0x19 ;tbltype1,speed,length M else 00000006 M leng =(endpat15-$-3) M endif M endif M endif M endif M endif M endif M endif M endif M endif M endif M expand M if ($ < 0x2100) M dt 5,0x10,(leng) M else F063 0005 0010 0006 M de 5,0x10,(leng) M endif F066 3480 00312 dt 0x80 ; G1 F067 3440 00313 dt 0x40 ; G2 F068 3420 00314 dt 0x20 ; G3 F069 3410 00315 dt 0x10 ; G4 F06A 3408 00316 dt 0x08 ; G5 F06B 3405 00317 dt 0x05 ; G6 00318 end_pattern F06C M endpat15 00000010 M patternc = patternc + 1 00319 F06C 00320 demo_store F06C 3400 00321 dt 0x00 04075 #endif 04076 #endif 04077 #endif 04078 04079 #ifdef M3X3 04080 #include 04081 #endif 04082 04083 #ifdef S19 04084 #include 04085 #endif 04086 04087 #ifdef GATOR 04088 #include 04089 #endif 04090 04091 #ifdef ROCKET 04092 #include 04093 #endif 04094 04095 #ifdef BADGE_G2 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 147 LOC OBJECT CODE LINE SOURCE TEXT VALUE 04096 #include 04097 #endif 04098 04099 #ifdef BI6_DOGTAG 04100 #ifdef MONO 04101 #include 04102 #else 04103 #include 04104 #endif 04105 #endif 04106 04107 #ifdef RGB2_DOGTAG 04108 #include 04109 #endif 04110 04111 #ifdef C19 04112 #ifdef MONO 04113 #include 04114 #else 04115 #include 04116 #endif 04117 #endif 04118 04119 #ifdef M8X16 04120 #include 04121 #endif 04122 04123 #ifdef C12 04124 #include 04125 #endif 04126 04127 #ifdef RGB_4x4x4 04128 #include 04129 #endif 04130 04131 end MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 148 SYMBOL TABLE LABEL VALUE ABDEN 00000000 ABDOVF 00000007 ACKDT 00000005 ACKEN 00000004 ACKSTAT 00000006 ACKTIM 00000007 ADCON0 0000009D ADCON1 0000009E ADCS0 00000004 ADCS1 00000005 ADCS2 00000006 ADDEN 00000003 ADFM 00000007 ADFVR0 00000000 ADFVR1 00000001 ADGO 00000001 ADIE 00000006 ADIF 00000006 ADON 00000000 ADPREF0 00000000 ADPREF1 00000001 ADRES 0000009B ADRESH 0000009C ADRESL 0000009B AHEN 00000001 AN0 00000000 AN1 00000001 AN2 00000002 AN3 00000004 ANSA0 00000000 ANSA1 00000001 ANSA2 00000002 ANSA4 00000004 ANSELA 0000018C APFCON 0000011D APFCON0 0000011D Ab_reg 00000028 Ag_reg 00000027 Ar_reg 00000026 Ax_dir 0000007F BAUDCON 0000019F BCL1IE 00000003 BCL1IF 00000003 BF 00000000 BI6 BI6_G2 BIN2LED BOEN 00000004 BORCON 00000116 BORRDY 00000000 BRG16 00000003 BRGH 00000002 BRIGHT1 0x40 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 149 SYMBOL TABLE LABEL VALUE BRIGHT1H 0xA0 BRIGHT2 0xA0 BRIGHT2H 0x40 BSR 00000008 BSR0 00000000 BSR1 00000001 BSR2 00000002 BSR3 00000003 BSR4 00000004 BSR_SHAD 00000FE6 Bb_reg 0000002B Bg_reg 0000002A Br_reg 00000029 C 00000000 C1HYS 00000001 C1IE 00000005 C1IF 00000005 C1IN0N 00000001 C1IN1N 00000004 C1INP 00000000 C1INTN 00000006 C1INTP 00000007 C1NCH0 00000000 C1OE 00000005 C1ON 00000007 C1OUT_CM1CON0 00000006 C1OUT_PORTA 00000002 C1PCH0 00000004 C1PCH1 00000005 C1POL 00000004 C1SP 00000002 C1SYNC 00000000 CCP1AS 00000295 CCP1AS0 00000004 CCP1AS1 00000005 CCP1AS2 00000006 CCP1ASE 00000007 CCP1CON 00000293 CCP1IE 00000002 CCP1IF 00000002 CCP1M0 00000000 CCP1M1 00000001 CCP1M2 00000002 CCP1M3 00000003 CCP1SEL 00000000 CCPR1H 00000292 CCPR1L 00000291 CDAFVR0 00000002 CDAFVR1 00000003 CFGS 00000006 CHS0 00000002 CHS1 00000003 CHS2 00000004 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 150 SYMBOL TABLE LABEL VALUE CHS3 00000005 CHS4 00000006 CKE 00000006 CKP 00000004 CLKIN 00000005 CLKOUT 00000004 CLKR 00000004 CLKRCON 0000039A CLKRDC0 00000003 CLKRDC1 00000004 CLKRDIV0 00000000 CLKRDIV1 00000001 CLKRDIV2 00000002 CLKREN 00000007 CLKROE 00000006 CLKRSLR 00000005 CM1CON0 00000111 CM1CON1 00000112 CMOUT 00000115 CPS0 00000000 CPS1 00000001 CPS2 00000002 CPS3 00000004 CPSCH0 00000000 CPSCH1 00000001 CPSCON0 0000001E CPSCON1 0000001F CPSON 00000007 CPSOUT 00000001 CPSRM 00000006 CPSRNG0 00000002 CPSRNG1 00000003 CREN 00000004 CSRC 00000007 C_SHAD 00000000 Cb_reg 0000002E Cg_reg 0000002D Cr_reg 0000002C DACCON0 00000118 DACCON1 00000119 DACEN 00000007 DACLPS 00000006 DACOE 00000005 DACOUT 00000000 DACPSS0 00000002 DACPSS1 00000003 DACR0 00000000 DACR1 00000001 DACR2 00000002 DACR3 00000003 DACR4 00000004 DC 00000001 DC1B0 00000004 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 151 SYMBOL TABLE LABEL VALUE DC1B1 00000005 DC_SHAD 00000001 DEBOUNCE 0x10 DELAYTIMER 0000003A DHEN 00000000 DISPLAY_1BIT_C DISPLAY_2BIT_C D_NOT_A 00000005 Db_reg 00000031 Dg_reg 00000030 Dr_reg 0000002F ECCP1AS 00000295 EEADR 00000191 EEADRH 00000192 EEADRL 00000191 EECON1 00000195 EECON2 00000196 EEDAT 00000193 EEDATH 00000194 EEDATL 00000193 EEIE 00000004 EEIF 00000004 EEPGD 00000007 ENABLE_IR F 00000001 FERR 00000002 FLT0 00000002 FREE 00000004 FSR0 00000004 FSR0H 00000005 FSR0H_SHAD 00000FE9 FSR0L 00000004 FSR0L_SHAD 00000FE8 FSR1 00000006 FSR1H 00000007 FSR1H_SHAD 00000FEB FSR1L 00000006 FSR1L_SHAD 00000FEA FVRCON 00000117 FVREN 00000007 FVRRDY 00000006 GCEN 00000007 GIE 00000007 GO 00000001 GO_NOT_DONE 00000001 HFIOFL 00000003 HFIOFR 00000004 HFIOFS 00000000 INDF0 00000000 INDF1 00000001 INTCON 0000000B INTE 00000004 INTEDG 00000006 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 152 SYMBOL TABLE LABEL VALUE INTF 00000001 IOCAF 00000393 IOCAF0 00000000 IOCAF1 00000001 IOCAF2 00000002 IOCAF3 00000003 IOCAF4 00000004 IOCAF5 00000005 IOCAN 00000392 IOCAN0 00000000 IOCAN1 00000001 IOCAN2 00000002 IOCAN3 00000003 IOCAN4 00000004 IOCAN5 00000005 IOCAP 00000391 IOCAP0 00000000 IOCAP1 00000001 IOCAP2 00000002 IOCAP3 00000003 IOCAP4 00000004 IOCAP5 00000005 IOCIE 00000003 IOCIF 00000000 IRBIT 4 IRCF0 00000003 IRCF1 00000004 IRCF2 00000005 IRCF3 00000006 IRPORT PORTA IR_Tester 000003E1 IR_in 00000034 IR_in_good 0000003C IR_lhalf 00000038 LATA 0000010C LATA0 00000000 LATA1 00000001 LATA2 00000002 LATA4 00000004 LATA5 00000005 LFIOFR 00000001 LWLO 00000005 Lcontinue 000001F4 LedOut LedOutH LedOutInd LedOutIndP LedOutL Lstate0 000000F3 Lstate0a 000000FB Lstate1 000000FE Lstate10 00000146 Lstate10a 0000014C MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 153 SYMBOL TABLE LABEL VALUE Lstate11 00000152 Lstate12 00000156 Lstate12a 0000015C Lstate13 00000162 Lstate14 00000166 Lstate14a 0000016C Lstate15 00000172 Lstate16 00000176 Lstate16a 0000017C Lstate17 00000182 Lstate18 00000186 Lstate18a 0000018C Lstate19 00000192 Lstate1a 00000103 Lstate2 00000106 Lstate20 00000196 Lstate20a 0000019C Lstate21 000001A2 Lstate22 000001A6 Lstate22a 000001AC Lstate23 000001B2 Lstate24 000001B6 Lstate24a 000001BC Lstate25 000001C2 Lstate26 000001C6 Lstate26a 000001CC Lstate27 000001D2 Lstate28 000001D6 Lstate28a 000001DC Lstate29 000001E2 Lstate2a 0000010B Lstate3 0000010E Lstate30 000001E6 Lstate30a 000001EC Lstate31 000001F2 Lstate3a 00000113 Lstate4 00000116 Lstate4a 0000011B Lstate5 0000011E Lstate5a 00000123 Lstate6 00000126 Lstate6a 00000130 Lstate6b 0000012E Lstate7 00000132 Lstate8 00000136 Lstate8a 0000013C Lstate9 00000142 MC1OUT 00000000 MDBIT 00000000 MDCARH 0000039F MDCARL 0000039E MDCH0 00000000 MDCH1 00000001 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 154 SYMBOL TABLE LABEL VALUE MDCH2 00000002 MDCH3 00000003 MDCHODIS 00000007 MDCHPOL 00000006 MDCHSYNC 00000005 MDCIN1 00000002 MDCIN2 00000004 MDCL0 00000000 MDCL1 00000001 MDCL2 00000002 MDCL3 00000003 MDCLODIS 00000007 MDCLPOL 00000006 MDCLSYNC 00000005 MDCON 0000039C MDEN 00000007 MDMIN 00000001 MDMS0 00000000 MDMS1 00000001 MDMS2 00000002 MDMS3 00000003 MDMSODIS 00000007 MDOE 00000006 MDOPOL 00000004 MDOUT_MDCON 00000003 MDOUT_PORTA 00000000 MDSLR 00000005 MDSRC 0000039D MFIOFR 00000002 MasterTable 0000046A NOT_BOR 00000000 NOT_DONE 00000001 NOT_MCLR 00000003 NOT_PD 00000003 NOT_POR 00000001 NOT_RI 00000002 NOT_RMCLR 00000003 NOT_T1SYNC 00000002 NOT_TO 00000004 NOT_WPUEN 00000007 NUM_TAB 0000000E OERR 00000001 OPTION_REG 00000095 OSC1 00000005 OSC2 00000004 OSCCON 00000099 OSCSTAT 0000009A OSCTUNE 00000098 OSFIE 00000007 OSFIF 00000007 OSTS 00000005 P 00000004 P1BSEL 00000001 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 155 SYMBOL TABLE LABEL VALUE P1DC0 00000000 P1DC1 00000001 P1DC2 00000002 P1DC3 00000003 P1DC4 00000004 P1DC5 00000005 P1DC6 00000006 P1M0 00000006 P1M1 00000007 P1RSEN 00000007 PATTERN1 PATTERN3 PCIE 00000006 PCL 00000002 PCLATH 0000000A PCLATH_SHAD 00000FE7 PCON 00000096 PEIE 00000006 PEN 00000002 PIE1 00000091 PIE2 00000092 PIR1 00000011 PIR2 00000012 PLLR 00000006 PORTA 0000000C PR2 0000001B PS0 00000000 PS1 00000001 PS2 00000002 PSA 00000003 PSS1AC0 00000002 PSS1AC1 00000003 PSS1BD0 00000000 PSS1BD1 00000001 PSTR1CON 00000296 PWM1CON 00000294 RA0 00000000 RA1 00000001 RA2 00000002 RA3 00000003 RA4 00000004 RA5 00000005 RCEN 00000003 RCIDL 00000006 RCIE 00000005 RCIF 00000005 RCREG 00000199 RCSTA 0000019D RD 00000000 RSEN 00000001 RX9 00000006 RX9D 00000000 RXDTSEL 00000007 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 156 SYMBOL TABLE LABEL VALUE R_NOT_W 00000002 S 00000003 SBCDE 00000002 SBOREN 00000007 SCIE 00000005 SCK 00000001 SCKP 00000004 SCL 00000001 SCS0 00000000 SCS1 00000001 SDA 00000002 SDAHT 00000003 SDI 00000002 SDO1SEL 00000006 SDOSEL 00000006 SEN 00000000 SENDB 00000003 SMP 00000007 SPBRG 0000019B SPBRGH 0000019C SPBRGL 0000019B SPEN 00000007 SPLLEN 00000007 SRCLK0 00000004 SRCLK1 00000005 SRCLK2 00000006 SRCON0 0000011A SRCON1 0000011B SREN 00000005 SRI 00000001 SRLEN 00000007 SRNQ 00000005 SRNQEN 00000002 SRPR 00000000 SRPS 00000001 SRQ 00000002 SRQEN 00000003 SRRC1E 00000000 SRRCKE 00000002 SRRPE 00000003 SRSC1E 00000004 SRSCKE 00000006 SRSPE 00000007 SS1SEL 00000005 SSP1ADD 00000212 SSP1BUF 00000211 SSP1CON1 00000215 SSP1CON2 00000216 SSP1CON3 00000217 SSP1IE 00000003 SSP1IF 00000003 SSP1MSK 00000213 SSP1STAT 00000214 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 157 SYMBOL TABLE LABEL VALUE SSPADD 00000212 SSPBUF 00000211 SSPCON 00000215 SSPCON1 00000215 SSPCON2 00000216 SSPCON3 00000217 SSPEN 00000005 SSPM0 00000000 SSPM1 00000001 SSPM2 00000002 SSPM3 00000003 SSPMSK 00000213 SSPOV 00000006 SSPSTAT 00000214 SSSEL 00000005 STATUS 00000003 STATUS_SHAD 00000FE4 STKOVF 00000007 STKPTR 00000FED STKUNF 00000006 STR1A 00000000 STR1B 00000001 STR1C 00000002 STR1D 00000003 STR1SYNC 00000004 STROBE_LINES 00000004 SWDTEN 00000000 SYNC 00000004 T0CKI 00000002 T0CS 00000005 T0IE 00000005 T0IF 00000002 T0SE 00000004 T0XCS 00000000 T1CKI 00000005 T1CKPS0 00000004 T1CKPS1 00000005 T1CON 00000018 T1GCON 00000019 T1GGO 00000003 T1GGO_NOT_DONE 00000003 T1GPOL 00000006 T1GSEL 00000003 T1GSPM 00000004 T1GSS0 00000000 T1GSS1 00000001 T1GTM 00000005 T1GVAL 00000002 T1OSCEN 00000003 T1OSCR 00000007 T1OSI 00000005 T1OSO 00000004 T2CKPS0 00000000 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 158 SYMBOL TABLE LABEL VALUE T2CKPS1 00000001 T2CON 0000001C T2OUTPS0 00000003 T2OUTPS1 00000004 T2OUTPS2 00000005 T2OUTPS3 00000006 TICK_VALUE D'35' TMR0 00000015 TMR0CS 00000005 TMR0IE 00000005 TMR0IF 00000002 TMR0SE 00000004 TMR1 00000016 TMR1CS0 00000006 TMR1CS1 00000007 TMR1GE 00000007 TMR1GIE 00000007 TMR1GIF 00000007 TMR1H 00000017 TMR1IE 00000000 TMR1IF 00000000 TMR1L 00000016 TMR1ON 00000000 TMR2 0000001A TMR2IE 00000001 TMR2IF 00000001 TMR2ON 00000002 TOSH 00000FEF TOSL 00000FEE TRISA 0000008C TRISA0 00000000 TRISA1 00000001 TRISA2 00000002 TRISA3 00000003 TRISA4 00000004 TRISA5 00000005 TRMT 00000001 TSEN 00000005 TSRNG 00000004 TUN0 00000000 TUN1 00000001 TUN2 00000002 TUN3 00000003 TUN4 00000004 TUN5 00000005 TX9 00000006 TX9D 00000000 TXCKSEL 00000002 TXEN 00000005 TXIE 00000004 TXIF 00000004 TXREG 0000019A TXSTA 0000019E MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 159 SYMBOL TABLE LABEL VALUE UA 00000001 W 00000000 WCOL 00000007 WDTCON 00000097 WDTPS0 00000001 WDTPS1 00000002 WDTPS2 00000003 WDTPS3 00000004 WDTPS4 00000005 WPUA 0000020C WPUA0 00000000 WPUA1 00000001 WPUA2 00000002 WPUA3 00000003 WPUA4 00000004 WPUA5 00000005 WR 00000001 WREG 00000009 WREG_SHAD 00000FE5 WREN 00000002 WRERR 00000003 WUE 00000001 Z 00000002 Z_SHAD 00000002 _BOREN_NSLEEP 0000FDFF _BOREN_OFF 0000F9FF _BOREN_ON 0000FFFF _BOREN_SBODEN 0000FBFF _BORV_19 0000FFFF _BORV_HI 0000FBFF _BORV_LO 0000FFFF _CLKOUTEN_OFF 0000FFFF _CLKOUTEN_ON 0000F7FF _CONFIG1 00008007 _CONFIG2 00008008 _CPD_OFF 0000FFFF _CPD_ON 0000FEFF _CP_OFF 0000FFFF _CP_ON 0000FF7F _DEVID1 00008006 _FCMEN_OFF 0000DFFF _FCMEN_ON 0000FFFF _FOSC_ECH 0000FFFF _FOSC_ECL 0000FFFD _FOSC_ECM 0000FFFE _FOSC_EXTRC 0000FFFB _FOSC_HS 0000FFFA _FOSC_INTOSC 0000FFFC _FOSC_LP 0000FFF8 _FOSC_XT 0000FFF9 _IDLOC0 00008000 _IDLOC1 00008001 _IDLOC2 00008002 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 160 SYMBOL TABLE LABEL VALUE _IDLOC3 00008003 _IESO_OFF 0000EFFF _IESO_ON 0000FFFF _LVP_OFF 0000DFFF _LVP_ON 0000FFFF _MCLRE_OFF 0000FFBF _MCLRE_ON 0000FFFF _PLLEN_OFF 0000FEFF _PLLEN_ON 0000FFFF _PWRTE_OFF 0000FFFF _PWRTE_ON 0000FFDF _STVREN_OFF 0000FDFF _STVREN_ON 0000FFFF _WDTE_NSLEEP 0000FFF7 _WDTE_OFF 0000FFE7 _WDTE_ON 0000FFFF _WDTE_SWDTEN 0000FFEF _WRT_ALL 0000FFFC _WRT_BOOT 0000FFFE _WRT_HALF 0000FFFD _WRT_OFF 0000FFFF __12F1822 00000001 address 00000036 b2l_in_green 0000004E b2l_in_red 0000004D b2l_lcount 0000004C b2l_loop 00000250 b2l_out_hi 0000004A b2l_out_low 0000004B bin2led 0000024C blinkie_check 000002FB butcount 0000003D button 00000039 button_check 00000317 command 00000035 count1 00000022 count2 00000023 dcycle 00000021 delay 0000025A delay_count 0000004F delay_loop 0000025B delay_loop2 00000210 demo_mode 0000005B demo_store 0000F06C display_1bit 0000035D display_2bit 00000385 display_cycle0 00000047 display_cycle1 0000005C display_cycle2 00000071 display_cycle3 00000086 display_pattern_id 00000288 display_w_2bit 00000386 drive_main_leds 0000002D MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 161 SYMBOL TABLE LABEL VALUE dupvar end_pattern endpat0 000004AB endpat1 000004B4 endpat10 000005F5 endpat11 00000606 endpat12 0000F039 endpat13 0000F04E endpat14 0000F063 endpat15 0000F06C endpat2 000004ED endpat3 0000055C endpat4 00000595 endpat5 0000059C endpat6 000005AB endpat7 000005BA endpat8 000005C9 endpat9 000005E2 entry exit_int 00000046 exit_tx 00000044 fcount 00000025 get_next_pattern_entry 000002AD get_next_tx_bit 00000205 get_state_tbl_hi_address 0000009B get_state_tbl_low_address 000000A1 go_state_table 000000AF greturn1 000002B9 here 00000004 ibutton 00000402 iloop1 00000415 in0 00000056 in1 00000057 in2 00000058 in_mem 000002B8 input 0000007C instate 00000032 itop 000003F9 leng 00000006 loop 000002A1 main 00000431 make_mtab make_state_jump_table max_instate 00000033 mem 0000005E mem2 0000007B mem3 000000A0 mult_nop next_pattern 0000025F nextf 00000020 out0 00000045 out1 00000046 out2 00000047 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 162 SYMBOL TABLE LABEL VALUE out3 00000048 out_address 00000041 out_command 00000042 out_pattern 00000044 out_toggle 00000043 p2count 0000005D p2loop 00000358 past_exit 00000271 past_pattern 00000269 pattern 00000054 pattern_driver 000002EE pattern_return 00000331 pattern_temp 00000053 patternc 00000010 pindex 0000007E pindex1 0000007D pindex2 0000003B ploop0 000002F9 ploop1a 0000031C ploop1down 00000325 ploop1up 00000321 ploop2 00000329 ploop2a 0000033C ploop3 00000341 psize 0000005C pspeed 0000005A ptop 000002EE qcount 00000040 qdelay 0000020F read_button_in 000001F5 read_demo_mode 000002DC read_eeprom 000002CD read_ir_in 000001FA remote_check 00000302 repeat 00000024 repeat_loop 00000020 rf_command_out 00000213 scount 00000049 send_nothing 0000002C send_on_off 00000411 send_one 00000018 send_zero 0000002A set_exit 0000027E set_loop 00000277 set_max_state 000001FE set_pattern 00000274 setup_pattern_table 0000029B skip1 00000012 smi_l1 00000204 speed 00000059 start_pattern state2_tbl state_jump_table 000000B3 MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 163 SYMBOL TABLE LABEL VALUE state_tbl storedata strobe_count 00000050 strobe_delay 00000281 strobe_delay1 00000282 strobe_delay2 00000283 table0 00000488 table1 000004AB table10 000005E2 table11 000005F5 table12 0000F000 table13 0000F039 table14 0000F04E table15 0000F063 table2 000004B4 table3 000004ED table4 0000055C table5 00000595 table6 0000059C table7 000005AB table8 000005BA table9 000005C9 table_lookup2 000000A8 table_type_1 00000344 table_type_3 0000034E tbl2_hi 0000003E tbl2_low 0000003F tbl_hi 00000051 tbl_low 00000052 tbltype 00000055 tbltype1 tdemo_cont 000002E6 tdemo_on 000002E5 toggle 00000037 toggle_demo 000002E0 tx_1 0000003A var var_all_bank var_bank2 write_eeprom 000002BA MEMORY USAGE MAP ('X' = Used, '-' = Unused) 0000 : X---XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX MPASM 5.44 GENERIC_2011.ASM 8-2-2012 21:13:00 PAGE 164 MEMORY USAGE MAP ('X' = Used, '-' = Unused) 0080 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 00C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0100 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0140 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0180 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 01C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0200 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0240 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0280 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 02C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0300 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0340 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0380 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 03C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0400 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0440 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0480 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 04C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0500 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0540 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0580 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 05C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0600 : XXXXXX---------- ---------------- ---------------- ---------------- 8000 : -------XX------- ---------------- ---------------- ---------------- F000 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX F040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXX--- ---------------- All other memory blocks unused. Program Memory Words Used: 1541 Program Memory Words Free: 507 Errors : 0 Warnings : 1 reported, 0 suppressed Messages : 0 reported, 20 suppressed