Below image is the input voltage VDD to PIC16F18326. I am turning off (Switching off the mains supply) my circuit at point A (see image). Due to large capacitance at load, which is required in my circuit to reduce large current ripples, the VDD to microcontroller is OFF after 8Sec. But I want to turn off my microcontroller immediately (within 1 sec) after I turn off the mains.
I have tried to change the capacitance placed across the VDD. No big changes in the time taken to turn off.
The VDD is supplied and controlled by a LinkSwitch (LNK304) which is fed from the output. I tried to control the feedback FB of LNK304. But the large capacitors at the output has high influence on this as well.
Any simple idea, how to Pull Down this VDD when my I switch off the mains? (Any suggestion on Addition of a component at VDD? for eg. Logic level MOSFET?)
Thanks in advance.
update: µC schematic (not complete) (VDD is supplied by LNK304)