DS1302 clock does not run
Jonny555
Posts: 46
Looking over the crystal considerations appnote for the DS1302 they mention that the reason why a clock doesn't run might be "the CH (clock halt) or EOSC (enable oscillator) bit has not been set or cleared".
Looking at the code from "StampWorks Experiment #30: Using Real Time Clock",
I·do not see any mention of setting the CH bit. The crystal in use is a citizen which is listed.
Could someone offer advice as to why my clock isn't running?
Anyone have some code which demonstrates this?
Looking at the code from "StampWorks Experiment #30: Using Real Time Clock",
I·do not see any mention of setting the CH bit. The crystal in use is a citizen which is listed.
Could someone offer advice as to why my clock isn't running?
Anyone have some code which demonstrates this?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Knight Designs
324 West Main Street
P.O. Box 97
Montour Falls, NY 14865
(607) 535-6777
Business Page:·· http://www.knightdesigns.com
Personal Page:··· http://www.lightlink.com/dream/chris
Designs Page:··· http://www.lightlink.com/dream/designs
·
The code runs as-is without buttons attached and results in descending day/time displaying to debug.
I ripped the circuit apart and re-wired it to no avail. I'm simply trying to set the time without buttons and display it to the debug screen. The clock sits at "Sunday 12:00:00 AM". I'm going to have another look at the code,
I must have missed something.
Post Edited (Jonny555) : 9/5/2004 10:58:45 PM GMT
http://www.parallax.com/dl/docs/prod/appkit/ds1302rtc.pdf show the pin connections like this:
BS2······· DS1302
Pin0<--->Pin7(SCLK)
Pin1<--->Pin6(IO)
Pin2<--->Pin5(RST)
But the stampworks(http://www.parallax.com/dl/docs/books/sw/exp/sw30.pdf) has it setup like this:
Pin0<--->Pin6(IO)
Pin1<--->Pin7(SCLK)
Pin2<--->Pin5(RST)
by switching the pins my clock began advancing on its own...
All this headache over inverted wires lol
Jon
Post Edited (Jonny555) : 9/6/2004 7:28:12 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Knight Designs
324 West Main Street
P.O. Box 97
Montour Falls, NY 14865
(607) 535-6777
Business Page:·· http://www.knightdesigns.com
Personal Page:··· http://www.lightlink.com/dream/chris
Designs Page:··· http://www.lightlink.com/dream/designs
·
·
Regards
Klubbsson· (from Sweden)
The attached code is the free code from my Digital Thermostat Prototype.· The attached code runs on a stock BS2, and reads data from a Battery-Backed DS1302 (This code doesn't preset the time) and a DS1620, and displays them on a 20 X 4 LCD Display.· Of course, there are other routines, but everything is well-documented.· If you have any questions, either post them here, or to designs@knightdesigns.com and I will address them.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Knight Designs
324 West Main Street
P.O. Box 97
Montour Falls, NY 14865
(607) 535-6777
Business Page:·· http://www.knightdesigns.com
Personal Page:··· http://www.lightlink.com/dream/chris
Designs Page:··· http://www.lightlink.com/dream/designs
That's the main way I connect LCDs to the BS2s...When I have a surplus of pins, I use 4-bit parallel, but the code above uses all SEROUT @ 9600bps.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Knight Designs
324 West Main Street
P.O. Box 97
Montour Falls, NY 14865
(607) 535-6777
Business Page:·· http://www.knightdesigns.com
Personal Page:··· http://www.lightlink.com/dream/chris
Designs Page:··· http://www.lightlink.com/dream/designs
·
But it is a long way to get there for me. I bought the Parralax summer special 3 weeks ago and for the fist time started to learn programming.· So I’m very grateful for all help I can get.
You may, however, need to replace the DS1620 with an ADC0803 and an LM34 or similar so that you can get accurate water temperature.
To be honest I was only offering the code in respect to displaying the time from the DS1302 on an LCD Display, I didn't remember what your original application was.
Good Luck...I will help if I can.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Knight Designs
324 West Main Street
P.O. Box 97
Montour Falls, NY 14865
(607) 535-6777
Business Page:·· http://www.knightdesigns.com
Personal Page:··· http://www.lightlink.com/dream/chris
Designs Page:··· http://www.lightlink.com/dream/designs
·
Post Edited (Orion) : 9/15/2004 1:52:48 AM GMT