Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] DS1307 RTC problem on PCB

Not open for further replies.


Junior Member level 2
Feb 7, 2011
Reaction score
Trophy points
Activity points
strangely i am facing a problem, DS1307 worked fine on bread board but when i shifted it to PCB its I2C logic is working but not its clock what could be the reason ,I am baffled by this unexpected behavior what could be the cause... :?:

Any schematic, or relevant part, of your project AND a photo of your board? Maybe you missed some components or placed the wrong ones (too low resistors as pull-ups on I2C lines),...

or maybe the crystal? in the datasheet maxim says that crystal should be placed as close as possible and dont forget to connect its metal can to ground.

Check the battery connection or connect battery pin to gnd if a battery is not used


Sorry for replying late, the connections are as usual 4.7k pull up resistors,crystal 32.768 KHz,Battery (CR2302MicroLithium Cell 3V)
As far as I can think the pull up resistors(I faced the hell of this problem with this earlier trying to run DS1307 without a battery), battery connections etc. all are needed for proper working of I2C logic circuitry but here the clock is not running, the time is getting set and stored in DS1307 but the clock is not running is there any possibility of easily or instantly destroying DS1307 clock circuitry if proper voltages are not applied.I generally first check the SQW/OUT pin by placing LED and running at 1sec frequency(here I also checked with 7 segment LEDs)

There is a command to halt and run the clock. When the IC is placed on a board (that is removed from all supplies, battery and Vcc), the default mode is halt.

Due to bad soldering ,the crystal got destroyed as soon as it was kept in place needed to rework on PCB to make it working...

Hi, palreddyanurag

Please help me.
I am trying to interface DS1307 with AT89C2051. I have done it in Proteus successfully.
But when I run it in Breadboard, it gets fail. I have tried to find the reason, and i found that the RTC doesn't acknowledge.
The address I transmits is "0xD0".

Please tell me what things I have missed to wire up or in coding.
If possible, please attach the code in C for keil and the connection diagram of DS1307 without battery. I have tried many ways, but failed.

Please help me bro.

hi man I hope you might be in a frustrated state...:???:
Initially Hardware interfacing of I2C protocol with DS1307 was difficult for me also

That you have put in battery for DS1307 you need it.
Try running I2C at lower frequency(around 1 Hz) so that you can check it is working correctly using voltmeter or even oscilloscope!!!
Check also the max freq with which you run the I2C

I attatch two files ;-)
>Low level I2C routines
>High level I2C calling functions(You need these)

I think the files will solve the software in most of the cases ...


  • help.rar
    1.7 KB · Views: 103
Hi palreddyanurag,

You are right, I was in a frustrated state because I am trying to interface and run this IC for a past 4 days. I had in my mind that, I run the circuit successfully in Proteus then I would not face any problem in breadboard also.(except the 'ACK' signal that Proteus neglects). But I forgot than Proteus adjusts everything for proper running any integrated circuits,where we have to manually look for all of the working conditions.

As now, I solved the problem.

The main thing that I missed was to apply proper power to the DS1307. I was using the 7805 IC to reduce my general purpose 9V Battery voltage to 5V. But I observed that the voltage out from 7805 is 4.98v.
So i adjusted 7805 to give it 5.12v. And also connects the 1uF capacitor to power pin no.8 of DS1307.
After doing that I run it successfully!!:shock:.

But thanks for replying.
And also thanks for code, I really need it.

Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to