+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2007
    Posts
    50

    Default How to disconnect GND, with Pic

    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.

    Thanks

    Dave

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,841

    Default Re: How to disconnect GND, with Pic

    On some occasions the MCU can be powered through an I/O pin. Maybe this is the case here?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    May 2008
    Posts
    233

    Default Re: How to disconnect GND, with Pic

    <img id="vbattach_6383" class="previewthumb" alt="" src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=6383&amp;stc=1" attachmentid="6383">
    Attached Images Attached Images  

  4. #4
    Join Date
    Dec 2007
    Posts
    50

    Default Re: How to disconnect GND, with Pic

    Dave,

    All earths should be disconnected, there are no external sources of power or earth currently.

    amge,

    I'm not sure I fully follow your circuit there. looks like the buttons are from 12V to a FET gate, and not to the pic. I need the buttons to turn the pic on, and give an input signal to the PIC at the same time. I will have a go at attaching my circuit.
    Again, excuse the amateur..
    Name:  switches cct capture.PNG
Views: 272
Size:  68.4 KB

  5. #5
    Join Date
    Dec 2007
    Posts
    50

    Default Re: How to disconnect GND, with Pic

    I have made the problem a lot better by adding a 200uF cap across the output of the regulator. My theory is that keeps the PIC alive long enough to drive the FET completely off. The fault happens less often now, but it still happens.


    Hi, we are pleased to see that you are using our forum.

    We'd like you to become a member of our community. Membership is FREE, please REGISTER and view our forums without these annoying reminders!

    Once registered you may post on the forums, download from the file areas and use the WIKI without interruption.





Members who have read this thread : 3

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts