what am i doing wrong?

Status
Not open for further replies.
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
 
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:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…