EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: Deckert on July 16, 2013, 10:49:11 pm

Title: DS1307 clock chip won't oscillate
Post by: Deckert on July 16, 2013, 10:49:11 pm
Hi!

I'm building a control circuit that needs an RTC along with my selected uP. Everything works fine from the uP perspective, except for the DS1307 itself. The 32kHz oscillator simply doesn't seem to be working.

As per the data-sheet, the crystal (with a specified load capacitance of 12.5pf) is connected directly to pin1 and pin2 of the chip:

(https://lh3.googleusercontent.com/-1HjksompWog/UeXMYrO9KLI/AAAAAAAAKGk/wPNHwiylwCw/w423-h408-no/Reader+17-Jul-13+004147.jpg)

I've done this on a breadboard like this:

(https://lh6.googleusercontent.com/-Gp4JsYssPkg/UeXHChil-ZI/AAAAAAAAKF4/SXUWz2kmqxg/w700/IMG_2516.JPG)

Thinking that there may be some stray capacitance on the breadboard, I also tried it by soldering the crystal directly to pin1 and pin2 of the chip:

(https://lh5.googleusercontent.com/-I43w1S8_0gU/UeXHRjOIrAI/AAAAAAAAKGQ/Apn1vYbFjWE/w700/IMG_2521.JPG)

Still, no oscillation - measuring with a scope on the 1Hz output on pin7.

Any ideas why it won't oscillate?
Does the chip have to be addressed/configured before the oscillator will start up?

--deckert
Title: Re: DS1307 clock chip won't oscillate
Post by: Niklas on July 16, 2013, 11:42:31 pm
Have you checked with a scope if there is any activity on the crystal's pins? The datasheet says that the output must be enabled before you get anything. Chech the section about the control register and the SQWE bit. You should also ground the Vbat pin in the second picture, the one with the soldered crystal, so that the internal supply failure detection circuitry is not tricked.
Title: Re: DS1307 clock chip won't oscillate
Post by: Deckert on July 17, 2013, 12:22:18 am
Hi Niklas,

Have you checked with a scope if there is any activity on the crystal's pins?

Should have added that I did probe the pins (using a differential probe, so no inadvertent grounding of the circuit). I should have the DS1307 control code done by tomorrow to see if the chip needs to be "active" in any way, but my gut tells me something else is wrong, since the oscillator should just start up by itself.

And just to double-check, I used two (new) chips and two different crystals. Oh, and I tested the crystals using a classic dual-inverter oscillator with a 4069 - both crystals start up fine.

Agreed about the batt.pin in the second picture - I set it to 3V using a simple R divider (since the current draw is negligible), but made no difference.

 ???

--deckert
Title: Re: DS1307 clock chip won't oscillate
Post by: David_AVD on July 17, 2013, 01:37:39 am
From the data sheet:

Quote
Please note that the initial power on state of all registers is not defined. Therefore it is important to enable the oscillator (CH bit=0) during initial configuration.
Title: Re: DS1307 clock chip won't oscillate
Post by: Deckert on July 17, 2013, 08:37:05 am
Quote
Please note that the initial power on state of all registers is not defined. Therefore it is important to enable the oscillator (CH bit=0) during initial configuration.

Ha! It's even bold in the datasheet and yet I still missed it - thanks for highlighting it .. again :)

Will finish the control code this evening and feedback here. This project is part of an electric blanket controller project that I've been wanting to complete for some time!

--deckert