PDA

View Full Version : DS1302 Clock



DShannon
03-08-2005, 01:24 AM
Hi All,
have a question about the DS1302 clock that Parallax distributes.

Most of the sample code shown sets the clock time at program start up. Will the clock retain the setting, as long as I keep it continuesly powered with +5v? Ie, the stamp loses power but the DS1302 remains powered?

Thanks!

Newzed
03-08-2005, 01:29 AM
Negative. Pin 1 - Vcc1 - is powered by 5VDC from the Stamp. Pin 8 - Vcc2 - must be powered by a 3 volt lithium coin battery. When the clock detects there is less than 3 volts on pin 1, it automatically switches to pin 8. A lithium battery will keep your clock running - with no Stamp power - for 6 to 7 years.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
NEW! 4 MB EEPROM

http://hometown.aol.com/newzed/page4.html (http://hometown.aol.com/newzed/page4.html )

allanlane5
03-08-2005, 01:34 AM
Right. The DS1302 MUST remain powered with a 3-volt 'coin' cell applied between pin 8 and ground. This keeps the clock running (with a small 32Khz crystal can), as well as keeping the data within it, for between 6 and 7 YEARS. This is a really low power chip.

The 'Pin 1' VCC +5 volt pin is the one you power with the BS2 power. The reason most test programs reset the time is because the authors are never sure you've had the 1302 running before, or have a coin cell attached to the chip.

Newzed
03-08-2005, 01:41 AM
DShannon, take a look at the picture of my DS1302 piggyback. You will see how the battery is mounted.

http://hometown.aol.com/newzed/page1.html

Sid

DShannon
03-08-2005, 02:12 AM
Thanks Newzed!

Do you sell the Piggyback with the battery? Would I be able to substitute a DS1302*N* ? The reason I ask is becasue the *N* operates in <0 deg Celcius.....

Newzed
03-08-2005, 02:25 AM
A 1302 tells time. It does not read temperature.

kb2hap
03-08-2005, 02:51 AM
Newzed I think what D meant was that they wanted the DS1302 that was rated for -40c to +85c not a temp chip but military grade chip.
DS1302N

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
DTQ

DShannon
03-08-2005, 02:56 AM
Thanks kb2hap - that is what I meant. It is 2:30pm and my brain is still asleep! I am talking about the DS1302 that can operate at low temperatures.....


-Dan

Beau Schwabe (Parallax)
03-08-2005, 03:14 AM
DShannon,

Another alternative if you just want temporary power backup... i.e. when changing out the main battery,
you could use a Capacitor in place of a 3V lithium. Check out the trickle charging options on pages
3,4 and 7 of the datasheet. The size of the capacitor will determine how long you have to make the
battery exchange.

DS1302 Datasheet (http://neptune.lisa.univ-paris12.fr/Electronik/DataSheets/Dallas_1302.pdf)





Newzed said...
....Pin 1 - Vcc1 - is powered by 5VDC from the Stamp. Pin 8 - Vcc2.....


Newzed,

Double check that, the datasheet says Pin 1 is Vcc2, and that Pin 8 is Vcc1

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
------------------------------------------------------------------------------------
Beau Schwabe - Mask Designer III

National Semiconductor Corporation (http://www.national.com/)
(Communication Interface Division)
500 Pinnacle Court, Suite 525
Mail Stop GA1
Norcross,GA 30071
-------------------------------------------------------------------------------------

Newzed
03-08-2005, 03:39 AM
DShannon, I can build you a piggyback with the DS102N. Please contact me off forum at Newzed@aol.com (mailto:Newzed@aol.com).

Sid