Searching \ for '[PIC] Long power supply fall time' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/time.htm?key=time
Search entire site for: 'Long power supply fall time'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Long power supply fall time'
2005\05\05@091357 by Mauricio Jancic

flavicon
face
Hi people,
       I have a board that uses a PIC16F873(A) and a DS1307. The board also
has 4 7 segment displays that are continuously showing the time (so, they
are never off).

       The power supply is a very standard one. 4 diodes, 1 LM7805 with
it's 2 input caps of 1uF and a filter capacitor of 10.000 uF (yes, 0.01 F x
50V). The filter cap is so big, because the Cap voltage (input * 1.41) is
used from time to time to shortly make a motor work. This motor consumes low
operation current but due to it's reduction gear it consumes some start
current.

       Well, that said, let me present the problem. Oh, the PIC has it vcc
filter cap (.1uF tantalium) and a 10K + 100nF for the /MCLR Pin.

       The problem specifically is that when the voltage drops there are
miss writes to the ds1307, because the fall time of the power supply is
about 5 seconds.
       
       So, sometimes when I just unplug the power supply from the wall and
plug it on again the time is corrupted (7F:7F, all 1's, the upper bits are
masked).

       I solve it a little with a 330ohm 1W resistor in parallel with the
0.01F capacitor. I also turn off the BOD of the PIC. Here's an interesting
thing also. The pic is supposed to reset itself when Vcc is lower than 4V,
but I see that it happens to be many resets while vcc is going down, off
course because the fall time is long.

       Now, with the BOD tuned off, the PIC goes down that extra bit that
is needed until de RTC is self turned off
(~3.75V), but still have some random failures...

       Anyone has any pointer as how to proceed?

Best regards,
Mauricio

2005\05\05@094343 by Ake Hedman

flavicon
face
Mauricio

A diod form the 7805 to the filter cap and sense  "power gone" directly after the 78L05 but before the diod.  Will get you some time to put things in a safe state.

Cheers
/Ake

Mauricio Jancic wrote:

{Quote hidden}

--  ---
Ake Hedman (YAP - Yet Another Programmer)
eurosource, Brattbergavägen 17, 820 50 LOS, Sweden
Phone: (46) 657 413430 Cellular: (46) 73 84 84 102
Company home: http://www.eurosource.se      Kryddor/Te/Kaffe: http://www.brattberg.com
Personal homepage: http://www.eurosource.se/akhe
Automated home: http://www.vscp.org

2005\05\05@100054 by Mauricio Jancic

flavicon
face
Yes... But the problem is that the PIC is in a reset or unknow state at 4V
and the RTC resets when voltage drops below ~3.75 V

Mauricio Jancic
Janso Desarrollos - Microchip Consultants Program Member
spam_OUTinfoTakeThisOuTspamjanso.com.ar
http://www.janso.com.ar
(54) 11 - 4542 - 3519

> {Original Message removed}

2005\05\05@101645 by Stephen R Phillips

picon face

--- Mauricio Jancic <.....jancicKILLspamspam@spam@ciudad.com.ar> wrote:
> Hi people,
>        I have a board that uses a PIC16F873(A) and a DS1307. The board also
> has 4 7 segment displays that are continuously showing the time (so,
> they
> are never off).

This should be sent to the EE group instead, as it's not a software or
programing issue.
{Quote hidden}

You should not run the motor and PIC from the same power supply, this
is the real source of your problem, and potentially a future source of
trouble as well.  Use a diode to seperate a logic supply from the main
supply add an inductor in series to filter out transients, feed this to
a more conventional linear regulator for only your logic. This way
power failure causes much more predictable behavior AND you won't have
noise from other devices causing strange problems with the PIC and
other supply sensitive devices.
>
>
> Best regards,
> Mauricio
>
Good fortune!


Stephen R. Phillips was here
Please be advised what was said may be absolutely wrong, and hereby this disclaimer follows.  I reserve the right to be wrong and admit it in front of the entire world.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

2005\05\05@102801 by Ake Hedman

flavicon
face
Mauricio Jancic wrote:

>Yes... But the problem is that the PIC is in a reset or unknow state at 4V
>and the RTC resets when voltage drops below
>~3.75 V
>
>Mauricio Jancic
>Janso Desarrollos - Microchip Consultants Program Member
>infospamKILLspamjanso.com.ar
>http://www.janso.com.ar
>(54) 11 - 4542 - 3519
>
>
>  
>
What I was thinking of was to not do read/writes to the RTC when the power is in an unsafe state. So when the voltage in drops to a certain level (  < 5 but > 4  ) your code enters some safe state that just waits for power to come back to a safe level again and then do normal stuff.  You go to the same code at start up.

/Ake


>>{Original Message removed}

2005\05\05@110024 by Alan B. Pearce

face picon face
> The power supply is a very standard one. 4 diodes, 1 LM7805 with
>it's 2 input caps of 1uF and a filter capacitor of 10.000 uF (yes, 0.01 F x
>50V). The filter cap is so big, because the Cap voltage (input * 1.41) is
>used from time to time to shortly make a motor work. This motor consumes
low
>operation current but due to it's reduction gear it consumes some start
>current.

OK from this I take it that you have a bridge rectifier (4 diodes) to feed
the large capacitor. You may like to add another two lower current diodes
(1n400x series) and have a low current supply for the PIC, so this is not
affected by current draw from the large cap, and also use a smaller cap for
the PIC supply so it falls faster when switched off. The two diodes repeat
the "top half" of the bridge rectifier.

Now the next point from this - are you really feeding the 50V into a 78xx to
drop it to 5V for the PIC etc? I would suggest that you look at some way of
having a two stage drop, either a resistor or a higher voltage 78xx
regulator before the 5V one, to limit power dissipation in the regulator.

> The problem specifically is that when the voltage drops there are
>miss writes to the ds1307, because the fall time of the power supply is
>about 5 seconds.

Do you have any pull up resistors on the enable lines of the Ds1307? I
haven't checked the data sheet or app notes, but Dallas/Maxim must publish
something about what is required to stop data corruption.

2005\05\05@110528 by Mauricio Jancic

flavicon
face
> What I was thinking of was to not do read/writes to the RTC
> when the power is in an unsafe state. So when the voltage in
> drops to a certain level (  < 5 but > 4  ) your code enters
> some safe state that just waits for power to come back to a

[SNIP]

Well, I see your point, it could be good, but I'm not shure. I think that my
problem is the PIC doing something wrong, I mean, the PC going somewhere
wrong in the Program memory. So, I don't think that putting the pic in a
"safe" state will work, asuming that the Program counter is wrong...

Mauricio Jancic
Janso Desarrollos - Microchip Consultants Program Member
.....infoKILLspamspam.....janso.com.ar
http://www.janso.com.ar
(54) 11 - 4542 - 3519



2005\05\05@110822 by Jan-Erik Soderholm

face picon face
Stephen R Phillips wrote :

> --- Mauricio Jancic <EraseMEjancicspam_OUTspamTakeThisOuTciudad.com.ar> wrote:
> > Hi people,
> > I have a board that uses a PIC16F873(A) and a DS1307.
> > The board also has 4 7 segment displays that are
> > continuously showing the time (so, they are never off).
>
> This should be sent to the EE group instead, as it's not a software or
> programing issue.

How do you know that ?
Or that the "issue" might have a software solution ?

At least there is a PIC involved, and I'd rather not missed
this thread (since I don't subscribe to EE...).

Jan-Erik



2005\05\05@111040 by Mauricio Jancic

flavicon
face
> You should not run the motor and PIC from the same power
> supply, this is the real source of your problem, and
> potentially a future source of trouble as well.  Use a diode

Ohh... God, was I soooo blind? Dam! Really, seriously, I was trying to solve
the problem in the current circuit, never consider that, even as it looks
like the obvious solution....

My current solution, which I'm now testing, is to put a diode in series with
the vcc line at the DS1307

The pic is still working at 5V so the data lines are at that voltage, but at
the DS1307 I have VCC+0.7V which is good. This solution makes the RTC to
power down when its VCC is 3.75V, but the voltage at the PIC is at that
point 3.75+0.7 = 4.45V, so is still within the PICs voltage range...

31 power cicles untill now and no failures.

I'll let you know

Mauricio

2005\05\05@112752 by Paul Hutchinson

picon face
> -----Original Message-----
> From: piclist-bouncesspamspam_OUTmit.edu On Behalf Of Mauricio Jancic
> Sent: Thursday, May 05, 2005 9:14 AM
>
> Hi people,
>        I have a board that uses a PIC16F873(A) and a DS1307. The board also
<snip>
>        The problem specifically is that when the voltage drops there are
> miss writes to the ds1307, because the fall time of the power supply is
> about 5 seconds.

Do you have a good 3V lithium battery connected to the DS1307?

With a good lithium battery attached, the DS1307 has very good power down
data corruption prevention circuits. Without a good battery, the protection
becomes non-functional. (good battery = 2.5V to 3.0V)

Paul

<snip>
> Best regards,
> Mauricio

2005\05\05@112835 by PicDude

flavicon
face
This sounds similar to a problem I had recently -- switching PS supplied power
to various PICs, but also acted as a signal for another PIC (digital clock)
to turn on it's display.  The clock had its own 7805 PS so it could
sleep/count when the main PS was off.  During power-down, the long decay
would cause the clock PIC to flicker a few times, then finally go off.  My
solution was to isolate the filter cap of the main PS using a rectifier
diode, so the signal to the clock PIC would drop abruptly.  Perhaps this is
possible for your app?

Is that filter cap on the output side of the 7805?  If so, isn't that a no-no?

Cheers,
-Neil.



On Thursday 05 May 2005 08:13 am, Mauricio Jancic scribbled:
{Quote hidden}

2005\05\05@114742 by Mauricio Jancic

flavicon
face
Hi,
       - The voltage at the cap is 12 VAC rectified ( ~17 V) not 50V,
that's the cap rating voltage
       - The DS1307 has its corresponding 2x10K resistors on the data lines

Mauricio Jancic
Janso Desarrollos - Microchip Consultants Program Member
@spam@infoKILLspamspamjanso.com.ar
http://www.janso.com.ar
(54) 11 - 4542 - 3519


> {Original Message removed}

2005\05\05@115744 by Dwayne Reid

flavicon
face
At 07:13 AM 5/5/2005, Mauricio Jancic wrote:

>         The power supply is a very standard one. 4 diodes, 1 LM7805 with
>it's 2 input caps of 1uF and a filter capacitor of 10.000 uF (yes, 0.01 F x
>50V). The filter cap is so big, because the Cap voltage (input * 1.41) is
>used from time to time to shortly make a motor work. This motor consumes low
>operation current but due to it's reduction gear it consumes some start
>current.
>
>         Well, that said, let me present the problem. Oh, the PIC has it vcc
>filter cap (.1uF tantalium) and a 10K + 100nF for the /MCLR Pin.
>
>         The problem specifically is that when the voltage drops there are
>miss writes to the ds1307, because the fall time of the power supply is
>about 5 seconds.

