It would help if you hard part values and part descriptions along with voltage levels at
various nodes in your schematic, but what is connected to the center node entering R1?
Which state change are you expecting to wake the PIC from sleep? If you're not testing for
this before entering sleep, you have no idea what level transition causes a wake-up. May
or may not be important. Just curious.
Also, if you're just testing for 0-5V why not just use a digital input VS an A/D?
With 10-bit resolution testing for potvalue >=250 is testing for >=~1.22V. Is the voltage in
on GPIO.0 and GPIO.5 below the input threshold levels?
Note: You still need to disable global interrupts. It will jump to location 4 on the 1st wake-
up so you'll be executing code from somewhere unexpected after the 1st wake-up. If it
does make it through that somehow global interrupts will be disabled on the 2nd pass, but
it's still not going to be working like you expect.
Bookmarks