avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DS1307 Corruption problem.


From: Bill Gatliff
Subject: Re: DS1307 Corruption problem.
Date: Thu, 19 Aug 2021 06:33:42 -0700

Also, in general always make sure all the I/O from the AVR that goes anywhere is in a known, desirable state while the AVR is in reset. The i2c lines are already dealt with due to the mandatory pull-ups, but other pins might be floating around and confusing things.

OH, ... make doubly sure the circuitry around the '1307 is right. IIRC, it's easy to accidentally end up with the backup battery trying to power the rest of your board when you pull the mains plug. That inevitably drags the backup voltage down to zero even if you've got a good battery.

As for the footnote about transients, that's a common issue in any circuit with large storage devices, i.e. solenoid coils, freewheeling starter motors. At small scale, it's how switching power supplies work. At large scales, it finds points of egress for the magic blue smoke. :-)

b.g.

On Thu, Aug 19, 2021, 6:13 AM <dvalin@internode.on.net> wrote:

On 19.08.21 17:54, Royce Pereira wrote:
  > The problem is very often when I switch off my board and switch on again, I
  > find the DS1307 back to initialised state (seconds showing 80) and date is
  > 0-0-0.
  >
  > I tried many things, changing pull-up values, decoupling capacitors,
  > staggering the RTC and Lux functions etc. But nothing is working.
 

After checking that the backup battery voltage is at least 2v at pin 3,
  and has a bypass capacitor for good measure, I'd try holding the cpu in
  reset while powering off. Then I'd try powering down the OPT3001 prior
  to the power-down, so it can't do anything.
 

Finally, if the DS1307 corrupts with nothing else on the board active,
  then is it switch bounce cycling power on & off several times in ten ms
  or so?
 
Also, be aware that the problem could be occurring at switch-on, not
switch-off, even if that seems much less likely.¹


It's more a matter of bisecting the problem, than trying many things. ;-)
 

Happy hunting - it sounds like fun.


Erik


¹ I once had a car manufacturer claim our LED clock died the second time
  its display was turned on. In fact it died when they first turned off
  the car's accessories line on the ignition switch, as a relay coil on
  that line generated a back-emf of over -1000 volts. They had no
  intention of adding the cost of a bypass diode, and I had to modify to
  tolerate the transient, without adding anything to the cost of the
  clock.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]