thankz for all the tips folks - the program is working now. i put an rf module+decoder in the cct to give a rising edge when it recives a 304MHz signal. woz using a switch before and debounce glitches were messing up the interrupt. Ha, and i used labels instead of relative jumps :) Hey kreAture if u want 2 swap notes thats ok by me - email off list? the code now looks like so :- shutdown COMMAND ;LCD in Command mode (MACRO) LCD_CLR ;Clear the LCD & home the cursor (MACRO) CHARACTER ;LCD back in Character mode (MACRO) STANDBY_MSG ;LCD message ... system on standby (MACRO) bsf POWER ;Camera power is OFF clrf flags ;Flag that EVERYTHING is OFF sleep ;Turn off and await interrupt nop ;The interrupt toggles the HUNT flag ON/OFF ;AFTER an interrupt, we're in HUNT MODE so ;write a message about it .... COMMAND ;LCD in Command mode (MACRO) LCD_CLR ;Clear the LCD & home the cursor (MACRO) CHARACTER ;LCD back in Character mode (MACRO) HUNT_MSG ;LCD message ... in hunt mode (MACRO) power_off bsf POWER ;Camera power is OFF. Active LOW bcf flags,CAM ;Flag that power is OFF check btfss flags,HUNT ;Still in hunt mode? goto shutdown ;No - then quit call watch ;Yes - look for a bandit btfss flags,BANDIT ;Is a bandit present? goto check ;No - keep checkin' loop01 bcf POWER ;Yes - power up the camera. Active LOW bsf flags,CAM ;Flag that power is ON CAMWAIT ;Let the camera stabilise ~5 secs call watch ;Look for bandit again btfss flags,BANDIT ;Still there? goto power_off ;No - go back to to checkin' call takepic ;Yes - still there so take a picture CAMWAIT ;Wait till camera settles call watch btfss flags,BANDIT ;Is the bandit still around after the shot? goto power_off ;No - he's gone so go back to checkin' goto loop01 ;Yes - he's still there so get ready for another shot ********************************************************* ;PORTB PIN EQUATES ;********************************************************* CONFIG_B equ b'00011001' ;TRIS CONFIG IS b'0001 1001' RC equ 0 ;INTERRUPT from Radio Control (INPUT TRISB0=1) SHOOT equ 1 ;SHOOT= take a pciture (OUTPT TRISB1=0) CAMPWR equ 2 ;Applies power to battery (OUTPT TRISB2=0) CHKBAT equ 3 ;Monitors battery voltage (I/O)(INPUT TRISB3=1) DAYNITE equ 4 ;Monitors Day/Night (INPUT TRISB4=1) CK equ 5 ;LCD clock (OUTPT TRISB6=0) CH equ 6 ;LCD character bit (OUTPT TRISB6=0) EN equ 7 ;LCD enable (OUTPT TRISB7=0) ;******************************************************** ;CONSTANTS + DEFS ;******************************************************** HUNT_TOGGLE equ 0x08 ;HUNT FLAG=bit_3, test with b'0000 1000' #DEFINE POWER PORTB,CAMPWR #DEFINE PICTURE PORTB,SHOOT ;********************************************************* ;FLAG REGISTER EQUATES ;RB0=interrupt from RF_RX+DECODER. (+) going pulse. ;********************************************************* BANDIT equ 0 CAM equ 1 ;CAM_ON.1 => power ON, CAM_ON.0 => power OFF XX1 equ 2 ;In reserve ... dummy flag HUNT equ 3 ;DTR.1 => HUNT MODE is toggled on/off BATTERY equ 4 ;BATTERY.1 => Battery OK, BATTERY.0 => battery BAD XXX equ 4 ;In reserve ... dummy flag XXY equ 5 XXZ equ 6 XYX equ 7 --------------------------------- Yahoo! Movies - What's on at your local cinema? -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu