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

DS1302 Question

ArchiverArchiver Posts: 46,084
edited 2002-08-09 08:26 in General Discussion
I am working with a DS1302 timekeeping chip and would like to setup the
backup power for this using a diode and capacitor.

The documents leave the choice of a diode and capacitor up to the user.
I have no idea what to use.

Could someone recommend, including part numbers if possible, a suitable
diode and capacitor combination?

I am interested in it holding power for at least a couple of days.

Thanks in advance.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-08-08 18:29
    I know this is basic, but, I feel like a monkey doing a math problem...

    I'm trying to display the current time, using a DS1302, in hh:mm format to a
    serial LCD. The display seems to work, but, I'm screwing up the math
    somewhere on converting the time from the DS1302 raw time format to the
    format I need. Below is the formula I'm using, basically, it's not
    converting over 60 minutes (ie current time on the clock is 12:88, it's been
    runnig for several hours.) What am I missing?

    SEROUT LCD_SER, N9600, [noparse][[/noparse]DEC2 12 - (24 - (hrs10 * 10 + hrs01) // 12), ":",
    DEC2 mins]

    Thanks for the help,
    Matt
  • ArchiverArchiver Posts: 46,084
    edited 2002-08-08 22:00
    CHECK THE DATA SHEET. Time output is in BCD.

    Matt Georgy wrote:

    >I know this is basic, but, I feel like a monkey doing a math problem...
    >
    >I'm trying to display the current time, using a DS1302, in hh:mm format to a
    >serial LCD. The display seems to work, but, I'm screwing up the math
    >somewhere on converting the time from the DS1302 raw time format to the
    >format I need. Below is the formula I'm using, basically, it's not
    >converting over 60 minutes (ie current time on the clock is 12:88, it's been
    >runnig for several hours.) What am I missing?
    >
    >SEROUT LCD_SER, N9600, [noparse][[/noparse]DEC2 12 - (24 - (hrs10 * 10 + hrs01) // 12), ":",
    >DEC2 mins]
    >
    >Thanks for the help,
    >Matt
    >
    >
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-08-08 22:44
    When working with the 1302 just use hex modifier dec2 hex hours
    and it comes out correctly it is a form of BCD without the
    letters
    Original Message
    From: "Matt Georgy" <mgeorgy@d...>
    To: <basicstamps@yahoogroups.com>
    Sent: August 08, 2002 10:29 AM
    Subject: [noparse][[/noparse]basicstamps] DS1302 Question


    I know this is basic, but, I feel like a monkey doing a math
    problem...

    I'm trying to display the current time, using a DS1302, in hh:mm
    format to a
    serial LCD. The display seems to work, but, I'm screwing up the
    math
    somewhere on converting the time from the DS1302 raw time format
    to the
    format I need. Below is the formula I'm using, basically, it's
    not
    converting over 60 minutes (ie current time on the clock is
    12:88, it's been
    runnig for several hours.) What am I missing?

    SEROUT LCD_SER, N9600, [noparse][[/noparse]DEC2 12 - (24 - (hrs10 * 10 + hrs01) //
    12), ":",
    DEC2 mins]

    Thanks for the help,
    Matt



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the
    Subject and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-08-09 08:26
    Hi Matt,

    use 'HEX2 mins' instead of DEC.

    88 is HEX 58 which is what you want.

    Cheers
    Col

    --- In basicstamps@y..., "Matt Georgy" <mgeorgy@d...> wrote:
    > I know this is basic, but, I feel like a monkey doing a math
    problem...
    >
    > I'm trying to display the current time, using a DS1302, in hh:mm
    format to a
    > serial LCD. The display seems to work, but, I'm screwing up the
    math
    > somewhere on converting the time from the DS1302 raw time format to
    the
    > format I need. Below is the formula I'm using, basically, it's not
    > converting over 60 minutes (ie current time on the clock is 12:88,
    it's been
    > runnig for several hours.) What am I missing?
    >
    > SEROUT LCD_SER, N9600, [noparse][[/noparse]DEC2 12 - (24 - (hrs10 * 10 + hrs01) //
    12), ":",
    > DEC2 mins]
    >
    > Thanks for the help,
    > Matt
Sign In or Register to comment.