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

DS1302 registers

NewzedNewzed Posts: 2,503
edited 2007-07-02 22:15 in BASIC Stamp
All of a sudden I'm having problems with the DS1302 setting and reading the time, but not advancing the time like it should.· Can anyone tell me how to access the seconds register?

Thanks

Sid

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.

That is why they call it the present.

Don't have VGA?
Newzed@aol.com
·

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-07-02 20:42
    Sid, access to write or read the seconds?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • NewzedNewzed Posts: 2,503
    edited 2007-07-02 20:44
    Chris, I need to change Bit 7 of the seconds register to a 1 to see if it toggles the crystal.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-07-02 21:54
    Sid,

    Setting it to a 1 would typically stop it. You want it to be zero, which it normally would if you’re setting it with correct data. I would recommend downloading the DS1302 Demo Code and set the DS1302 and see if it runs. It should update in the DEBIG window at that point. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • NewzedNewzed Posts: 2,503
    edited 2007-07-02 22:10
    Chris, I have a good program that runs all my modules, except that I have some that won't keep time.· I talked to Maxim and they told me if I set Bit 7 to 1 and it toggled the voltage on one side of the crystal, then the crystal was probably bad.· So that is what I want to do - change Bit 7 from a 0 to a 1 and see if it toggles the crystal voltage.

    Do you know·how to set Bit 7 of the seconds register to 1?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-07-02 22:15
    Sid,

    To set bit 7, you would do something like this:

    secs.BIT7 = 1
    GOSUB RTC_Out

    Where RTC_Out is your write routine and you have already specified the register. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.