Shop OBEX P1 Docs P2 Docs Learn Events
DS1302 Clock — Parallax Forums

DS1302 Clock

DShannonDShannon Posts: 26
edited 2005-03-07 20:39 in BASIC Stamp
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!

Comments

  • NewzedNewzed Posts: 2,503
    edited 2005-03-07 18:29
    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
    ·
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-07 18:34
    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.
  • NewzedNewzed Posts: 2,503
    edited 2005-03-07 18:41
    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
  • DShannonDShannon Posts: 26
    edited 2005-03-07 19:12
    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.....
  • NewzedNewzed Posts: 2,503
    edited 2005-03-07 19:25
    A 1302 tells time.· It does not read temperature.
  • kb2hapkb2hap Posts: 218
    edited 2005-03-07 19:51
    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
  • DShannonDShannon Posts: 26
    edited 2005-03-07 19:56
    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 SchwabeBeau Schwabe Posts: 6,557
    edited 2005-03-07 20:14
    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



    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
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071
  • NewzedNewzed Posts: 2,503
    edited 2005-03-07 20:39
    DShannon, I can build you a piggyback with the DS102N.· Please contact me off forum at Newzed@aol.com.

    Sid
Sign In or Register to comment.