+ Reply to Thread
Results 1 to 24 of 24
  1. #1

    Default with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    with the pic off (no power) the voltage applied on an1 (a battery) comes out from the vcc pin, i don't understand why...

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,259

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    Because the I/O-pins have protection diodes going to Vdd and Vss:

    Attachment 8928

    /Henrik.

  3. #3

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    thank you Henrik, how can i avoid it?

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,235

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    You may have PNP transistor between ANpin and battery + pin.
    When there is no power, PNP transistor blocks the way. When the power is ON, battery voltage gets through PNP transistor.

    But, you will have a a V drop on battery voltage.
    You may use a PCH mosfet to reduce the voltage drop.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,914

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    I would not put any voltage on the PIC inputs with no power on the the chip itself. Strange things can happen with the most obvious to run the program unintentionally.

    There is danger to destroy the protecting diodes too if the load is too high.

    Why do you have that voltage appear on the PIC inputs?

    Ioannis

  6. #6

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    i need it for monitoring a battery (4 volts) with the comparator

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,914

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    And your circuit happens to have no power when battery is still connected to an input?

    Ioannis

  8. #8

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    Quote Originally Posted by sayzer View Post
    You may have PNP transistor between ANpin and battery + pin.
    When there is no power, PNP transistor blocks the way. When the power is ON, battery voltage gets through PNP transistor.

    But, you will have a a V drop on battery voltage.
    You may use a PCH mosfet to reduce the voltage drop.
    emitter on + battery, collector on anpin and the base?

  9. #9

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    Quote Originally Posted by Ioannis View Post
    And your circuit happens to have no power when battery is still connected to an input?

    Ioannis
    the problem is that the circuit disharge the battery when the power is off, cause the voltage of the battery flow on the vcc pin of the pic, where there are many leds connected, they of course absorbe current

  10. #10
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,914

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    I still cannot understand why your battery is still connected to an1 input while your PIC is not powered.

    Ioannis

  11. #11
    Join Date
    Nov 2007
    Location
    West Covina, CA
    Posts
    230

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    Use a low ON resistance P-CH like was suggested that is controlled with your program.
    Here's what I did to switch the battery input to keep that from happening and to reduce the over all Sleep current:

    Attachment 8929
    Louie

  12. #12
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,914

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    I think MOSFETS have higher leakage current than say a BC85x series transistor.

    I did something similar using SMD version of the known BC557/BC547, the BC8xx series with very good results. More or less the same circuit as Louie showed.

  13. #13
    Join Date
    Nov 2007
    Location
    West Covina, CA
    Posts
    230

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    Thanks for the tip Ioannis.
    Am always looking to improve circuit performance, I'll check these out.
    Louie

  14. #14
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,235

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    Here you have two methods.

    Method - 2 may not work correctly; it is something like "egg from chicken or chicken from egg? which one is first" issue.

    But you get the idea here.

    Method-1: When the pic is powered on, it will make a pin high to drive NPN transistor.
    Method-2: When there is no power on PIC Vdd pin, NPN transistor should be OFF. But it may catch some leaks from the circuit and turn on anyway:; it may need some improvement around it. Or it may work just as you need.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  15. #15

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    Quote Originally Posted by Ioannis View Post
    I still cannot understand why your battery is still connected to an1 input while your PIC is not powered.

    Ioannis
    cause the battery serve a real time clock, the pic is off most of the times. It's on only when i start the circuit with the multi matrix led display, but i switch it off in the nights.

  16. #16
    Join Date
    Sep 2009
    Posts
    774

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    Why you don't connect A1 after switch?

  17. #17

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    i'll try them on a breadboard tomorrow, cause i have the bc327 and 237 in my drawers, thanks

  18. #18
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,235

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    Quote Originally Posted by lutherblisset View Post
    i'll try them on a breadboard tomorrow, cause i have the bc327 and 237 in my drawers, thanks
    There is a PCH mosfet; Diodes DMP3098L.

    If you use this one instead of BC327, then you may use 100K resistor instead of 10K.
    Thus, current drawing gets super low.
    But, first, just test the idea if it works as you need; you can then play with the current.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  19. #19

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    for pedja089:

    cause i use the comparator for catch the moment when the battery goes under the 3 volts (this happened only after many months cause the rtc absorbe only a few uA) but the pic is fantastic for this, although there are external comparators like the lm339 or 311 if i remember....
    Last edited by lutherblisset; - 12th June 2019 at 23:32.

  20. #20
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,235

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    Quote Originally Posted by lutherblisset View Post
    cause i use the comparator for catch the moment when the battery goes under the 3 volts (this happened only after many months cause the rtc absorbe only a few uA) but the pic is fantastic for this, although there are external comparators like the lm339 or 311 if i remember....
    There are other ways to get batt low signal with 628A.

    You can have a diode for Vref, around 0.4-0.6V; feed this vref into PIC's comparator. 1N4148 is perfect for this. Have 56K resistor from Anode to Pic VDD. Anode will give you Vref point. Cathode goes to GND.

    and have a resistor divider from Batt+ with large resistor values ( to draw uA); and feed this into comparator again.

    When the battery voltage gets lower than 3V, resistor divider should give you a voltage below Vref (say 0.4V).

    Then you have the COut signal.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  21. #21

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    Quote Originally Posted by sayzer View Post
    There are other ways to get batt low signal with 628A.

    You can have a diode for Vref, around 0.4-0.6V; feed this vref into PIC's comparator. 1N4148 is perfect for this. Have 56K resistor from Anode to Pic VDD. Anode will give you Vref point. Cathode goes to GND.

    and have a resistor divider from Batt+ with large resistor values ( to draw uA); and feed this into comparator again.

    When the battery voltage gets lower than 3V, resistor divider should give you a voltage below Vref (say 0.4V).

    Then you have the COut signal.
    interesting, i will try this method too

  22. #22
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,914

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    Does the same battery power the PIC also? Or you have another bat?

    Ioannis

  23. #23

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    Quote Originally Posted by Ioannis View Post
    Does the same battery power the PIC also? Or you have another bat?

    Ioannis
    i use the battery only on the rtc (this can be a problem why if the pic is switched off it can't calculate legal-solar hours change....)

  24. #24
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,914

    Default Re: with the pic16f628a off, a voltage on an1 comes out from main voltage pin, why?

    ok, since you have two power sources, your options are:

    1. The circuits above with transistors etc contrlled by the PIC itself.

    2. None of the above, just count a year or two and ask the user to change the battery.

    Ioannis

Similar Threads

  1. Replies: 8
    Last Post: - 21st March 2015, 17:21
  2. Replies: 7
    Last Post: - 22nd January 2012, 04:50
  3. pin voltage while programming
    By ruijc in forum General
    Replies: 4
    Last Post: - 4th July 2011, 01:17
  4. HELP !!! How change the voltage of a pin ????
    By stormdacta in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 21st August 2007, 20:55
  5. Voltage output from PIC16f628A
    By bennamanna in forum General
    Replies: 14
    Last Post: - 13th November 2006, 04:18

Members who have read this thread : 17

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