I would check my definitions. If you halt at a BSF/BCF in simulator it's most probably just a bad definition pointing wrongly. If it halts in real board only it may be so simple as you setting wrong pin, thus shorting out power or such. Just ideas, I really haven't got any real clue... KreAture ----- Original Message ----- From: "Debbie Hynes" To: Sent: Sunday, January 26, 2003 4:55 AM Subject: [PIC]: Program halts on bsf/bcf - weird? > PICers - I have this code for a 16F84 that _should_ be pretty straightforward. It loops around, looks for a bandit on RA4 (connected to IR detector) fires camera if bandit is found. Trouble is the program freezes when it it bcf/bsf's PORTB. > Does it in ANIMATE on MPLAB (5.40) and also locks up when transferred to an actual PIC on breadboad :( > I reinstalled Win98 a few days ago - any gotchas there? > Never had this problem before - ideas? > Thankz - Debbie :) > shutdown clrf flags > bsf POWER ;Camera power is OFF > bcf flags,CAM ;Flag that power is OFF > ;sleep Turn off and await interrupt > nop > call takepic ;TEST FIRE ;Commence from here after interrupt > > > 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 ;MACRO - Let the camera stabilise ~5 secs > call watch ;Look for bandit again > btfss flags,BANDIT ;Still there? > goto check-2 ;No - go back to to checkin' > call takepic ;Yes - still there so take a picture > CAMWAIT ;MACRO - Wait till camera settles > call watch > btfss flags,BANDIT ;Is the bandit still around after the shot? > goto check-2 ;No - he's gone so go back to checkin' > goto loop01 ;Yes - still there so get ready for another shot > > > > ;CONSTANTS Definitions > > CONFIG_B equ b'00011001' ;TRIS CONFIG IS b'0001 1001' > #DEFINE POWER PORTB,CAMPWR > #DEFINE PICTURE PORTB,SHOOT > > > > > --------------------------------- > Yahoo! Movies > - What's on at your local cinema? > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu