It wont work. Because if PIC doesn't have power supply, current still can be drown from pin, and that will be probably enough to turn on fet. Even if RA4 is open drain, you can put more than VDD+0.6 on that pin. If you do this, you will damage input buffer.
So you need to to put transistor to bring down gate. Depending on P FET you use and battery voltage, maybe you need to put another resistor to create voltage divider for gate.
EDIT:
![]()




Bookmarks