MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 1 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00001 ; 00002 ; 00003 ; Code for the 12F675 PIC based Servo Controlled Camera Switch. 00004 ; SCCS: @(#) ssw.asm 1.6@(#) 00005 00006 processor 12F675 00007 radix dec 00008 errorlevel -302 00009 ; 00010 ; This module is configurable for a number of different combinations of 00011 ; facilities. 00012 ; 00013 ; It is *your* responsibility to ensure that the configuration parameters set 00014 ; in the code below match your components and features required. 00015 ; 00016 ; The options are: 00017 ; 00018 ; FIXED - selects fixed (ie. non configurable mode) 00019 ; set FIXED to 0 for the configurable mode 00020 ; set FIXED to 1 for the non-configurable mode 00021 ; *NOTE* when you set FIXED to 1 you also need 00022 ; to ensure the fixed mode parameters below are 00023 ; set correctly 00024 ; 00025 ; SERVOOUT - selects the output to be via a servo. 00026 ; set SERVOOUT to 0 for an open-collector output 00027 ; drive that is suitable for Aiptek/Jazz etc. 00028 ; set SERVOOUT to 1 for servo pulse output 00029 ; 00030 ; LEDOUT - selects whether there is an output LED or not 00031 ; set LEDOUT to 0 to disable the LED drive 00032 ; set LEDOUT to 1 to enable the LED drive 00033 ; 00000000 00034 FIXED equ 0 00000000 00035 SERVOOUT equ 0 00000001 00036 LEDOUT equ 1 00037 00038 ; 00039 ; If fixed (ie. non-configurable) mode is selected then 00040 ; these are the parameters that will apply. 00041 ; These are correct for the Jazz camera with non-servo 00042 ; output. (ie. FIXED == 1, SERVOOUT == 0) 00043 if FIXED 00044 fix_servoidle equ 1500 ; Servo idle position 00045 fix_servofocus equ 1500 ; Servo focus position 00046 fix_servoshutter equ 1500 ; Servo shutter position 00047 00048 fix_timefocus equ 0 ; Time for focuusing 00049 fix_timeshutter equ 2 ; Time for the shutter 00050 fix_timepost equ 10 ; Time post shutter 00051 fix_timekalive equ 55 ; Camera keep-alive time 00052 00053 fix_inputidle equ 1500 ; Input position for idle MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 2 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00054 fix_inputshutter equ 1800 ; Input position for shutter 00055 fix_inputpoweroff equ 1800 ; Input position for power off 00056 00057 fix_timepoweroff equ 10 ; Time to power off 00058 endif 00059 00060 ; 00061 ; In configurable mode these defaults are loaded into 00062 ; the PIC's EEDATA area during programming so that 00063 ; the PIC starts with 'sensible' values. 00064 if !FIXED 000005DC 00065 ini_servoidle equ 1500 ; Servo idle position 000005DC 00066 ini_servofocus equ 1500 ; Servo focus position 000006D6 00067 ini_servoshutter equ 1750 ; Servo shutter position 00068 00000000 00069 ini_timefocus equ 0 ; Time for focuusing 00000005 00070 ini_timeshutter equ 5 ; Time for the shutter 0000000A 00071 ini_timepost equ 10 ; Time post shutter 00000037 00072 ini_timekalive equ 55 ; Camera keep-alive time 00073 000005DC 00074 ini_inputidle equ 1500 ; Input position for idle 00000708 00075 ini_inputshutter equ 1800 ; Input position for shutter 000004B0 00076 ini_inputpoweroff equ 1200 ; Input position for power off 00077 0000000A 00078 ini_timepoweroff equ 10 ; Time to power off 00079 endif 00080 00081 ; 00082 ; Assumes: 00083 ; Bandgap as calibrated at factory 00084 ; CPD disabled 00085 ; CP disabled 00086 ; BODEN enabled 00087 ; MCLR disabled 00088 ; PWRTE enabled 00089 ; WDT (Watchdog) enabled 00090 ; OSC internal RC (no clockout) 00091 ; 00092 ; The basic circuit for the switch is as follows, this is *not* 00093 ; the complete circuit and the associated Web documentation should 00094 ; be consulted for the full circuit diagram. 00095 ; 00096 ; 00097 ; power ----------------------- 00098 ; | | 00099 ; ----------------- 00100 ; | + (1) (8) - | 00101 ; | PIC12F675 | 00102 ; | | 00103 ; rx | (3) GP4 |-<- 00104 ; >--XXXX-------| GP1 (6) | | (active low rx pulse) 00105 ; 4k7 | (5) GP2 |->- 00106 ; | | MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 3 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00107 ; | | 00108 ; | (2) GP5 | ----------> LED 00109 ;Switch >----| GP3 (4) | 00110 ; | (7) GP0 | ----------> Servo Out 00111 ; ----------------- 00112 ; 00113 ; 00114 ; Features of this software are as follows: 00115 ; 00116 ; Watchdog timer ensure the software is running, this is used to ensure 00117 ; that the software always gets back to the main sensing code. If 00118 ; it doesn't the chip is reset. 00119 ; 00120 ; Timer 0 is used to measure the elapsed time. 00121 ; 00122 ; This timer runs at 1Mhz with a 1:2 prescaler and is used to 00123 ; run a 2kHz timer channel. 00124 ; 00125 ; Timer 1 is used to measure the input pulse width. Pulse width should be 00126 ; 1.5msec nominal at central position +/- 0.5msec depending on the 00127 ; control direction. 00128 ; 00129 ; At 4Mhz clock timer 1 will run at 0.001msec count rate. This gives 00130 ; count values for 1.5msec that are well within 16-bit resolution. 00131 ; 00132 ; Timer 1 is also used to measure the output pulse width for servo 00133 ; control. 00134 ; 00135 00136 #include 00001 LIST 00002 ; P12F675.INC Standard Header File, Version 1.04 Microchip Technology, Inc. 00283 LIST 00137 2007 3FCC 00138 __CONFIG(_BODEN_ON & _MCLRE_OFF & _PWRTE_ON & _WDT_ON & _INTRC_OSC_NOCLKOUT) 00139 00140 ; Main parameters 00000005 00141 autopulse equ 5 ; Required number 'same value' to program 00000003 00142 autofuzz equ 3 ; +/- autofuzz is the same value 00000019 00143 framems equ 25 ; servo control frame rate 0000000A 00144 debounce equ 10 ; Jumper debounce time in 20msec increments 00000014 00145 lostime equ 20 ; LOS time in 'framems' increments 0000000B 00146 ncfgitems equ 11 ; The number of configuration items 0000055F 00147 stickAat equ 1500-125 ; Position A is < this 00000659 00148 stickBat equ 1500+125 ; Position B is > this 00149 00150 ; GPIO register bits and other constants 00000001 00151 inrxraw equ 1 ; Active high servo input signal 00000002 00152 outrxinv equ 2 ; Active low receiver output (inverted inrxraw) 00000004 00153 inrxbit equ 4 ; Active low rx input always on GP4 00000003 00154 videoswitch equ 3 ; Video mode command switch on GP3 00000000 00155 outservo equ 0 ; Servo drive for shutter operation 00000005 00156 outled equ 5 ; LED drive for flashing signals MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 4 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00157 00158 ; Timer 0 operates at 2kHz rate for timing purposes 000007D0 00159 T0rate equ 2000 ; 2000 interrupts per second 000000FA 00160 T0cnt equ ((1000000+T0rate/2) / T0rate + 1)/2 00161 00162 00163 ; EEPROM Data offsets 00164 cblock 0 00000000 00165 eep_sidle:3 ; Servo Idle Position and check digit 00000003 00166 eep_sfocus:3 ; Servo Focus Position and check digit 00000006 00167 eep_sshutter:3 ; Servo Shutter Position and check digit 00168 00000009 00169 eep_tfocus:2 ; Focus time 0000000B 00170 eep_tshutter:2 ; Shutter time 0000000D 00171 eep_tpost:2 ; Post shutter tim 0000000F 00172 eep_tkalive:2 ; Keep alive time 00173 00000011 00174 eep_iidle:3 ; Input Idle Position 00000014 00175 eep_ishutter:3 ; Input Shutter Position 00000017 00176 eep_ipoweroff:3 ; Input Power off Position 00177 0000001A 00178 eep_tpoweroff:2 ; Power off time 00179 00180 endc 00181 00182 ; Initialise the EEDATA if we are a configurable version 00183 if !FIXED 00184 eedata16 macro eep, val 00185 org 2100h+eep 00186 de low val 00187 de high val 00188 de (low val) ^ (high val) 00189 endm 00190 eedata8 macro eep, val 00191 org 2100h+eep 00192 de val 00193 de ~val 00194 endm 00195 00196 eedata16 eep_sidle, ini_servoidle 2100 M org 2100h+eep_sidle 2100 00DC M de low ini_servoidle 2101 0005 M de high ini_servoidle 2102 00D9 M de (low ini_servoidle) ^ (high ini_servoidle) 00197 eedata16 eep_sfocus, ini_servofocus 2103 M org 2100h+eep_sfocus 2103 00DC M de low ini_servofocus 2104 0005 M de high ini_servofocus 2105 00D9 M de (low ini_servofocus) ^ (high ini_servofocus) 00198 eedata16 eep_sshutter, ini_servoshutter 2106 M org 2100h+eep_sshutter 2106 00D6 M de low ini_servoshutter 2107 0006 M de high ini_servoshutter MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 5 LOC OBJECT CODE LINE SOURCE TEXT VALUE 2108 00D0 M de (low ini_servoshutter) ^ (high ini_servoshutter) 00199 00200 eedata8 eep_tfocus, ini_timefocus 2109 M org 2100h+eep_tfocus 2109 0000 M de ini_timefocus 210A 00FF M de ~ini_timefocus 00201 eedata8 eep_tshutter, ini_timeshutter 210B M org 2100h+eep_tshutter 210B 0005 M de ini_timeshutter 210C 00FA M de ~ini_timeshutter 00202 eedata8 eep_tpost, ini_timepost 210D M org 2100h+eep_tpost 210D 000A M de ini_timepost 210E 00F5 M de ~ini_timepost 00203 eedata8 eep_tkalive, ini_timekalive 210F M org 2100h+eep_tkalive 210F 0037 M de ini_timekalive 2110 00C8 M de ~ini_timekalive 00204 00205 eedata16 eep_iidle, ini_inputidle 2111 M org 2100h+eep_iidle 2111 00DC M de low ini_inputidle 2112 0005 M de high ini_inputidle 2113 00D9 M de (low ini_inputidle) ^ (high ini_inputidle) 00206 eedata16 eep_ishutter, ini_inputshutter 2114 M org 2100h+eep_ishutter 2114 0008 M de low ini_inputshutter 2115 0007 M de high ini_inputshutter 2116 000F M de (low ini_inputshutter) ^ (high ini_inputshutter) 00207 eedata16 eep_ipoweroff, ini_inputpoweroff 2117 M org 2100h+eep_ipoweroff 2117 00B0 M de low ini_inputpoweroff 2118 0004 M de high ini_inputpoweroff 2119 00B4 M de (low ini_inputpoweroff) ^ (high ini_inputpoweroff) 00208 00209 eedata8 eep_tpoweroff, ini_timepoweroff 211A M org 2100h+eep_tpoweroff 211A 000A M de ini_timepoweroff 211B 00F5 M de ~ini_timepoweroff 00210 endif 00211 00212 ; RAM Definitions 00213 cblock 20h 00000020 00214 w_save ; Int save: !! Both banks used !! 00000021 00215 sts_save ; 00216 00000022 00217 int_p1sec ; Used for 0.1sec timing by interrupts 00000023 00218 int_1sec ; Used for 1sec timing by interrupt 00219 00220 ; ---- These are the working copies of 00221 ; the EEPROM data. In addition enough 00222 ; bits are maintained for the status 00223 ; on the configuration variables. MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 6 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00224 00000024 00225 cfg_faultyA ; Faulty config items 00000025 00226 cfg_faultyB 00227 00000026 00228 cfg_servoidleL ; Servo idle position 00000027 00229 cfg_servoidleH 00000028 00230 cfg_servofocusL ; Servo focus position 00000029 00231 cfg_servofocusH 0000002A 00232 cfg_servoshutterL ; Servo shutter position 0000002B 00233 cfg_servoshutterH 00234 0000002C 00235 cfg_timefocus ; Time for focuusing 0000002D 00236 cfg_timeshutter ; Time for the shutter 0000002E 00237 cfg_timepost ; Time post shutter 0000002F 00238 cfg_timekalive ; Camera keep-alive time 00239 00000030 00240 cfg_inputidleL ; Input position for idle 00000031 00241 cfg_inputidleH 00000032 00242 cfg_inputshutterL ; Input position for shutter 00000033 00243 cfg_inputshutterH 00000034 00244 cfg_inputpoweroffL ; Input position for power off 00000035 00245 cfg_inputpoweroffH 00246 00000036 00247 cfg_timepoweroff ; Time to power off 00248 00249 ; ---- Status information 00000037 00250 istatus ; Input signal status information (is_*) 00000038 00251 rxstatus ; Radio Control input status 00252 00000039 00253 gpioout ; Current GPIO output values 00254 0000003A 00255 trigger_icnt ; Trigger operation counter... (0.1sec) 0000003B 00256 kalive_icnt ; Keep alive counter (1sec) 00257 endc 00258 00259 ; Possible istatus bits 00000000 00260 is_programmode equ 0 ; Program mode selected on power up 00000001 00261 is_idlelt equ 1 ; Idle is when input LT cfg_inputidle:16 00000002 00262 is_powerofflt equ 2 ; Poweroff is when input LT cfg_inputpoweroff:16 00000003 00263 is_nokeepalive equ 3 ; Keepalive has been turned off 00000004 00264 is_wnoshutter equ 4 ; Wait for the no shutter state 00000005 00265 is_videoon equ 5 ; We think the camera is running in video 00000006 00266 is_doubleka equ 6 ; Double keep-alive for video mode 00267 00268 ; Possible rxstatus bits 00000000 00269 rx_timeout equ 0 ; Frame timeout in RX signal 00000001 00270 rx_rshutter equ 1 ; Signal is in shutter position now 00000002 00271 rx_rpoweroff equ 2 ; Signal is in poweroff position now 00000003 00272 rx_flos equ 3 ; Signal is filtered in LOS 00000004 00273 rx_fshutter equ 4 ; Signal is filtered in shutter posn 00000005 00274 rx_fpoweroff equ 5 ; Signal is filtered in power off posn 00275 00276 ; MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 7 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00277 ; Reset vector 0000 00278 org 0000h 0000 2838 00279 goto start 00280 00281 ; 00282 ; Interupt vector 00283 ; 00284 ; The interrupt routine. Monitors the passage of time... 0004 00285 org 0004h 00286 ; Save the state (see page 64 of PIC12F675 data) 0004 00A0 00287 movwf w_save ; Save W register 0005 0E03 00288 swapf STATUS,W ; Save status (don't touch flags) 0006 1283 00289 banksel sts_save ; Back to bank 0 0007 00A1 00290 movwf sts_save 00291 00292 ; Clear the timer interrupt, and reload counter. Use addition 00293 ; to preserve interrupt rate even if interrupts are off for a while 0008 3006 00294 movlw -T0cnt 0009 0781 00295 addwf TMR0,F 000A 110B 00296 bcf INTCON, T0IF 00297 00298 ; Now perform the processing of the interrupt 00299 ; - Timer for LED flashing 000B 03C8 00300 decf flash_icnt,F ; LED flash timer 00301 ; - Timer for receiver frame rate and LOS 000C 0BC0 00302 decfsz rxfrmtL,F ; frame monitor timer 000D 280F 00303 goto srvtmr1 000E 03C1 00304 decf rxfrmtH,F 000F 00305 srvtmr1 00306 ; - Timers based on 0.1sec increments 000F 0BA2 00307 decfsz int_p1sec,F 0010 2820 00308 goto exitint ; Not a 0.1 sec boundary yet 0011 30C8 00309 movlw T0rate / 10 0012 00A2 00310 movwf int_p1sec ; Reinitialise for 10 Hz rate 00311 ; - - The shutter drive counter (in 0.1sec) 0013 083A 00312 movfw trigger_icnt 0014 1D03 00313 btfss STATUS,Z 0015 03BA 00314 decf trigger_icnt,F 00315 00316 ; - Timers based on 1sec increments 0016 0BA3 00317 decfsz int_1sec,F 0017 2820 00318 goto exitint ; Not a 1 sec boundary yet 0018 300A 00319 movlw 10 0019 00A3 00320 movwf int_1sec ; Reinitialise for 1Hz rate 00321 ; - - The power off counter (in seconds) 001A 083F 00322 movfw powerofficnt 001B 1D03 00323 btfss STATUS,Z 001C 03BF 00324 decf powerofficnt,F 00325 ; - - Keep alive counter (in seconds) 001D 083B 00326 movfw kalive_icnt 001E 1D03 00327 btfss STATUS,Z 001F 03BB 00328 decf kalive_icnt,F 00329 MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 8 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00330 ; All done, restore status 0020 00331 exitint 0020 0E21 00332 swapf sts_save,w 0021 0083 00333 movwf STATUS 0022 0EA0 00334 swapf w_save,f 0023 0E20 00335 swapf w_save,w 0024 0009 00336 retfie 00337 00338 ; Record the information we need, we want this to appear in ic_prog on an 00339 ; 8 word boundary so that it is clearly visible 00340 ; The source version information, and the circuit type 00341 while ($ & 7) != 0 0025 3420 00342 dt " " 0026 3420 00342 dt " " 0027 3420 00342 dt " " 00343 endw 0028 3473 3473 3477 00344 dt "ssw.asm" ; Source information 342E 3461 3473 346D 00345 while ($ & 7) != 0 002F 3420 00346 dt " " 00347 endw 0030 3456 3431 342E 00348 dt "V1.6" ; Source information 3436 00349 while ($ & 7) != 0 0034 3420 00350 dt " " 0035 3420 00350 dt " " 0036 3420 00350 dt " " 0037 3420 00350 dt " " 00351 endw 00352 00353 ; -------------------------- Main code ---------------------- 00354 00355 ; 00356 ; Chip reset, or similar, operation. 0038 00357 start 00358 ; Calibrate the internal oscilator 0038 1683 00359 banksel OSCCAL 0039 23FF 00360 call 3FFh 003A 0090 00361 movwf OSCCAL 003B 1283 00362 banksel GPIO 00363 00364 ; Default to output driven low when enabled 003C 0185 00365 clrf GPIO 00366 00367 ; Configure the analog input bits, and the comparator that 00368 ; is used as an inverter, so that the control signal can control TMR1 00369 ; Note: don't configure WPU on inrxbit as this will cause unreliable 00370 ; input pulse detection due to the 4k7 resistor between COUT and the 00371 ; !T1G input. 003D 1683 00372 banksel ANSEL 003E 3032 00373 movlw 00110000b | (1<= 2.303 msec signal pulse is faulty 0132 020F 00786 subwf TMR1H,W 0133 1803 00787 btfsc STATUS,C 0134 293D 00788 goto toolong 0135 1E05 00789 btfss GPIO,inrxbit 0136 292E 00790 goto whileon 00791 00792 ; Stop timer so we can convert things 0137 0190 00793 clrf T1CON 00794 00795 ; Now the pulse has ended and we are ready to consider the outcome of this... 00796 ; First drop pulses that are too small to be valid, these must be an error... 0138 3003 00797 movlw 3 0139 020F 00798 subwf TMR1H,W MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 17 LOC OBJECT CODE LINE SOURCE TEXT VALUE 013A 1C03 00799 btfss STATUS,C 013B 2923 00800 goto apulselp ; < 0.768msec 013C 0008 00801 return 00802 00803 ; A pulse > 2.560msec is present, wait for it to end and ignore it 013D 00804 toolong 013D 2143 00805 call checktime 013E 1838 00806 btfsc rxstatus,rx_timeout 013F 0008 00807 return 0140 1E05 00808 btfss GPIO,inrxbit 0141 293D 00809 goto toolong 0142 2923 00810 goto apulselp 00811 00812 ; Watch for timeout, this routine is called about once every 12 cycles, 00813 ; and checks the frame counter timeout decremented in the ISR. 00814 ; The watchdog is cleared so that if the PIC doesn't get back to 00815 ; processing the next receiver pulse in 18msec the chip resets... 00816 ; 0143 00817 checktime 0143 0064 00818 clrwdt ; track software is working... 0144 1BC1 00819 btfsc rxfrmtH,7 0145 1438 00820 bsf rxstatus,rx_timeout ; Flag end of time 0146 0008 00821 return 00822 00823 ; 00824 ; --------------- Supply fixed parameters -------------------- 00825 if FIXED 00826 recall 00827 movlw low fix_servoidle 00828 movwf cfg_servoidleL 00829 movlw high fix_servoidle 00830 movwf cfg_servoidleH 00831 00832 movlw low fix_servofocus 00833 movwf cfg_servofocusL 00834 movlw high fix_servofocus 00835 movwf cfg_servofocusH 00836 00837 movlw low fix_servoshutter 00838 movwf cfg_servoshutterL 00839 movlw high fix_servoshutter 00840 movwf cfg_servoshutterH 00841 00842 movlw fix_timefocus 00843 movwf cfg_timefocus 00844 00845 movlw fix_timeshutter 00846 movwf cfg_timeshutter 00847 00848 movlw fix_timepost 00849 movwf cfg_timepost 00850 00851 movlw fix_timekalive MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 18 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00852 movwf cfg_timekalive 00853 00854 movlw low fix_inputidle 00855 movwf cfg_inputidleL 00856 movlw high fix_inputidle 00857 movwf cfg_inputidleH 00858 00859 movlw low fix_inputshutter 00860 movwf cfg_inputshutterL 00861 movlw high fix_inputshutter 00862 movwf cfg_inputshutterH 00863 00864 movlw low fix_inputpoweroff 00865 movwf cfg_inputpoweroffL 00866 movlw high fix_inputpoweroff 00867 movwf cfg_inputpoweroffH 00868 00869 movlw fix_timepoweroff 00870 movwf cfg_timepoweroff 00871 return 00872 00873 endif 00874 ; 00875 ; --------------- Manage the operation of the EEPROM ------------- 00876 ; 00877 if !FIXED 00878 cblock 00000042 00879 eep_rom ; ROM address 00880 endc 00881 00882 markflt macro id 00883 if id <= 8 00884 bsf cfg_faultyA, id-1 00885 else 00886 bsf cfg_faultyB, id-9 00887 endif 00888 endm 00889 00890 read_16bit macro id, rom, ram 00891 movlw ram 00892 movwf FSR 00893 movlw rom 00894 call read_ees16 00895 btfss STATUS,Z 00896 markflt id 00897 endm 00898 00899 read_8bit macro id, rom, ram 00900 movlw ram 00901 movwf FSR 00902 movlw rom 00903 call read_ee8 00904 btfss STATUS,Z MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 19 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00905 markflt id 00906 endm 00907 00908 write_16bit macro id, rom, ram 00909 movlw ram 00910 movwf FSR 00911 movlw rom 00912 call write_ee16 00913 endm 00914 00915 write_8bit macro id, rom, ram 00916 movlw ram 00917 movwf FSR 00918 movlw rom 00919 call write_ee8 00920 endm 00921 00922 ; Recall all the EEPROM data and perform the data integrity 00923 ; checks on what is in the EEPROM 0147 00924 recall 00925 ; Parameter 1: Servo Idle Position 00926 read_16bit 1, eep_sidle, cfg_servoidleL 0147 3026 M movlw cfg_servoidleL 0148 0084 M movwf FSR 0149 3000 M movlw eep_sidle 014A 2196 M call read_ees16 014B 1D03 M btfss STATUS,Z M markflt 1 M if 1 <= 8 014C 1424 M bsf cfg_faultyA, 1-1 M else M bsf cfg_faultyB, 1-9 M endif 00927 ; Parameter 2: Servo Focus Position 00928 read_16bit 2, eep_sfocus, cfg_servofocusL 014D 3028 M movlw cfg_servofocusL 014E 0084 M movwf FSR 014F 3003 M movlw eep_sfocus 0150 2196 M call read_ees16 0151 1D03 M btfss STATUS,Z M markflt 2 M if 2 <= 8 0152 14A4 M bsf cfg_faultyA, 2-1 M else M bsf cfg_faultyB, 2-9 M endif 00929 ; Parameter 3: Servo Shutter Position 00930 read_16bit 3, eep_sshutter, cfg_servoshutterL 0153 302A M movlw cfg_servoshutterL 0154 0084 M movwf FSR 0155 3006 M movlw eep_sshutter 0156 2196 M call read_ees16 0157 1D03 M btfss STATUS,Z MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 20 LOC OBJECT CODE LINE SOURCE TEXT VALUE M markflt 3 M if 3 <= 8 0158 1524 M bsf cfg_faultyA, 3-1 M else M bsf cfg_faultyB, 3-9 M endif 00931 ; Parameter 4: Focus time 00932 read_8bit 4, eep_tfocus, cfg_timefocus 0159 302C M movlw cfg_timefocus 015A 0084 M movwf FSR 015B 3009 M movlw eep_tfocus 015C 218A M call read_ee8 015D 1D03 M btfss STATUS,Z M markflt 4 M if 4 <= 8 015E 15A4 M bsf cfg_faultyA, 4-1 M else M bsf cfg_faultyB, 4-9 M endif 00933 ; Parameter 5: Shutter time 00934 read_8bit 5, eep_tshutter, cfg_timeshutter 015F 302D M movlw cfg_timeshutter 0160 0084 M movwf FSR 0161 300B M movlw eep_tshutter 0162 218A M call read_ee8 0163 1D03 M btfss STATUS,Z M markflt 5 M if 5 <= 8 0164 1624 M bsf cfg_faultyA, 5-1 M else M bsf cfg_faultyB, 5-9 M endif 00935 ; Parameter 6: Post shutter time 00936 read_8bit 6, eep_tpost, cfg_timepost 0165 302E M movlw cfg_timepost 0166 0084 M movwf FSR 0167 300D M movlw eep_tpost 0168 218A M call read_ee8 0169 1D03 M btfss STATUS,Z M markflt 6 M if 6 <= 8 016A 16A4 M bsf cfg_faultyA, 6-1 M else M bsf cfg_faultyB, 6-9 M endif 00937 ; Parameter 7: Keep-alive 00938 read_8bit 7, eep_tkalive, cfg_timekalive 016B 302F M movlw cfg_timekalive 016C 0084 M movwf FSR 016D 300F M movlw eep_tkalive 016E 218A M call read_ee8 016F 1D03 M btfss STATUS,Z M markflt 7 MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 21 LOC OBJECT CODE LINE SOURCE TEXT VALUE M if 7 <= 8 0170 1724 M bsf cfg_faultyA, 7-1 M else M bsf cfg_faultyB, 7-9 M endif 00939 ; Parameter 8: Input position for idle 00940 read_16bit 8, eep_iidle, cfg_inputidleL 0171 3030 M movlw cfg_inputidleL 0172 0084 M movwf FSR 0173 3011 M movlw eep_iidle 0174 2196 M call read_ees16 0175 1D03 M btfss STATUS,Z M markflt 8 M if 8 <= 8 0176 17A4 M bsf cfg_faultyA, 8-1 M else M bsf cfg_faultyB, 8-9 M endif 00941 ; Parameter 9: Input position for shutter 00942 read_16bit 9, eep_ishutter, cfg_inputshutterL 0177 3032 M movlw cfg_inputshutterL 0178 0084 M movwf FSR 0179 3014 M movlw eep_ishutter 017A 2196 M call read_ees16 017B 1D03 M btfss STATUS,Z M markflt 9 M if 9 <= 8 M bsf cfg_faultyA, 9-1 M else 017C 1425 M bsf cfg_faultyB, 9-9 M endif 00943 ; Parameter 10: Input for power off 00944 read_16bit 10,eep_ipoweroff, cfg_inputpoweroffL 017D 3034 M movlw cfg_inputpoweroffL 017E 0084 M movwf FSR 017F 3017 M movlw eep_ipoweroff 0180 2196 M call read_ees16 0181 1D03 M btfss STATUS,Z M markflt 10 M if 10 <= 8 M bsf cfg_faultyA, 10-1 M else 0182 14A5 M bsf cfg_faultyB, 10-9 M endif 00945 ; Parameter 11: Time for power off 00946 read_8bit 11,eep_tpoweroff, cfg_timepoweroff 0183 3036 M movlw cfg_timepoweroff 0184 0084 M movwf FSR 0185 301A M movlw eep_tpoweroff 0186 218A M call read_ee8 0187 1D03 M btfss STATUS,Z M markflt 11 M if 11 <= 8 MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 22 LOC OBJECT CODE LINE SOURCE TEXT VALUE M bsf cfg_faultyA, 11-1 M else 0188 1525 M bsf cfg_faultyB, 11-9 M endif 0189 0008 00947 return 00948 00949 ; Read an 8-bit time value... 00950 ; FSR is the address to put it into 00951 ; W is the eeprom offset 00952 ; returns Z on OK, NZ on fail 018A 00953 read_ee8 018A 00C2 00954 movwf eep_rom 018B 21AB 00955 call read_eep 018C 0080 00956 movwf INDF 018D 0A42 00957 incf eep_rom,W 018E 21AB 00958 call read_eep 018F 0600 00959 xorwf INDF,W 0190 3AFF 00960 xorlw 0FFh 0191 1903 00961 btfsc STATUS,Z 0192 0008 00962 return 0193 0180 00963 clrf INDF ; Supply a default of zero 0194 1103 00964 bcf STATUS,Z ; force NZ status 0195 0008 00965 return 00966 00967 ; Read a 16-bit servo position... 00968 ; FSR is the address to put it into 00969 ; W is the eeprom offset 00970 ; returns Z on OK, NZ on fail 0196 00971 read_ees16 0196 00C2 00972 movwf eep_rom 0197 21AB 00973 call read_eep 0198 0080 00974 movwf INDF 0199 0A84 00975 incf FSR,F 019A 0AC2 00976 incf eep_rom,F 019B 0842 00977 movfw eep_rom 019C 21AB 00978 call read_eep 019D 0080 00979 movwf INDF 019E 0A42 00980 incf eep_rom,W 019F 21AB 00981 call read_eep 01A0 0600 00982 xorwf INDF,W 01A1 0384 00983 decf FSR,F 01A2 0600 00984 xorwf INDF,W 01A3 1903 00985 btfsc STATUS,Z 01A4 0008 00986 return 01A5 30DC 00987 movlw low 1500 ; Supply a default parameter 01A6 0080 00988 movwf INDF 01A7 0A84 00989 incf FSR,F ; Note: leaves status NZ for return 01A8 3005 00990 movlw high 1500 01A9 0080 00991 movwf INDF 01AA 0008 00992 return 00993 00994 ; Read the location in the W register into the W register 01AB 00995 read_eep MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 23 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01AB 1683 00996 banksel EEADR 01AC 009B 00997 movwf EEADR 01AD 141C 00998 bsf EECON1,RD 01AE 081A 00999 movfw EEDATA 01AF 1283 01000 banksel w_save 01B0 0008 01001 return 01002 01003 ; 01004 ; Write a 16 bit value with checksum to the storage 01005 ; FSR is the data address 01006 ; W is the EEPROM address 01B1 01007 write_ee16 01B1 00C2 01008 movwf eep_rom 01B2 21C9 01009 call write_eepa 01B3 0800 01010 movfw INDF 01B4 21CE 01011 call write_eepd 01B5 0AC2 01012 incf eep_rom,F 01B6 0A84 01013 incf FSR,F 01B7 0842 01014 movfw eep_rom 01B8 21C9 01015 call write_eepa 01B9 0800 01016 movfw INDF 01BA 21CE 01017 call write_eepd 01BB 0A42 01018 incf eep_rom,W 01BC 21C9 01019 call write_eepa 01BD 0800 01020 movfw INDF 01BE 0384 01021 decf FSR,F 01BF 0600 01022 xorwf INDF,W 01C0 29CE 01023 goto write_eepd 01024 01C1 01025 write_ee8 01C1 00C2 01026 movwf eep_rom 01C2 21C9 01027 call write_eepa 01C3 0800 01028 movfw INDF 01C4 21CE 01029 call write_eepd 01C5 0A42 01030 incf eep_rom,W 01C6 21C9 01031 call write_eepa 01C7 0900 01032 comf INDF,W 01C8 29CE 01033 goto write_eepd 01034 01035 ; Select the EEPROM address we are going to write to 01036 ; W is the address 01C9 01037 write_eepa 01C9 1683 01038 banksel EEADR 01CA 151C 01039 bsf EECON1,WREN 01CB 009B 01040 movwf EEADR 01CC 1283 01041 banksel w_save 01CD 0008 01042 return 01043 01044 ; Write the contents of W to the EEPROM, 01045 ; Z status -> written OK 01CE 01046 write_eepd 01CE 138B 01047 bcf INTCON,GIE 01CF 1683 01048 banksel EEDATA MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 24 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01D0 009A 01049 movwf EEDATA 01D1 3055 01050 movlw 55h 01D2 009D 01051 movwf EECON2 01D3 30AA 01052 movlw 0AAh 01D4 009D 01053 movwf EECON2 01D5 149C 01054 bsf EECON1,WR 01D6 1283 01055 banksel PIR1 01D7 01056 eepwlp 01D7 0064 01057 clrwdt 01D8 1F8C 01058 btfss PIR1,EEIF 01D9 29D7 01059 goto eepwlp 01DA 138C 01060 bcf PIR1,EEIF 01DB 1683 01061 banksel EEDATA 01DC 081A 01062 movfw EEDATA 01DD 111C 01063 bcf EECON1,WREN 01DE 141C 01064 bsf EECON1,RD 01DF 061A 01065 xorwf EEDATA,W 01E0 1283 01066 banksel w_save 01E1 178B 01067 bsf INTCON,GIE 01E2 0008 01068 return 01069 endif 01070 ; 01071 ; -------- Output servo drive ------------ 01072 ; 01073 cblock 00000043 01074 servoL ; Desired servo position in usec 00000044 01075 servoH 01076 endc 01077 01078 01079 if SERVOOUT 01080 ; Pulse the output servo pin high for the currently selected servo 01081 ; position. This uses timer 1 in manual count mode to perform the 01082 ; best timing we can with timer 0 in use for interrupts. 01083 ; Interrupts are disabled for at most 128 usec. 01084 ; Note that the output pulse will be a small number of usec greater 01085 ; than the select input value. However, this doesn't matter because it 01086 ; can be adjusted out via the adjustment stuff anyway. 01087 driveservo 01088 bcf INTCON,GIE ; Disable interrupts while we start timer 01089 ; Enable Timer 1 for counting 01090 clrf T1CON ; Ensure the timer is not counting 01091 comf servoL,W ; Initialise the register with -servo position 01092 movwf TMR1L ; no need to add 1 +/1 1usec can be adjusted 01093 comf servoH,W 01094 movwf TMR1H 01095 ; Turn on the servo output 01096 movfw gpioout 01097 iorlw 1< 3 mod 4 TCY 01117 ; 1 -> 2 mod 4 TCY 01118 ; 2 -> 1 mod 4 TCY 01119 ; 3 -> 0 mod 4 TCY 01120 movfw TMR1L 01121 andlw 03h ; find out where we are in the cycle mod 4 Tcy 01122 btfsc STATUS,Z 01123 goto ds_w3 ; 0 -> 3 TCY 01124 addlw -1 01125 btfsc STATUS,Z 01126 goto ds_w3 ; 1 -> 6 TCY (2 mod 4) 01127 addlw -1 01128 btfsc STATUS,Z 01129 goto ds_w3 ; 2 -> 9 TCY (1 mod 4) 01130 ; FALLTHROUGH ; 3 -> 8 TCY (0 mod 4) 01131 goto $+1 01132 goto $+1 01133 ds_w3 01134 nop ; force this loop to 4 Tcy in length 01135 btfsc TMR1H,7 01136 goto ds_w3 01137 ; Clobber output 01138 movfw gpioout 01139 movwf GPIO 01140 ; Enable interrupts 01141 bsf INTCON,GIE 01142 ; Disable timer 1 01143 clrf T1CON 01144 cameratoggle 01145 return 01146 01147 else 01148 ; 01149 ; Copy the GPIO status to the output pins 01E3 01150 driveservo 01E3 0839 01151 movfw gpioout 01E4 0085 01152 movwf GPIO 01E5 0008 01153 return 01154 MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 26 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01155 ; 01156 ; Toggle the camera output 01E6 01157 cameratoggle 01E6 1683 01158 banksel TRISIO 01E7 3001 01159 movlw 1<= 0x300 02B2 3C02 01490 sublw 2 02B3 1C03 01491 btfss STATUS,C 02B4 2A9D 01492 goto prg_eos1 ; All ok 02B5 2AA5 01493 goto prg_eosB ; Add one count back 01494 01495 ; User has signaled that the edit is complete, 01496 ; save the current output servo position in FLASH 02B6 01497 prg_oservodone 02B6 0844 01498 movfw servoH ; Copy the servo:16 value back to correct place 02B7 0080 01499 movwf INDF 02B8 0384 01500 decf FSR,F 02B9 0843 01501 movfw servoL 02BA 0080 01502 movwf INDF 02BB 0826 01503 movfw cfg_servoidleL ; Restore servo to idle position 02BC 00C3 01504 movwf servoL 02BD 0827 01505 movfw cfg_servoidleH 02BE 00C4 01506 movwf servoH 02BF 2AD2 01507 goto prg_editok 01508 01509 ; 01510 ; Input servo edit just allows you to position the control stick 01511 ; in the appropriate place 02C0 01512 prg_editiservo 01513 flashon 0 02C0 3000 M movlw 0 * 5 02C1 00C9 M movwf flash_cnt 02C2 16B9 M bsf gpioout,outled 02C3 1045 M bcf pstatus,ps_flshdone 02C4 01514 prg_eis1 02C4 222D 01515 call iflasher 02C5 1D85 01516 btfss GPIO,videoswitch 02C6 2AC8 01517 goto prg_iservodone 02C7 2AC4 01518 goto prg_eis1 01519 01520 ; Save the input position 02C8 01521 prg_iservodone 02C8 1838 01522 btfsc rxstatus, rx_timeout 02C9 2AD2 01523 goto prg_editok 02CA 080E 01524 movfw TMR1L ; Copy the TMR1:16 value back to correct place 02CB 0080 01525 movwf INDF 02CC 0A84 01526 incf FSR,F 02CD 080F 01527 movfw TMR1H 02CE 0080 01528 movwf INDF MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 34 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02CF 2AD2 01529 goto prg_editok 01530 01531 ; 01532 ; Numeric entry flashes the current number and then uses 01533 ; fstickA to decrement the number and fstickB to increment the number 02D0 01534 prg_editnumber 02D0 3063 01535 movlw 99 02D1 22D8 01536 call prg_getnumber 01537 ; Save the number we have been editing 02D2 01538 prg_editok 01539 ledoff ; Turn off the LED 02D2 12B9 M bcf gpioout,outled 02D3 0839 M movfw gpioout 02D4 0085 M movwf GPIO 02D5 2364 01540 call prg_editdone ; Complete and save data 02D6 2252 01541 call prg_videowait ; Wait for jumper to be removed 02D7 2A87 01542 goto prg_mainlp ; All done 01543 01544 ; 01545 ; Edit the value pointed to by FSR as an integer. 01546 ; Permitted values are 0 .. W 01547 cblock 0000004E 01548 prg_gnlimit ; Maximum permitted value 0000004F 01549 prg_gnten ; Number of tens 00000050 01550 prg_gnone ; Number of ones 00000051 01551 gnstatus ; status of this routine 01552 endc 01553 00000000 01554 gn_ipause equ 0 ; We have done the initial pause 00000001 01555 gn_tendigit equ 1 ; Shown tens 00000002 01556 gn_tenpause equ 2 ; Done inter-digit pause 01557 02D8 01558 prg_getnumber 01559 ; Remember the limit 02D8 00CE 01560 movwf prg_gnlimit 02D9 01561 prg_gnloop 02D9 01D1 01562 clrf gnstatus 01563 ; Divide into the 10s and the 1s.... 02DA 01CF 01564 clrf prg_gnten 02DB 01D0 01565 clrf prg_gnone 02DC 0800 01566 movfw INDF 02DD 1903 01567 btfsc STATUS,Z 02DE 2AE9 01568 goto prg_gnnext ; Special case for zero... 01569 ; We need to count it out... 02DF 00CD 01570 movwf prg_count 02E0 01571 prg_gnlp1 02E0 0AD0 01572 incf prg_gnone,F 02E1 0850 01573 movfw prg_gnone 02E2 3A0A 01574 xorlw 10 02E3 1D03 01575 btfss STATUS,Z 02E4 2AE7 01576 goto prg_gnlp2 02E5 0ACF 01577 incf prg_gnten,F 02E6 01D0 01578 clrf prg_gnone MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 35 LOC OBJECT CODE LINE SOURCE TEXT VALUE 02E7 01579 prg_gnlp2 02E7 0BCD 01580 decfsz prg_count,F 02E8 2AE0 01581 goto prg_gnlp1 02E9 01582 prg_gnnext 01583 ; Decide what to do next 02E9 1851 01584 btfsc gnstatus, gn_ipause 02EA 2AF3 01585 goto prg_gn_ipause 01586 ; perform the initial pause 02EB 1451 01587 bsf gnstatus, gn_ipause 01588 flashof 10 02EC 3032 M movlw 10 * 5 02ED 00C9 M movwf flash_cnt 02EE 12B9 M bcf gpioout,outled 02EF 1045 M bcf pstatus,ps_flshdone 02F0 01589 prg_gn_1flash 02F0 3001 01590 movlw 1 02F1 00CD 01591 movwf prg_count 02F2 2B11 01592 goto prg_gnflash 02F3 01593 prg_gn_ipause 02F3 18D1 01594 btfsc gnstatus, gn_tendigit 02F4 2B00 01595 goto prg_gn_tendigit 01596 ; display the tens digit 02F5 14D1 01597 bsf gnstatus, gn_tendigit 02F6 084F 01598 movfw prg_gnten 02F7 1903 01599 btfsc STATUS,Z 02F8 2B08 01600 goto prg_gn_tenpause 02F9 01601 prg_gn_adigit 02F9 00CD 01602 movwf prg_count 02FA 07CD 01603 addwf prg_count,F 01604 flashon 2 02FB 300A M movlw 2 * 5 02FC 00C9 M movwf flash_cnt 02FD 16B9 M bsf gpioout,outled 02FE 1045 M bcf pstatus,ps_flshdone 02FF 2B11 01605 goto prg_gnflash 0300 01606 prg_gn_tendigit 0300 1951 01607 btfsc gnstatus, gn_tenpause 0301 2B08 01608 goto prg_gn_tenpause 01609 ; Display the tens pause 0302 1551 01610 bsf gnstatus, gn_tenpause 01611 flashof 6 0303 301E M movlw 6 * 5 0304 00C9 M movwf flash_cnt 0305 12B9 M bcf gpioout,outled 0306 1045 M bcf pstatus,ps_flshdone 0307 2AF0 01612 goto prg_gn_1flash 0308 01613 prg_gn_tenpause 0308 01D1 01614 clrf gnstatus ; The next thing is to pause and start again 01615 ; Display the number of ones 0309 0850 01616 movfw prg_gnone 030A 1D03 01617 btfss STATUS,Z 030B 2AF9 01618 goto prg_gn_adigit 01619 ; Display zero MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 36 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01620 flashon 6 030C 301E M movlw 6 * 5 030D 00C9 M movwf flash_cnt 030E 16B9 M bsf gpioout,outled 030F 1045 M bcf pstatus,ps_flshdone 0310 2AF0 01621 goto prg_gn_1flash 0311 01622 prg_gnflash 0311 222D 01623 call iflasher 0312 1D85 01624 btfss GPIO,videoswitch 0313 0008 01625 return 0314 1A45 01626 btfsc pstatus,ps_fstickA 0315 2B29 01627 goto prg_gnfA 0316 1B45 01628 btfsc pstatus,ps_fstickB 0317 2B30 01629 goto prg_gnfB 0318 1C45 01630 btfss pstatus,ps_flshdone 0319 2B11 01631 goto prg_gnflash 01632 ; Done the flash 031A 03CD 01633 decf prg_count,F 031B 1903 01634 btfsc STATUS,Z 031C 2AE9 01635 goto prg_gnnext 01636 ; Do the next bit... 031D 1AB9 01637 btfsc gpioout,outled 031E 2B24 01638 goto prg_gnfoff 01639 flashon 2 031F 300A M movlw 2 * 5 0320 00C9 M movwf flash_cnt 0321 16B9 M bsf gpioout,outled 0322 1045 M bcf pstatus,ps_flshdone 0323 2B11 01640 goto prg_gnflash 0324 01641 prg_gnfoff 01642 flashof 2 0324 300A M movlw 2 * 5 0325 00C9 M movwf flash_cnt 0326 12B9 M bcf gpioout,outled 0327 1045 M bcf pstatus,ps_flshdone 0328 2B11 01643 goto prg_gnflash 01644 01645 ; Stick A in decrements the config item number 0329 01646 prg_gnfA 0329 0380 01647 decf INDF,F 032A 0900 01648 comf INDF,W 032B 1D03 01649 btfss STATUS,Z 032C 2B35 01650 goto prg_gnfAB 032D 084E 01651 movfw prg_gnlimit 032E 0080 01652 movwf INDF 032F 2B35 01653 goto prg_gnfAB 01654 ; Stick B in increments the config item number 0330 01655 prg_gnfB 0330 0A80 01656 incf INDF,F 0331 0800 01657 movfw INDF 0332 024E 01658 subwf prg_gnlimit,W 0333 1C03 01659 btfss STATUS,C 0334 0180 01660 clrf INDF MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 37 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0335 01661 prg_gnfAB 0335 226C 01662 call prg_centrewait 0336 2AD9 01663 goto prg_gnloop 01664 01665 ; Force this code into the last page so 01666 ; that all the computed gotos will function 01667 if $ < 0300h 01668 org 0300h 01669 endif 01670 01671 ; 01672 ; Initialise for the start of editing 0337 01673 prg_editsetup 0337 01C6 01674 clrf estatus ; Zap edit status 0338 3003 01675 movlw high prg_editsetup 0339 008A 01676 movwf PCLATH 033A 084C 01677 movfw prg_itemno 033B 0782 01678 addwf PCL,F 033C 28CB 01679 goto emptyreturn ; 0 - do nothing... 033D 2B48 01680 goto prg_es1 ; 1 033E 2B4C 01681 goto prg_es2 ; 2 033F 2B4E 01682 goto prg_es3 ; 3 0340 2B50 01683 goto prg_es4 ; 4 0341 2B54 01684 goto prg_es5 ; 5 0342 2B56 01685 goto prg_es6 ; 6 0343 2B58 01686 goto prg_es7 ; 7 0344 2B5A 01687 goto prg_es8 ; 8 0345 2B5E 01688 goto prg_es9 ; 9 0346 2B60 01689 goto prg_es10 ; 10 0347 2B62 01690 goto prg_es11 ; 11 01691 ; parameter 1 0348 01692 prg_es1 0348 3026 01693 movlw cfg_servoidleL 0349 01694 prg_esosrvo 0349 0084 01695 movwf FSR ; Remember where this came from... 034A 14C6 01696 bsf estatus,es_editoservo 034B 0008 01697 return 01698 ; Setup parameter 2 034C 01699 prg_es2 034C 3028 01700 movlw cfg_servofocusL 034D 2B49 01701 goto prg_esosrvo 01702 ; Setup paramater 3 034E 01703 prg_es3 034E 302A 01704 movlw cfg_servoshutterL 034F 2B49 01705 goto prg_esosrvo 01706 01707 ; Setup parameter 4 0350 01708 prg_es4 0350 302C 01709 movlw cfg_timefocus 0351 01710 prg_esnumber 0351 0084 01711 movwf FSR 0352 1446 01712 bsf estatus,es_editnumber 0353 0008 01713 return MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 38 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01714 01715 ; Setup parameter 5 0354 01716 prg_es5 0354 302D 01717 movlw cfg_timeshutter 0355 2B51 01718 goto prg_esnumber 01719 01720 ; Setup parameter 6 0356 01721 prg_es6 0356 302E 01722 movlw cfg_timepost 0357 2B51 01723 goto prg_esnumber 01724 01725 ; Setup parameter 7 0358 01726 prg_es7 0358 302F 01727 movlw cfg_timekalive 0359 2B51 01728 goto prg_esnumber 01729 01730 ; Setup parameter 8 035A 01731 prg_es8 035A 3030 01732 movlw cfg_inputidleL 035B 01733 prg_esiservo 035B 0084 01734 movwf FSR 035C 1546 01735 bsf estatus,es_editiservo 035D 0008 01736 return 01737 ; Setup parameter 9 035E 01738 prg_es9 035E 3032 01739 movlw cfg_inputshutterL 035F 2B5B 01740 goto prg_esiservo 01741 ; Setup parameter 10 0360 01742 prg_es10 0360 3034 01743 movlw cfg_inputpoweroffL 0361 2B5B 01744 goto prg_esiservo 01745 01746 ; Setup parameter 11 0362 01747 prg_es11 0362 3036 01748 movlw cfg_timepoweroff 0363 2B51 01749 goto prg_esnumber 01750 01751 ; 01752 ; Completion of editing 0364 01753 prg_editdone 0364 034C 01754 decf prg_itemno,W 0365 0782 01755 addwf PCL,F 0366 2B71 01756 goto prg_ed1 ; 1 0367 2B76 01757 goto prg_ed2 ; 2 0368 2B7B 01758 goto prg_ed3 ; 3 0369 2B80 01759 goto prg_ed4 ; 4 036A 2B85 01760 goto prg_ed5 ; 5 036B 2B8A 01761 goto prg_ed6 ; 6 036C 2B8F 01762 goto prg_ed7 ; 7 036D 2B94 01763 goto prg_ed8 ; 8 036E 2B99 01764 goto prg_ed9 ; 9 036F 2B9E 01765 goto prg_ed10 ; 10 0370 2BA3 01766 goto prg_ed11 ; 11 MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 39 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01767 ; Save parameter 1 0371 01768 prg_ed1 01769 write_16bit 1, eep_sidle, cfg_servoidleL 0371 3026 M movlw cfg_servoidleL 0372 0084 M movwf FSR 0373 3000 M movlw eep_sidle 0374 21B1 M call write_ee16 0375 0008 01770 return 01771 ; Save parameter 2 0376 01772 prg_ed2 01773 write_16bit 2, eep_sfocus, cfg_servofocusL 0376 3028 M movlw cfg_servofocusL 0377 0084 M movwf FSR 0378 3003 M movlw eep_sfocus 0379 21B1 M call write_ee16 037A 0008 01774 return 01775 ; Save parameter 3 037B 01776 prg_ed3 01777 write_16bit 3, eep_sshutter, cfg_servoshutterL 037B 302A M movlw cfg_servoshutterL 037C 0084 M movwf FSR 037D 3006 M movlw eep_sshutter 037E 21B1 M call write_ee16 037F 0008 01778 return 01779 ; Save parameter 4 0380 01780 prg_ed4 01781 write_8bit 4, eep_tfocus, cfg_timefocus 0380 302C M movlw cfg_timefocus 0381 0084 M movwf FSR 0382 3009 M movlw eep_tfocus 0383 21C1 M call write_ee8 0384 0008 01782 return 01783 ; Save parameter 5 0385 01784 prg_ed5 01785 write_8bit 5, eep_tshutter, cfg_timeshutter 0385 302D M movlw cfg_timeshutter 0386 0084 M movwf FSR 0387 300B M movlw eep_tshutter 0388 21C1 M call write_ee8 0389 0008 01786 return 01787 ; Save parameter 6 038A 01788 prg_ed6 01789 write_8bit 6, eep_tpost, cfg_timepost 038A 302E M movlw cfg_timepost 038B 0084 M movwf FSR 038C 300D M movlw eep_tpost 038D 21C1 M call write_ee8 038E 0008 01790 return 01791 ; Save parameter 7 038F 01792 prg_ed7 01793 write_8bit 7, eep_tkalive, cfg_timekalive 038F 302F M movlw cfg_timekalive 0390 0084 M movwf FSR MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 40 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0391 300F M movlw eep_tkalive 0392 21C1 M call write_ee8 0393 0008 01794 return 01795 ; Save parameter 8 0394 01796 prg_ed8 01797 write_16bit 8, eep_iidle, cfg_inputidleL 0394 3030 M movlw cfg_inputidleL 0395 0084 M movwf FSR 0396 3011 M movlw eep_iidle 0397 21B1 M call write_ee16 0398 0008 01798 return 01799 ; Save parameter 9 0399 01800 prg_ed9 01801 write_16bit 9, eep_ishutter, cfg_inputshutterL 0399 3032 M movlw cfg_inputshutterL 039A 0084 M movwf FSR 039B 3014 M movlw eep_ishutter 039C 21B1 M call write_ee16 039D 0008 01802 return 01803 ; Save parameter 10 039E 01804 prg_ed10 01805 write_16bit 10,eep_ipoweroff, cfg_inputpoweroffL 039E 3034 M movlw cfg_inputpoweroffL 039F 0084 M movwf FSR 03A0 3017 M movlw eep_ipoweroff 03A1 21B1 M call write_ee16 03A2 0008 01806 return 01807 ; Save parameter 11 03A3 01808 prg_ed11 01809 write_8bit 11,eep_tpoweroff, cfg_timepoweroff 03A3 3036 M movlw cfg_timepoweroff 03A4 0084 M movwf FSR 03A5 301A M movlw eep_tpoweroff 03A6 21C1 M call write_ee8 03A7 0008 01810 return 01811 01812 ; 01813 ; -------- Fault configuration has occured ------- 01814 ; 01815 01816 ; The configuration is faulty, so flash the fault code 01817 ; this is a sequence of short/long flashes, short 01818 ; flashes for OK and long flashes for fault... 03A8 01819 flash_faulty 01820 ; Show the fault status for all known config items 00000001 01821 i = 1 01822 while i <= ncfgitems 01823 if i <= 8 03A8 3001 01824 movlw 1<<(i-1) 03A9 23C6 01825 call ffaultA 01826 else 01827 movlw 1<<(i-9) 01828 call ffaultB MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 41 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01829 endif 00000002 01830 i = i + 1 01823 if i <= 8 03AA 3002 01824 movlw 1<<(i-1) 03AB 23C6 01825 call ffaultA 01826 else 01827 movlw 1<<(i-9) 01828 call ffaultB 01829 endif 00000003 01830 i = i + 1 01823 if i <= 8 03AC 3004 01824 movlw 1<<(i-1) 03AD 23C6 01825 call ffaultA 01826 else 01827 movlw 1<<(i-9) 01828 call ffaultB 01829 endif 00000004 01830 i = i + 1 01823 if i <= 8 03AE 3008 01824 movlw 1<<(i-1) 03AF 23C6 01825 call ffaultA 01826 else 01827 movlw 1<<(i-9) 01828 call ffaultB 01829 endif 00000005 01830 i = i + 1 01823 if i <= 8 03B0 3010 01824 movlw 1<<(i-1) 03B1 23C6 01825 call ffaultA 01826 else 01827 movlw 1<<(i-9) 01828 call ffaultB 01829 endif 00000006 01830 i = i + 1 01823 if i <= 8 03B2 3020 01824 movlw 1<<(i-1) 03B3 23C6 01825 call ffaultA 01826 else 01827 movlw 1<<(i-9) 01828 call ffaultB 01829 endif 00000007 01830 i = i + 1 01823 if i <= 8 03B4 3040 01824 movlw 1<<(i-1) 03B5 23C6 01825 call ffaultA 01826 else 01827 movlw 1<<(i-9) 01828 call ffaultB 01829 endif 00000008 01830 i = i + 1 01823 if i <= 8 03B6 3080 01824 movlw 1<<(i-1) 03B7 23C6 01825 call ffaultA MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 42 LOC OBJECT CODE LINE SOURCE TEXT VALUE 01826 else 01827 movlw 1<<(i-9) 01828 call ffaultB 01829 endif 00000009 01830 i = i + 1 01823 if i <= 8 01824 movlw 1<<(i-1) 01825 call ffaultA 01826 else 03B8 3001 01827 movlw 1<<(i-9) 03B9 23C8 01828 call ffaultB 01829 endif 0000000A 01830 i = i + 1 01823 if i <= 8 01824 movlw 1<<(i-1) 01825 call ffaultA 01826 else 03BA 3002 01827 movlw 1<<(i-9) 03BB 23C8 01828 call ffaultB 01829 endif 0000000B 01830 i = i + 1 01823 if i <= 8 01824 movlw 1<<(i-1) 01825 call ffaultA 01826 else 03BC 3004 01827 movlw 1<<(i-9) 03BD 23C8 01828 call ffaultB 01829 endif 0000000C 01830 i = i + 1 01831 endw 01832 01833 flashof 12 ; Then a long delay 03BE 303C M movlw 12 * 5 03BF 00C9 M movwf flash_cnt 03C0 12B9 M bcf gpioout,outled 03C1 1045 M bcf pstatus,ps_flshdone 03C2 01834 fflt_l1 03C2 2223 01835 call flasher ; Update the LED flash, come back in ??msec 03C3 1C45 01836 btfss pstatus,ps_flshdone 03C4 2BC2 01837 goto fflt_l1 01838 03C5 2BA8 01839 goto flash_faulty ; And start again 01840 01841 ; Test the value in cfg_faultA 03C6 01842 ffaultA 03C6 0524 01843 andwf cfg_faultyA,W 03C7 2BC9 01844 goto ffault 03C8 01845 ffaultB 03C8 0525 01846 andwf cfg_faultyB,W 03C9 01847 ffault 03C9 1D03 01848 btfss STATUS,Z 03CA 2BD0 01849 goto faulty 01850 flashon 2 ; OK so a short flash MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 43 LOC OBJECT CODE LINE SOURCE TEXT VALUE 03CB 300A M movlw 2 * 5 03CC 00C9 M movwf flash_cnt 03CD 16B9 M bsf gpioout,outled 03CE 1045 M bcf pstatus,ps_flshdone 03CF 2BD4 01851 goto ffault1 03D0 01852 faulty 01853 flashon 6 03D0 301E M movlw 6 * 5 03D1 00C9 M movwf flash_cnt 03D2 16B9 M bsf gpioout,outled 03D3 1045 M bcf pstatus,ps_flshdone 03D4 01854 ffault1 03D4 2223 01855 call flasher 03D5 1C45 01856 btfss pstatus,ps_flshdone 03D6 2BD4 01857 goto ffault1 01858 flashof 2 ; And a pause 03D7 300A M movlw 2 * 5 03D8 00C9 M movwf flash_cnt 03D9 12B9 M bcf gpioout,outled 03DA 1045 M bcf pstatus,ps_flshdone 03DB 01859 ffault2 03DB 2223 01860 call flasher 03DC 1C45 01861 btfss pstatus,ps_flshdone 03DD 2BDB 01862 goto ffault2 03DE 0008 01863 return 01864 endif 01865 01866 end MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 44 SYMBOL TABLE LABEL VALUE ADCON0 0000001F ADCS0 00000004 ADCS1 00000005 ADCS2 00000006 ADFM 00000007 ADIE 00000006 ADIF 00000006 ADON 00000000 ADRESH 0000001E ADRESL 0000009E ANS0 00000000 ANS1 00000001 ANS2 00000002 ANS3 00000003 ANSEL 0000009F C 00000000 CAL0 00000002 CAL1 00000003 CAL2 00000004 CAL3 00000005 CAL4 00000006 CAL5 00000007 CHS0 00000002 CHS1 00000003 CINV 00000004 CIS 00000003 CM0 00000000 CM1 00000001 CM2 00000002 CMCON 00000019 CMIE 00000003 CMIF 00000003 COUT 00000006 DC 00000001 EEADR 0000009B EECON1 0000009C EECON2 0000009D EEDATA 0000009A EEIE 00000007 EEIF 00000007 F 00000001 FIXED 00000000 FSR 00000004 GIE 00000007 GO 00000001 GO_DONE 00000001 GP0 00000000 GP1 00000001 GP2 00000002 GP3 00000003 GP4 00000004 GP5 00000005 GPIE 00000003 MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 45 SYMBOL TABLE LABEL VALUE GPIF 00000000 GPIO 00000005 GPIO0 00000000 GPIO1 00000001 GPIO2 00000002 GPIO3 00000003 GPIO4 00000004 GPIO5 00000005 INDF 00000000 INTCON 0000000B INTE 00000004 INTEDG 00000006 INTF 00000001 IOC 00000096 IOC0 00000000 IOC1 00000001 IOC2 00000002 IOC3 00000003 IOC4 00000004 IOC5 00000005 IOCB 00000096 IOCB0 00000000 IOCB1 00000001 IOCB2 00000002 IOCB3 00000003 IOCB4 00000004 IOCB5 00000005 IRP 00000007 LEDOUT 00000001 NOT_BOD 00000000 NOT_DONE 00000001 NOT_GPPU 00000007 NOT_PD 00000003 NOT_POR 00000001 NOT_T1SYNC 00000002 NOT_TO 00000004 OPTION_REG 00000081 OSCCAL 00000090 PCL 00000002 PCLATH 0000000A PCON 0000008E PEIE 00000006 PIE1 0000008C PIR1 0000000C PS0 00000000 PS1 00000001 PS2 00000002 PSA 00000003 RD 00000000 RP0 00000005 RP1 00000006 SERVOOUT 00000000 STATUS 00000003 MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 46 SYMBOL TABLE LABEL VALUE T0CS 00000005 T0IE 00000005 T0IF 00000002 T0SE 00000004 T0cnt 000000FA T0rate 000007D0 T1CKPS0 00000004 T1CKPS1 00000005 T1CON 00000010 T1IE 00000000 T1IF 00000000 T1OSCEN 00000003 TMR0 00000001 TMR1CS 00000001 TMR1GE 00000006 TMR1H 0000000F TMR1IE 00000000 TMR1IF 00000000 TMR1L 0000000E TMR1ON 00000000 TRISIO 00000085 VCFG 00000006 VR0 00000000 VR1 00000001 VR2 00000002 VR3 00000003 VRCON 00000099 VREN 00000007 VRR 00000005 W 00000000 WPU 00000095 WR 00000001 WREN 00000002 WRERR 00000003 Z 00000002 _BODEN_OFF 00003FBF _BODEN_ON 00003FFF _CPD_OFF 00003FFF _CPD_ON 00003EFF _CP_OFF 00003FFF _CP_ON 00003F7F _EC_OSC 00003FFB _EXTRC_OSC_CLKOUT 00003FFF _EXTRC_OSC_NOCLKOUT 00003FFE _HS_OSC 00003FFA _INTRC_OSC_CLKOUT 00003FFD _INTRC_OSC_NOCLKOUT 00003FFC _LP_OSC 00003FF8 _MCLRE_OFF 00003FDF _MCLRE_ON 00003FFF _PWRTE_OFF 00003FFF _PWRTE_ON 00003FEF _WDT_OFF 00003FF7 MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 47 SYMBOL TABLE LABEL VALUE _WDT_ON 00003FFF _XT_OSC 00003FF9 __12F675 00000001 adjust_input 000000B8 apulselp 00000123 ashutter 000000AD ashutterlp 000000B3 autofuzz 00000003 autopulse 00000005 cameratoggle 000001E6 cfg_faultyA 00000024 cfg_faultyB 00000025 cfg_inputidleH 00000031 cfg_inputidleL 00000030 cfg_inputpoweroffH 00000035 cfg_inputpoweroffL 00000034 cfg_inputshutterH 00000033 cfg_inputshutterL 00000032 cfg_servofocusH 00000029 cfg_servofocusL 00000028 cfg_servoidleH 00000027 cfg_servoidleL 00000026 cfg_servoshutterH 0000002B cfg_servoshutterL 0000002A cfg_timefocus 0000002C cfg_timekalive 0000002F cfg_timepost 0000002E cfg_timepoweroff 00000036 cfg_timeshutter 0000002D checktime 00000143 chk_poweroff 000000DF chkdblka 000000A7 chkvideo 000000A5 clrlp 00000048 db_now_off 0000021B db_prgoff 00000216 db_still_on 0000021F db_vidoff 00000219 deb_count 00000047 debounce 0000000A driveservo 000001E3 eedata16 eedata8 eep_iidle 00000011 eep_ipoweroff 00000017 eep_ishutter 00000014 eep_rom 00000042 eep_sfocus 00000003 eep_sidle 00000000 eep_sshutter 00000006 eep_tfocus 00000009 eep_tkalive 0000000F eep_tpost 0000000D MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 48 SYMBOL TABLE LABEL VALUE eep_tpoweroff 0000001A eep_tshutter 0000000B eepwlp 000001D7 emptyreturn 000000CB es_editiservo 00000002 es_editnumber 00000000 es_editoservo 00000001 estatus 00000046 exitint 00000020 faulty 000003D0 ffault 000003C9 ffault1 000003D4 ffault2 000003DB ffaultA 000003C6 ffaultB 000003C8 fflt_l1 000003C2 filterrx 000000EC flash_cnt 00000049 flash_faulty 000003A8 flash_icnt 00000048 flash_lp 00000224 flashchk 00000229 flasher 00000223 flashof flashon fltr_dolos 00000109 fltr_dopower 000000FB fltr_exit 00000116 fltr_samelos 0000010E fltr_samepoweroff 00000100 fltr_sameshutter 000000F3 framems 00000019 frmT0cnt 00000033 frxstatus 0000003C getrxapulse 0000011D getrxpulse 000000CC gn_ipause 00000000 gn_tendigit 00000001 gn_tenpause 00000002 gnstatus 00000051 gpioout 00000039 i 0000000C idlepulsegt 000000DD iflasher 0000022D ini_inputidle 000005DC ini_inputpoweroff 000004B0 ini_inputshutter 00000708 ini_servofocus 000005DC ini_servoidle 000005DC ini_servoshutter 000006D6 ini_timefocus 00000000 ini_timekalive 00000037 ini_timepost 0000000A MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 49 SYMBOL TABLE LABEL VALUE ini_timepoweroff 0000000A ini_timeshutter 00000005 initdebounce inrxbit 00000004 inrxraw 00000001 int_1sec 00000023 int_p1sec 00000022 is_doubleka 00000006 is_idlelt 00000001 is_nokeepalive 00000003 is_powerofflt 00000002 is_programmode 00000000 is_videoon 00000005 is_wnoshutter 00000004 istatus 00000037 kalive_icnt 0000003B ktrigger 00000086 ledoff loscnt 0000003D lostime 00000014 markflt mtrigger 00000089 ncfgitems 0000000B notsetup 0000005F now_idle 00000076 outled 00000005 outrxinv 00000002 outservo 00000000 poffpulsegt 000000EA post 0000009A powerofficnt 0000003F prg_centrewait 0000026C prg_count 0000004D prg_cw1 0000026C prg_cw2 00000277 prg_cw3 00000273 prg_cwdone 0000027D prg_ed1 00000371 prg_ed10 0000039E prg_ed11 000003A3 prg_ed2 00000376 prg_ed3 0000037B prg_ed4 00000380 prg_ed5 00000385 prg_ed6 0000038A prg_ed7 0000038F prg_ed8 00000394 prg_ed9 00000399 prg_editdone 00000364 prg_editiservo 000002C0 prg_editnumber 000002D0 prg_editok 000002D2 prg_editoservo 00000294 MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 50 SYMBOL TABLE LABEL VALUE prg_editsetup 00000337 prg_eis1 000002C4 prg_entry 00000281 prg_entrywait 00000239 prg_eos1 0000029D prg_eosA 000002AC prg_eosB 000002A5 prg_eosB1 000002A8 prg_es1 00000348 prg_es10 00000360 prg_es11 00000362 prg_es2 0000034C prg_es3 0000034E prg_es4 00000350 prg_es5 00000354 prg_es6 00000356 prg_es7 00000358 prg_es8 0000035A prg_es9 0000035E prg_esiservo 0000035B prg_esnumber 00000351 prg_esosrvo 00000349 prg_ew1 0000023C prg_ew2 00000247 prg_ew3 00000243 prg_ewdone 0000024E prg_fdiff 00000210 prg_filterAorB 000001FC prg_fnowA 0000020C prg_fnowB 0000020E prg_getnumber 000002D8 prg_gn_1flash 000002F0 prg_gn_adigit 000002F9 prg_gn_ipause 000002F3 prg_gn_tendigit 00000300 prg_gn_tenpause 00000308 prg_gnfA 00000329 prg_gnfAB 00000335 prg_gnfB 00000330 prg_gnflash 00000311 prg_gnfoff 00000324 prg_gnlimit 0000004E prg_gnloop 000002D9 prg_gnlp1 000002E0 prg_gnlp2 000002E7 prg_gnnext 000002E9 prg_gnone 00000050 prg_gnten 0000004F prg_iservodone 000002C8 prg_itemno 0000004C prg_mainlp 00000287 prg_oservodone 000002B6 prg_rawAorB 000001EB MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 51 SYMBOL TABLE LABEL VALUE prg_videowait 00000252 prg_vw1 00000255 prg_vw2 00000260 prg_vw3 0000025C prg_vwdone 00000267 prg_waitlp 00000285 ps_debdone 00000001 ps_flshdone 00000000 ps_fstickA 00000004 ps_fstickB 00000006 ps_fstickM 00000005 ps_rstickA 00000002 ps_rstickB 00000003 pstatus 00000045 read_16bit read_8bit read_ee8 0000018A read_eep 000001AB read_ees16 00000196 recall 00000147 rx_flos 00000003 rx_fpoweroff 00000005 rx_fshutter 00000004 rx_rpoweroff 00000002 rx_rshutter 00000001 rx_timeout 00000000 rxfrmtH 00000041 rxfrmtL 00000040 rxstatus 00000038 servoH 00000044 servoL 00000043 shutter 00000094 shuttercnt 0000003E srvtmr1 0000000F start 00000038 stickAat 0000055F stickBat 00000659 stick_cnt 0000004B stick_psts 0000004A sts_save 00000021 toolong 0000013D trigger 0000008C trigger_icnt 0000003A videoswitch 00000003 w_save 00000020 wait1 00000081 waiting 0000007A whileoff 00000127 whileon 0000012E write_16bit write_8bit write_ee16 000001B1 write_ee8 000001C1 MPASM 03.60 Released SSW.ASM 3-24-2004 19:25:45 PAGE 52 SYMBOL TABLE LABEL VALUE write_eepa 000001C9 write_eepd 000001CE MEMORY USAGE MAP ('X' = Used, '-' = Unused) 0000 : X---XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 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 XXXXXXXXXXXXXXX- ---------------- ---------------- 2000 : -------X-------- ---------------- ---------------- ---------------- 2100 : XXXXXXXXXXXXXXXX XXXXXXXXXXXX---- ---------------- ---------------- All other memory blocks unused. Program Memory Words Used: 988 Program Memory Words Free: 36 Errors : 0 Warnings : 0 reported, 0 suppressed Messages : 0 reported, 19 suppressed