The external power feeds through the I/O-pins internal protection diodes.
Look at the port pin block diagrams and you'll see why. You might also try to enable BOR, but I'm not sure that's the best route. Of course, there's always the option of powering your external device from the same power supply. When it's off, it's all off.
Check the attached graphic. With the PIC powered off, and +V applied to the input pin, it goes right through the high-side diode to VDD.
Bookmarks