I would tackle this by adding 2 more diodes (A to AC input, C tied
together) feeding a smaller filter cap and regulator.  This smaller supply
would feed the logic power but not display or motor power.  Current is
small, so you need only a small reservoir cap and tiny regulator - even a
simple series resistor / zener shunt works well.

I often add a P-channel JFET (J175) to ensure that the PSU discharges
completely.  S to gnd, D to +5V logic, G to Vunreg via 1M0 resistor.  This
assumes that Vunreg is at least 4V higher than Vreg during normal operation.

I've often mentioned how much trouble one can run into if the PIC Vdd
doesn't go all the way to 0V.  The simple JFET shunt mentioned above
eliminates those problems and is very inexpensive.

dwayne

--
Dwayne Reid   <KILLspamdwaynerKILLspamspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 21 years of Engineering Innovation (1984 - 2005)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

2005\05\05@121613 by Mauricio Jancic

flavicon
face
My power supply is very simple.

12 VAC ----> 4 diodes RECTIFIER -----> CAP 10000uF -----> LM7805 ---> PIC
and RTC---------+
                                                                       |
|
                                                                       |
v
       
+-------------------------------> RELAY ---> motor

That's it.
Mauricio Jancic
Janso Desarrollos - Microchip Consultants Program Member
RemoveMEinfoTakeThisOuTspamjanso.com.ar
http://www.janso.com.ar
(54) 11 - 4542 - 3519


> {Original Message removed}

2005\05\05@124906 by Mauricio Jancic

flavicon
face
I think I found the problem...

I was testing all the time that a bit on the seconds register (read from the
RTC) was not 1, which would mean that the oscillator was off. If that
condition was true, I re-write the current time (recently read) to the RTC
after modifying that bit.

       The problem was that when the 1307 turns off, your read 0xFF (the
pull-up resistor...) so, evry time the 1307 was off I write a 0xFF:0xFF:0xFF
time.... Something like that, I'm just trying that.

Regards,

Mauricio Jancic
Janso Desarrollos - Microchip Consultants Program Member
spamBeGoneinfospamBeGonespamjanso.com.ar
http://www.janso.com.ar
(54) 11 - 4542 - 3519


> {Original Message removed}

2005\05\05@131048 by phil B

picon face
So, the question revolves around what's happening
between 4V and 3.75V (which is actually 1.25 * Vbat).
Right?  Its not obvious to me that the PIC resetting
is some how writing garbage to the RTC.  I2C takes
some very specific sequences, kind of hard to have
random garbage write 1s to all the registers.  The
results you are seeing look more like symptoms of a
power outage, not a sequence of commands from the PIC.
Do you have a fully charged battery?   Maybe the PIC
reset is causing  power glitches?

As an aside, why are you writing the the RTC?  Does
this only happen at startup?  Maybe you should put
some sort of delay into the write code so that is
doesn't happen within a certain period of time after
reset.

There are lots of ways to detect the voltage level
(though it takes a little care) but I don't see what
that buys you as you still have to deal with the BOD
reset issue (if that is what's causing the problem.
It seems to me that you already have a reasonable
solution.


--- Mauricio Jancic <TakeThisOuTjancicEraseMEspamspam_OUTciudad.com.ar> wrote:
{Quote hidden}

> --

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...