Hi,
I'd like to completely power off a PIC based circuit after the job is done. Currently I've a relay that controls AC power to the circuit, the relay is driven by PORTA.0. the logic is somewhat like this

PORTA.0=1 ' relay is ON, power is applied to PIC
....do the job
PORTA.0=0 ' relay is OFF
FOR I=1 to 1000 'start a loop to die until DC power is disappears
Pause 1000
NEXT I

unfortunately this is not reliable

Any hint ? using an external transistor connected to MCLR ?

Thanks