I do not know for certain that the CH bit is set to 1, I am just going on what I have been reading and other people having the same problem. I have tried new crystals and still no luck.
Just an observation, when I put this in the freezer it starts to advance the time at about 0 degrees (I was testing the temperature part of my project) I did think this was crystal related but as I said I purchased new crystals and still the same result.
I have been trying to read the 0 register but had much luck.
jpablo:
Just an observation, when I put this in the freezer it starts to advance the time at about 0 degrees (I was testing the temperature part of my project) I did think this was crystal related but as I said I purchased new crystals and still the same result.
Well that certainly indicates some kind of issue. Sounds like the oscillator may not be running. How is it constructed, breadboard?
but as you said there must be another issue as the CH bit seems to be set to 0
The clock was set to 50 secounds and the output from the above code from register 0x00 to the LCD is 80 (see pic) converting that to binary gives me 01010000 which is correct. (I think)
It such a simply chip but yet it defeats me. I have tyied soldering the crystal directly to chip. I have attached a few pics
jpablo:
The clock was set to 50 secounds and the output from the above code from register 0x00 to the LCD is 80 (see pic) converting that to binary gives me 01010000 which is correct. (I think)
It such a simply chip but yet it defeats me. I have tyied soldering the crystal directly to chip. I have attached a few pics
Yes, I think that is correct too. I'd still bet the oscillator isn't running. What board is that, I don't recognize it. I have half a dozen of Adafruit's DS1307 breakout boards, all work fine. I have a few loose DS1307s in 8-pin DIPs and crystals to go with, but haven't tried using them yet. Not sure how critical the layout is, the frequency being relatively low. There are some layout suggestions in the DS1307 datasheet, I might review those.
Not sure. Switching regulator? It works up in the air like that? If so, I'd think it's fairly immune to noise. Not sure what to say, just use general good practice. Keep leads short, put a 100nF bypass near the RTC chip, etc. See the DS1307 data sheet, they recommend a ground plane under the crystal I think. I haven't breadboarded a DS1307, but if I can find time I might try and let you know if it works. Anyhoo glad you got it working.