DS1307 - Strange Battery Fault

Well as I said above...

Wire it as per the schematic in the link I posted.
Use the library and example code from the link I posted.

If it still behaves strangely, experts please correct me if I'm wrong, but the only other option would be the IC is bad.

I wired one of my DS1307's as I outlined and it works as it should:

Keeps time (power on or off) and sends time with battery in.
Keeps time (with power on) and sends time with battery out.

'nuff said :wink:

So, the "big" problem wasn't the circuit or the IC, but the quartz. Now everything work normal, i think. Otherwise, without the battery power supply, programs work strange... What I mean, start showing 0:0:0 etc. after 2-3s. showing again the real time. In two different programs, it makes almost the same problem (one sketch on serial monitor, one on lcd). What could be?

I don't quite understand your question, is it working or isn't it?

It's working well, when the battery is hooked up. If I remove the Batt. it starts to work strange - 2-3sek showing the real time 1-2 sek. showing 0:0:0 etc. If the battery is connected again it runs well again.

Are you using the example code from the link I posted?

Yes, that code and another one from here.

That sounds strange and is probably beyond my ability to diagnose.. If all the components are functioning then the problem is code. If the code is right, then the hardware is the problem... you seem to have a little of both :slight_smile:

I would still say that the IC is still questionable at this point...

The IC is out of mind now, I bought 2 more, so I have 3 now. All of them the same. The hardware doesn't have much parts so... But anyway, if there is a battery there isn't a problem :slight_smile:

Well, since you will likely have the battery installed it may just be a non-issue, but I would like to understand the issues a little more. As I said, I could not reproduce the problem :slight_smile:

When I have time I'll make a video to show what exactly is :slight_smile:

No no... I know WHAT the problem is... I just don't know the cause...

Well I etched a new board(2 actually, forgot to mirror the first) and I have the same problem, so it either the 2 smd 1307's I have are faulty of something out there is trying to make me cry.

Could it be a very small bridge on the board(s)? The first couple I made had a fibre almost invisible to the naked eye shorting out a couple traces. Not to say that's the problem, but it could be...

Also, I assume you've wired the schematic on a breadboard... If not, try that and see if the problem continues...

Sorry to jump in on this discussion late, but if you expect the 1307 to work without the battery, then the problem is your expectation. The datasheet says

Battery voltage must be held between the minimum and maximum limits for proper operation.

Since the minimum is 2V, not 0, this implies you must have a battery even if power is applied to Vcc.

-j

The very first was a fab house pcb, second was newly etched and checked with microscope. Both ICs were from Maxim directly. The only thing I havent changed is the battery, will try another power source asap.

Update, I have just breadboarded it and it does the same, only item in common is the battery.

Im off out to get a battery, so will keep you all updated. Wont have time to do it tomorrow, the wife is getting induced, our first boy on his way....Phil 2.0

Congratulations! (and my condolences for your eventual lack of free time and sleep for the next 18 years -- not to scare you or anything ;))

Make sure to get him involved with your projects asap :slight_smile: gotta grab'em while their young!

Cheers, already have 1 and 2 year old girls, both showing technical expertise already :wink:

Tried a new battery, no luck, so tried a higher capacity battery, still no luck. Any ideas if these have a setting in the EEPROM? Because it works perfectly with no battery, and normally people say it wont work without a battery.

I even rewrote the code and displayed on an LCD just incase there was something wrong with the serial monitor :wink:

I am beyond confused now...

Because it works perfectly with no battery, and normally people say it wont work without a battery.

It's been awhile sense I played with my RTC, but the battery's only function is to keep the oscillator running and memory alive when the board's 5vdc power is removed. It will not communicate with just the battery power, and indeed the chip will work with normal +5vdc board power even without a battery, but you will lose all time/date values if you remove +5volt power without having a battery wired up. Your described problem is a very strange one.

Lefty