PDA

View Full Version : Why Or'd Vcc with backup battery output shorted battery life?



jellis00
- 9th October 2011, 05:40
The attached partial schematic shows how I have Or'd the Vcc power supply with the output of a backup CR2032 lithium battery as the power source to a DS1337 real-time-clock. I did this so that when power is shut down to the microcontroller circuit, the backup battery keeps the clock running and alive, but when Vcc is on the lifetiime of the battery is perpetuated. I expected this to allow the backup battery to last for a very, very long time. Instead my lithium battery died in only a couple of weeks when by theory the DS1337 consumption should have let it last for months.

Can anyone look at this schematic and tell me why this happened and how I should change the schematic to preserve the backup battery lifetime??6038

rsocor01
- 9th October 2011, 08:17
Not sure about this, but it is possible that the PIC is sinkink current through the 4.7K resistor even though the PIC is powered off. Can we see the whole schematic?

Robert

jellis00
- 9th October 2011, 18:46
..... but it is possible that the PIC is sinkink current through the 4.7K resistor even though the PIC is powered off.
I see what you are implying about a leakage path from the backup power source to the DS1337 through the 4.7K pullup resistors to the PIC. However, if the PIC is powered off that would mean the PIC pins that are connected to the bottom of the pullup resistors would have to be at ground level or at some voltage below the backup voltage. I don't have enough knowledge of the PICs to know whether that is the case or not. Do you or anyone on this forum know about this or where I could find out?



Can we see the whole schematic?

Here is the whold schematic:
6039

mackrackit
- 9th October 2011, 19:23
A PIC CAN be powered through an I/O pin.

rsocor01
- 9th October 2011, 20:47
Jellis00,

Test your circuit running with the backup battery only. I would use an ampmeter to see if there is any leak going through any of the resistors.

rsocor01
- 9th October 2011, 20:56
A PIC CAN be powered through an I/O pin.

What do you mean? :confused::confused: Are you saying that the Vss and Vdd pins are not necessary or can be omitted?

Robert

mackrackit
- 9th October 2011, 22:02
Vss and Vdd pins are not necessary or can be omitted?
No, I am saying that it can.
Say you have a MCU with an I/O sourced to different power supplies. If the I/O is high and the power is cut to the MCU the MCU will not be able to reset. The voltage on the I/O will keep the MCU running or in a near run state. The I/O can even be a RS232 input.

For a test, have the MCU keep a LED high (lighted), apply 5 volts to an input. Turn the power off to the MCU while keeping the input at 5 volts. Look at the LED.

Heckler
- 9th October 2011, 22:23
Vss and Vdd pins are not necessary or can be omitted?

YEP!! you can power PIC's through the I/O pins... anyway take a look here...
http://www.t4f.org/en/projects/open-rfid-tag/57

I would never have thought it possible... I am sure there are current limitations, though.

I ran across this on one of my favorite web sites... www.hackaday.com (http://www.hackaday.com)

jellis00
- 10th October 2011, 05:17
Jellis00,

Test your circuit running with the backup battery only. I would use an ampmeter to see if there is any leak going through any of the resistors.

Good suggestion. I will try this in the next couple of days and report back.
If the PIC is consuming power from the backup battery via these leakage paths when the Vcc to the PIC is shutdown, I guess Oring the two power sources is not the way to save battery life. Since I have to use pullup resistors with the DS1337 for it I2C interface and the _INTA interface, how can I prevent the PIC from running down the backup battery?? Any suggestions from anyone??

mackrackit
- 10th October 2011, 07:00
Take a look at the schematic here
http://www.picbasic.co.uk/forum/content.php?r=272-USB-SD-LOGGING

K (http://www.picbasic.co.uk/forum/content.php?r=272-USB-SD-LOGGING)eep in mind the whole system runs at ~3 volts.

jellis00
- 10th October 2011, 16:34
Thanks, Dave! That is a very cool design. I see from it how you or'd the Vcc with the backup battery for clock use and connected all the pull-up resistors to Vcc rather than to the backup battery supply. That eliminates the leakage path that I am currently stuck with by having the pullups connected to the battery. I was worried that the clock would continue to maintain time or work properly if I didn't keep the pullups active when Vcc was shut down, but from your schematic evidently it will keep on trucking when Vcc is shut down. Correct??

One other question I had regarding your circuit is how you get away with only one diode on the Vcc leg of the Or'd circuit? I thought I would have to also put one on the leg of the backup battery supply so that when Vcc is active, that diode protects the backup battery from the Vcc voltage.

Now I guess I have to consider cutting some traces and green wiring the pullups to Vcc.... a lot cheaper than a PCB re-do:rolleyes-new:

Thanks again for all your help. Now that you have seen my full schematic in this post, can you take a look at my EMAIL routine in the post I made to your ConnectOne example code thread to see if you see any obvious reasons it isn't working in my application.

mackrackit
- 10th October 2011, 17:03
I thought I would have to also put one on the leg of the backup battery supply so that when Vcc is active, that diode protects the backup battery from the Vcc voltage.
I might be doing it wrong, but with VCC being 3 volts I have not had any problems.


evidently it will keep on trucking when Vcc is shut down. Correct??
Correct, I had a part that got pushed to the back of the bench for around six months (no external power) and the RTC was still alive when I fired it up.


can you take a look at my EMAIL routine
Yes, I am looking at it.

BobK
- 14th October 2011, 00:32
Hi John,

When I sent you my DS1337 schematic last year I only showed the two diodes connected to the Vcc of the 1337. I had the resistors connected to the PIC's Vcc for the very reason that you are experiencing now.

BobK

Demon
- 22nd January 2012, 04:48
Moved from Schematics.

Robert