hjl4 Member Jun 26, 2008 #41 OOps forgot to attach code Code: shutdown clrw call delay3 ;0.002 ms delay btfsc GPIO,2 ;test if GP2 is cleared(switch pressed) clrf GP2 call delay3 ;0.002 ms delay clrw btfss GPIO,2 ;test if GP2 is set(switch pressed) goto shutdown goto start
OOps forgot to attach code Code: shutdown clrw call delay3 ;0.002 ms delay btfsc GPIO,2 ;test if GP2 is cleared(switch pressed) clrf GP2 call delay3 ;0.002 ms delay clrw btfss GPIO,2 ;test if GP2 is set(switch pressed) goto shutdown goto start
AtomSoft Well-Known Member Jun 26, 2008 #42 to simplify things can you post a schematic? You said "There is no residual power on GP2, as there is a10k resistor to GND." try the 10k to vdd and when switch is pressed it ties to ground. if you dont want to change circuit try "btfsc" Attachments gp2.jpg 35.8 KB · Views: 118 Last edited: Jun 26, 2008
to simplify things can you post a schematic? You said "There is no residual power on GP2, as there is a10k resistor to GND." try the 10k to vdd and when switch is pressed it ties to ground. if you dont want to change circuit try "btfsc"