Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

[SOLVED] DS1307 RTC problem on PCB

Status
Not open for further replies.

palreddyanurag

Junior Member level 2
Joined
Feb 7, 2011
Messages
24
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
INDIA
Activity points
1,474
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... :?:
 

ZASto

Advanced Member level 3
Joined
Jan 9, 2008
Messages
758
Helped
149
Reputation
303
Reaction score
134
Trophy points
1,323
Location
Messy Corner, 44°47'31.56"N, 20°28'9.16"E
Activity points
5,144
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),...
 

erio

Full Member level 3
Joined
Feb 26, 2008
Messages
176
Helped
27
Reputation
54
Reaction score
23
Trophy points
1,298
Location
Indonesia
Activity points
2,167
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.
 

alexan_e

Administrator
Joined
Mar 16, 2008
Messages
11,895
Helped
2,021
Reputation
4,158
Reaction score
2,031
Trophy points
1,393
Location
Greece
Activity points
64,377
Check the battery connection or connect battery pin to gnd if a battery is not used

Alex
 

palreddyanurag

Junior Member level 2
Joined
Feb 7, 2011
Messages
24
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
INDIA
Activity points
1,474
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)
 

KerimF

Advanced Member level 4
Joined
May 17, 2011
Messages
1,461
Helped
374
Reputation
756
Reaction score
370
Trophy points
1,363
Location
Syria
Activity points
12,314
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.
 

palreddyanurag

Junior Member level 2
Joined
Feb 7, 2011
Messages
24
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
INDIA
Activity points
1,474
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...
 

jbrathod88

Junior Member level 3
Joined
Oct 14, 2010
Messages
31
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Ahmedabad, India
Activity points
1,556
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.
 

palreddyanurag

Junior Member level 2
Joined
Feb 7, 2011
Messages
24
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
INDIA
Activity points
1,474
hi man I hope you might be in a frustrated state...:???:
Initially Hardware interfacing of I2C protocol with DS1307 was difficult for me also
[HR][/HR]
Check
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
[HR][/HR]

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 ...
 

Attachments

jbrathod88

Junior Member level 3
Joined
Oct 14, 2010
Messages
31
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Ahmedabad, India
Activity points
1,556
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.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top