I've making a simple little circuit for my car. It has a 5V reg, to power a 16F676.
Now I want this circuit to be connected to permanent power, but not drain the battery at all when not in use.
So I've basically designed the circuit so that the pic and associated components are grounded through an N Channel FET that is switched on by the pic.
It has 4 pushbuttons, RA0 to RA3, each from GND and with a diode to the PIC input pin, and also a diode to GND line. So that when a button is pressed, the PIC is GND'd, powers up, registers the button command, and activates the FET so that it stays on after the button has been released.
So far this is working fine.
My problem comes in when I want to turn the circuit off.
When I tell the PIC to output a LOW to the FET gate line, the GND line is disconnected, and the circuit appears to turn off. However, it seems to "HANG" the pic, and when I press a button to get it to start again, it powers the pic, but it wont respond. I have configured the MCLR line off, but have tried it on, with the line tied to 5V to see if that was the problem. Also tried enabling and disabling the brown out detect, and WDT, etc. This is mostly out of desperationg, as I haven't got a full grasp on some of those features, despite reading the datasheet a few times.
I suspect the FET isn't turning completely off. I can still measure around .6V at the pic.
Am I doing this the wrong way? I have seen other examples with the PIC switching a 5V input rail, but that would only disconnect the PIC in my case, not the regulator and other 12V components.
I will post the circuit and code if anyone wants, but it's late at the moment and my schematic needs to be tidied slightly before I show anyone, out of embarrassment.
Out of interest sake, I am using a BUZ71 FET as I had a heap of them floating around. I've tried a couple of other similar, including an IRFS630B, etc.
Any help would as always be appreciated.